diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 93800c515181b03e8ebdf71d94a1213f60592c17..b7a6290c35d22368bda40551dcb32c0be0fbfea8 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -26,16 +26,4 @@ test:coverage: script: - cd build - make unit_tests - - make coverage-report - -pages:coverage: - stage: deploy - dependencies: - - test:coverage - script: - - rm -rf public/ - - mv build/coverage/ public/ - artifacts: - paths: - - public - expire_in: 30 days + - make coverage diff --git a/CMakeLists.txt b/CMakeLists.txt index ec3c5202830acb3a7155e011a34ee1722f39b910..3736b81c3862a85141eaf2ffde8459781ee3a369 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -10,8 +10,17 @@ include(CheckNotInSources) #----------------- Main configuration ----------------- #------------------------------------------------------ -project (Pastis - VERSION 0.3.0) +# custom variable allowing to define version suffixes such as -rc*, -beta*, ... +set(PASTIS_VERSION "0.3.0") + +# deduce PASTIS_SHORT_VERSION using regex +string(REGEX MATCH "^[0-9]+\.[0-9]+\.[0-9]+" PASTIS_SHORT_VERSION ${PASTIS_VERSION}) +if("${PASTIS_SHORT_VERSION}" STREQUAL "") + message(FATAL_ERROR "Unable to compute short version from PASTIS_VERSION=${PASTIS_VERSION}") +endif() + +# set project version as PASTIS_SHORT_VERSION +project (Pastis VERSION ${PASTIS_SHORT_VERSION}) #------------------------------------------------------ @@ -24,34 +33,41 @@ set(PASTIS_BINARY_DIR "${CMAKE_CURRENT_BINARY_DIR}") # Add new build types message("* Adding build types...") -SET(CMAKE_CXX_FLAGS_COVERAGE +set(CMAKE_CXX_FLAGS_COVERAGE "-g -Wall -O0 --coverage" CACHE STRING "Flags used by the C++ compiler during coverage builds." FORCE ) -SET(CMAKE_C_FLAGS_COVERAGE +set(CMAKE_C_FLAGS_COVERAGE "-g -Wall -O0 --coverage" CACHE STRING "Flags used by the C compiler during coverage builds." FORCE ) -SET(CMAKE_EXE_LINKER_FLAGS_COVERAGE +set(CMAKE_EXE_LINKER_FLAGS_COVERAGE "--coverage" CACHE STRING "Flags used for linking binaries during coverage builds." FORCE ) -SET(CMAKE_SHARED_LINKER_FLAGS_COVERAGE +set(CMAKE_SHARED_LINKER_FLAGS_COVERAGE "--coverage" CACHE STRING "Flags used by the shared libraries linker during coverage builds." FORCE ) -MARK_AS_ADVANCED( +mark_as_advanced( CMAKE_CXX_FLAGS_COVERAGE CMAKE_C_FLAGS_COVERAGE CMAKE_EXE_LINKER_FLAGS_COVERAGE CMAKE_SHARED_LINKER_FLAGS_COVERAGE ) +if(CMAKE_BUILD_TYPE) + string(REGEX MATCH "(Debug|Release|RelWithDebInfo|MinSizeRel|Coverage)" VALID_BUILD_TYPE "${CMAKE_BUILD_TYPE}") + if(NOT VALID_BUILD_TYPE) + message(FATAL_ERROR "Invalid CMAKE_BUILD_TYPE: '${CMAKE_BUILD_TYPE}'") + endif() +endif() + # Default build type is RelWIthDebInfo if(NOT CMAKE_BUILD_TYPE) set(CMAKE_BUILD_TYPE "RelWithDebInfo" CACHE STRING "Choose the type of build: Debug Release RelWithDebInfo MinSizeRel Coverage." FORCE) -endif(NOT CMAKE_BUILD_TYPE) +endif() #------------------------------------------------------ @@ -60,7 +76,7 @@ set(GNU_CXX_MIN_VERSION "7.0.0") set(CLANG_CXX_MIN_VERSION "5.0.0") # Pastis default compiler flags -set(PASTIS_CXX_FLAGS "${PASTIS_CXX_FLAGS} -Wall") +set(PASTIS_CXX_FLAGS "${PASTIS_CXX_FLAGS} -Wall -Wextra") if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU") if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS "${GNU_CXX_MIN_VERSION}") @@ -88,11 +104,14 @@ set(KOKKOS_ENABLE_EXPLICIT_INSTANTIATION OFF CACHE BOOL "") # do not use Kokkos deprecated code set(KOKKOS_ENABLE_DEPRECATED_CODE OFF CACHE BOOL "") -# Kokkso compiler flags +# Kokkos compiler flags add_subdirectory(${PASTIS_SOURCE_DIR}/packages/kokkos) -include_directories(${Kokkos_INCLUDE_DIRS_RET}) +include_directories(SYSTEM ${Kokkos_INCLUDE_DIRS_RET}) include(GetKokkosCompilerFlags) +# do not pollute compilation with Kokkos internal warnings +set_target_properties(kokkos PROPERTIES COMPILE_FLAGS "-w") + # sets Kokkos debug flags when non release build if (CMAKE_BUILD_TYPE MATCHES "Release") set (KOKKOS_ENABLE_DEBUG OFF) diff --git a/cmake/GetPastisGitRevision.cmake b/cmake/GetPastisGitRevision.cmake index f3b6919e5260de92352cb3dee838c56b5226dc7c..470ed7191af9c6e51010a8c47969fe63813007ad 100644 --- a/cmake/GetPastisGitRevision.cmake +++ b/cmake/GetPastisGitRevision.cmake @@ -6,7 +6,7 @@ find_package(Git QUIET) if(GIT_FOUND) execute_process( - COMMAND "${GIT_EXECUTABLE}" describe "--abbrev=0" + COMMAND "${GIT_EXECUTABLE}" describe "--abbrev=0" "--match=v[0-9]*" WORKING_DIRECTORY "${PASTIS_SOURCE_DIR}" OUTPUT_VARIABLE PASTIS_GIT_TAG RESULT_VARIABLE FOUND_PASTIS_GIT_INFO @@ -45,12 +45,10 @@ else() unset(HAS_PASTIS_GIT_INFO) endif() -string(FIND "${PASTIS_GIT_TAG}" "${CMAKE_PASTIS_VERSION}" FOUND_VERSION_SUBSTR) - if(FOUND_PASTIS_GIT_INFO EQUAL 0) - if("${FOUND_VERSION_SUBSTR}" STREQUAL "-1") + if(NOT("${PASTIS_GIT_TAG}" STREQUAL "v${PASTIS_VERSION}")) message("") - message ("###### CMake code version ${CMAKE_PASTIS_VERSION} and") + message ("###### CMake code version ${PASTIS_VERSION} and") message ("###### git revision info ${PASTIS_GIT_TAG} do not match!") message("") endif() @@ -65,5 +63,3 @@ endif() configure_file("${PASTIS_SOURCE_DIR}/src/utils/pastis_git_revision.hpp.in" "${CMAKE_CURRENT_BINARY_DIR}/pastis_git_revision" @ONLY) - - diff --git a/packages/CLI11/.gitrepo b/packages/CLI11/.gitrepo index 96c408126ab71f57466b1bfba721bdb7f67d4bda..7c4acccc96c7629f0266ca22bf67012d55357201 100644 --- a/packages/CLI11/.gitrepo +++ b/packages/CLI11/.gitrepo @@ -6,6 +6,7 @@ [subrepo] remote = git@github.com:CLIUtils/CLI11.git branch = master - commit = da901cca542612a133efcb04e8e78080186991e4 - parent = 4348958e3bface85aedc9e8a5638f38790834cd5 - cmdver = 0.3.1 + commit = bd4dc911847d0cde7a6b41dfa626a85aab213baf + parent = 5c82607003abda391c299d089e4624664a41de7a + cmdver = 0.4.0 + method = merge diff --git a/packages/CLI11/CHANGELOG.md b/packages/CLI11/CHANGELOG.md index ba405ea012b21239467c9c1d48adf9ca0ee1d55b..0b8ade8eadf04574261dc5dd52d523973fd14690 100644 --- a/packages/CLI11/CHANGELOG.md +++ b/packages/CLI11/CHANGELOG.md @@ -1,6 +1,6 @@ ## Version 1.6.2: Help-all -This version fixes some formatting bugs with help-all. It also adds fixes for several warnings, including an experimental optional error on Clang 7. +This version fixes some formatting bugs with help-all. It also adds fixes for several warnings, including an experimental optional error on Clang 7. Several smaller fixes. * Fixed help-all formatting [#163] * Printing help-all on nested command now fixed (App) @@ -11,11 +11,16 @@ This version fixes some formatting bugs with help-all. It also adds fixes for se * Fixed CMake install as subproject with `CLI11_INSTALL` flag. [#156] * Fixed warning about local variable hiding class member with MSVC [#157] * Fixed compile error with default settings on Clang 7 and libc++ [#158] +* Fixed special case of `--help` on subcommands (general fix planned for 1.7) [#168] +* Removing an option with links [#179] [#156]: https://github.com/CLIUtils/CLI11/issues/156 [#157]: https://github.com/CLIUtils/CLI11/issues/157 [#158]: https://github.com/CLIUtils/CLI11/issues/158 [#163]: https://github.com/CLIUtils/CLI11/pull/163 +[#168]: https://github.com/CLIUtils/CLI11/issues/168 +[#179]: https://github.com/CLIUtils/CLI11/pull/179 + ## Version 1.6.1: Platform fixes diff --git a/packages/CLI11/README.md b/packages/CLI11/README.md index 319769ff0943e40d905356886b2ececac1c7fe12..c03b5e904ac05b9a558abde3ac5f3576bcae7ea3 100644 --- a/packages/CLI11/README.md +++ b/packages/CLI11/README.md @@ -458,6 +458,9 @@ Significant features and/or improvements to the code were contributed by: - [Nathan Hourt](https://github.com/nathanhourt) - [Sean Fisk](https://github.com/seanfisk) - [Stéphane Del Pino](https://github.com/delpinux) +- [Mak Kolybabi](https://github.com/mogigoma) +- [Paweł Bylica](https://github.com/chfast) + ## License diff --git a/packages/CLI11/examples/CMakeLists.txt b/packages/CLI11/examples/CMakeLists.txt index ef17d2c2f8351f1771161281f503ea7d65c0a1c1..56a58e87c1867193dba7773b517926a6d9db2408 100644 --- a/packages/CLI11/examples/CMakeLists.txt +++ b/packages/CLI11/examples/CMakeLists.txt @@ -128,3 +128,7 @@ set_property(TEST subcom_in_files PROPERTY PASS_REGULAR_EXPRESSION add_cli_exe(formatter formatter.cpp) add_cli_exe(nested nested.cpp) + +add_cli_exe(subcom_help subcom_help.cpp) +add_test(NAME subcom_help_normal COMMAND subcom_help sub --help) +add_test(NAME subcom_help_reversed COMMAND subcom_help --help sub) diff --git a/packages/CLI11/examples/subcom_help.cpp b/packages/CLI11/examples/subcom_help.cpp new file mode 100644 index 0000000000000000000000000000000000000000..0d8997d9d4f11eed94e0793de9ee23e1ee54d28d --- /dev/null +++ b/packages/CLI11/examples/subcom_help.cpp @@ -0,0 +1,14 @@ +#include <CLI/CLI.hpp> +#include <iostream> + +int main(int argc, char *argv[]) { + CLI::App cli_global{"Demo app"}; + auto &cli_sub = *cli_global.add_subcommand("sub", "Some subcommand"); + std::string sub_arg; + cli_sub.add_option("sub_arg", sub_arg, "Argument for subcommand")->required(); + CLI11_PARSE(cli_global, argc, argv); + if(cli_sub) { + std::cout << "Got: " << sub_arg << std::endl; + } + return 0; +} diff --git a/packages/CLI11/extern/json b/packages/CLI11/extern/json index d2dd27dc3b8472dbaa7d66f83619b3ebcd9185fe..f1768a540a7b7c5cc30cdcd6be9e9ef91083719b 160000 --- a/packages/CLI11/extern/json +++ b/packages/CLI11/extern/json @@ -1 +1 @@ -Subproject commit d2dd27dc3b8472dbaa7d66f83619b3ebcd9185fe +Subproject commit f1768a540a7b7c5cc30cdcd6be9e9ef91083719b diff --git a/packages/CLI11/include/CLI/App.hpp b/packages/CLI11/include/CLI/App.hpp index eebab3bfa0f6809b85b514799150eb6d77bb726f..4b207e13373c60b7fd15c1af75a4cdddc15422d5 100644 --- a/packages/CLI11/include/CLI/App.hpp +++ b/packages/CLI11/include/CLI/App.hpp @@ -781,6 +781,12 @@ class App { /// Removes an option from the App. Takes an option pointer. Returns true if found and removed. bool remove_option(Option *opt) { + // Make sure no links exist + for(Option_p &op : options_) { + op->remove_needs(opt); + op->remove_excludes(opt); + } + auto iterator = std::find_if(std::begin(options_), std::end(options_), [opt](const Option_p &v) { return v.get() == opt; }); if(iterator != std::end(options_)) { @@ -1341,6 +1347,10 @@ class App { // Verify required options for(const Option_p &opt : options_) { + // Exit if a help flag was passed (requirements not required in that case) + if(_any_help_flag()) + break; + // Required or partially filled if(opt->get_required() || opt->count() != 0) { // Make sure enough -N arguments parsed (+N is already handled in parsing function) @@ -1352,7 +1362,7 @@ class App { throw RequiredError(opt->get_name()); } // Requires - for(const Option *opt_req : opt->requires_) + for(const Option *opt_req : opt->needs_) if(opt->count() > 0 && opt_req->count() == 0) throw RequiresError(opt->get_name(), opt_req->get_name()); // Excludes @@ -1379,6 +1389,21 @@ class App { } } + /// Return True if a help flag detected (checks all parents) (only run if help called before subcommand) + bool _any_help_flag() const { + bool result = false; + const Option *help_ptr = get_help_ptr(); + const Option *help_all_ptr = get_help_all_ptr(); + if(help_ptr != nullptr && help_ptr->count() > 0) + result = true; + if(help_all_ptr != nullptr && help_all_ptr->count() > 0) + result = true; + if(parent_ != nullptr) + return result || parent_->_any_help_flag(); + else + return result; + } + /// Parse one config param, return false if not found in any subcommand, remove if it is /// /// If this has more than one dot.separated.name, go into the subcommand matching it @@ -1395,7 +1420,6 @@ class App { if(level < item.parents.size()) { App *subcom; try { - std::cout << item.parents.at(level) << std::endl; subcom = get_subcommand(item.parents.at(level)); } catch(const OptionNotFound &) { return false; diff --git a/packages/CLI11/include/CLI/Option.hpp b/packages/CLI11/include/CLI/Option.hpp index a5f046a22acf1a75aa7e406959dfd4feadedcbab..c37e39f7b0049dc7f522dbf27ddf99778eb97978 100644 --- a/packages/CLI11/include/CLI/Option.hpp +++ b/packages/CLI11/include/CLI/Option.hpp @@ -200,7 +200,7 @@ class Option : public OptionBase<Option> { std::vector<std::function<std::string(std::string &)>> validators_; /// A list of options that are required with this option - std::set<Option *> requires_; + std::set<Option *> needs_; /// A list of options that are excluded with this option std::set<Option *> excludes_; @@ -322,7 +322,7 @@ class Option : public OptionBase<Option> { /// Sets required options Option *needs(Option *opt) { - auto tup = requires_.insert(opt); + auto tup = needs_.insert(opt); if(!tup.second) throw OptionAlreadyAdded::Requires(get_name(), opt->get_name()); return this; @@ -342,6 +342,18 @@ class Option : public OptionBase<Option> { return needs(opt1, args...); } + /// Remove needs link from an option. Returns true if the option really was in the needs list. + bool remove_needs(Option *opt) { + auto iterator = std::find(std::begin(needs_), std::end(needs_), opt); + + if(iterator != std::end(needs_)) { + needs_.erase(iterator); + return true; + } else { + return false; + } + } + /// Sets excluded options Option *excludes(Option *opt) { excludes_.insert(opt); @@ -369,6 +381,18 @@ class Option : public OptionBase<Option> { return excludes(opt1, args...); } + /// Remove needs link from an option. Returns true if the option really was in the needs list. + bool remove_excludes(Option *opt) { + auto iterator = std::find(std::begin(excludes_), std::end(excludes_), opt); + + if(iterator != std::end(excludes_)) { + excludes_.erase(iterator); + return true; + } else { + return false; + } + } + /// Sets environment variable to read if no option given Option *envname(std::string name) { envname_ = name; @@ -418,7 +442,7 @@ class Option : public OptionBase<Option> { std::string get_envname() const { return envname_; } /// The set of options needed - std::set<Option *> get_needs() const { return requires_; } + std::set<Option *> get_needs() const { return needs_; } /// The set of options excluded std::set<Option *> get_excludes() const { return excludes_; } diff --git a/packages/CLI11/include/CLI/Version.hpp b/packages/CLI11/include/CLI/Version.hpp index 80eaf2a0d2b674d03e4f222d83d2696657b4bb81..b2ae8641d8dc69513719a3e5fad72d2e0a0a98f7 100644 --- a/packages/CLI11/include/CLI/Version.hpp +++ b/packages/CLI11/include/CLI/Version.hpp @@ -7,7 +7,7 @@ #define CLI11_VERSION_MAJOR 1 #define CLI11_VERSION_MINOR 6 -#define CLI11_VERSION_PATCH 1 -#define CLI11_VERSION "1.6.1" +#define CLI11_VERSION_PATCH 2 +#define CLI11_VERSION "1.6.2" // [CLI11:verbatim] diff --git a/packages/CLI11/tests/AppTest.cpp b/packages/CLI11/tests/AppTest.cpp index 1c6a969f7f05d6c33bdd944fc3796257bb8b3d5f..b1bd218e5e3bec2a8cd27f2ad4a21dd0ea000f93 100644 --- a/packages/CLI11/tests/AppTest.cpp +++ b/packages/CLI11/tests/AppTest.cpp @@ -816,6 +816,34 @@ TEST_F(TApp, RemoveOption) { EXPECT_THROW(run(), CLI::ExtrasError); } +TEST_F(TApp, RemoveNeedsLinks) { + auto one = app.add_flag("--one"); + auto two = app.add_flag("--two"); + + two->needs(one); + one->needs(two); + + EXPECT_TRUE(app.remove_option(one)); + + args = {"--two"}; + + run(); +} + +TEST_F(TApp, RemoveExcludesLinks) { + auto one = app.add_flag("--one"); + auto two = app.add_flag("--two"); + + two->excludes(one); + one->excludes(two); + + EXPECT_TRUE(app.remove_option(one)); + + args = {"--two"}; + + run(); // Mostly hoping it does not crash +} + TEST_F(TApp, FileNotExists) { std::string myfile{"TestNonFileNotUsed.txt"}; ASSERT_NO_THROW(CLI::NonexistentPath(myfile)); diff --git a/packages/CLI11/tests/SubcommandTest.cpp b/packages/CLI11/tests/SubcommandTest.cpp index bc5d8ca0095c0c311ce586107d1f2b90eef2fd7f..e752f4f2c74bd8ea35cbd2562a5862d8f40e00bb 100644 --- a/packages/CLI11/tests/SubcommandTest.cpp +++ b/packages/CLI11/tests/SubcommandTest.cpp @@ -438,6 +438,8 @@ struct SubcommandProgram : public TApp { int count; SubcommandProgram() { + app.set_help_all_flag("--help-all"); + start = app.add_subcommand("start", "Start prog"); stop = app.add_subcommand("stop", "Stop prog"); @@ -541,6 +543,18 @@ TEST_F(SubcommandProgram, HelpOrder) { EXPECT_THROW(run(), CLI::CallForHelp); } +TEST_F(SubcommandProgram, HelpAllOrder) { + + args = {"--help-all"}; + EXPECT_THROW(run(), CLI::CallForAllHelp); + + args = {"start", "--help-all"}; + EXPECT_THROW(run(), CLI::CallForAllHelp); + + args = {"--help-all", "start"}; + EXPECT_THROW(run(), CLI::CallForAllHelp); +} + TEST_F(SubcommandProgram, Callbacks) { start->callback([]() { throw CLI::Success(); }); diff --git a/packages/Catch2/.conan/build.py b/packages/Catch2/.conan/build.py new file mode 100644 index 0000000000000000000000000000000000000000..dfba26428ee60107dc165dbf764202d286d4263e --- /dev/null +++ b/packages/Catch2/.conan/build.py @@ -0,0 +1,94 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +import os +import re +from cpt.packager import ConanMultiPackager +from cpt.ci_manager import CIManager +from cpt.printer import Printer + + +class BuilderSettings(object): + @property + def username(self): + """ Set catchorg as package's owner + """ + return os.getenv("CONAN_USERNAME", "catchorg") + + @property + def login_username(self): + """ Set Bintray login username + """ + return os.getenv("CONAN_LOGIN_USERNAME", "horenmar") + + @property + def upload(self): + """ Set Catch2 repository to be used on upload. + The upload server address could be customized by env var + CONAN_UPLOAD. If not defined, the method will check the branch name. + Only master or CONAN_STABLE_BRANCH_PATTERN will be accepted. + The master branch will be pushed to testing channel, because it does + not match the stable pattern. Otherwise it will upload to stable + channel. + """ + return os.getenv("CONAN_UPLOAD", "https://api.bintray.com/conan/catchorg/Catch2") + + @property + def upload_only_when_stable(self): + """ Force to upload when running over tag branch + """ + return os.getenv("CONAN_UPLOAD_ONLY_WHEN_STABLE", "True").lower() in ["true", "1", "yes"] + + @property + def stable_branch_pattern(self): + """ Only upload the package the branch name is like a tag + """ + return os.getenv("CONAN_STABLE_BRANCH_PATTERN", r"v\d+\.\d+\.\d+") + + @property + def reference(self): + """ Read project version from branch create Conan referece + """ + return os.getenv("CONAN_REFERENCE", "Catch2/{}".format(self._version)) + + @property + def channel(self): + """ Default Conan package channel when not stable + """ + return os.getenv("CONAN_CHANNEL", "testing") + + @property + def _version(self): + """ Get version name from cmake file + """ + pattern = re.compile(r"project\(Catch2 LANGUAGES CXX VERSION (\d+\.\d+\.\d+)\)") + version = "latest" + with open("CMakeLists.txt") as file: + for line in file: + result = pattern.search(line) + if result: + version = result.group(1) + return version + + @property + def _branch(self): + """ Get branch name from CI manager + """ + printer = Printer(None) + ci_manager = CIManager(printer) + return ci_manager.get_branch() + + +if __name__ == "__main__": + settings = BuilderSettings() + builder = ConanMultiPackager( + reference=settings.reference, + channel=settings.channel, + upload=settings.upload, + upload_only_when_stable=settings.upload_only_when_stable, + stable_branch_pattern=settings.stable_branch_pattern, + login_username=settings.login_username, + username=settings.username, + test_folder=os.path.join(".conan", "test_package")) + builder.add() + builder.run() diff --git a/packages/Catch2/.conan/test_package/CMakeLists.txt b/packages/Catch2/.conan/test_package/CMakeLists.txt new file mode 100644 index 0000000000000000000000000000000000000000..db05659904e4c55ea9ca233d4765995b9fc485c8 --- /dev/null +++ b/packages/Catch2/.conan/test_package/CMakeLists.txt @@ -0,0 +1,11 @@ +cmake_minimum_required(VERSION 3.2.0) +project(test_package CXX) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(Catch2 REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} CONAN_PKG::Catch2) +set_target_properties(${PROJECT_NAME} PROPERTIES CXX_STANDARD 11) diff --git a/packages/Catch2/.conan/test_package/conanfile.py b/packages/Catch2/.conan/test_package/conanfile.py new file mode 100644 index 0000000000000000000000000000000000000000..0a0da54aa17c019bd4ce45d81f539a5dbfed20a0 --- /dev/null +++ b/packages/Catch2/.conan/test_package/conanfile.py @@ -0,0 +1,19 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- +from conans import ConanFile, CMake +import os + + +class TestPackageConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "cmake" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + assert os.path.isfile(os.path.join(self.deps_cpp_info["Catch2"].rootpath, "licenses", "LICENSE.txt")) + bin_path = os.path.join("bin", "test_package") + self.run("%s -s" % bin_path, run_environment=True) diff --git a/packages/Catch2/.conan/test_package/test_package.cpp b/packages/Catch2/.conan/test_package/test_package.cpp new file mode 100644 index 0000000000000000000000000000000000000000..cff50de5495a32923d1fcbeeea81020ff9fb5079 --- /dev/null +++ b/packages/Catch2/.conan/test_package/test_package.cpp @@ -0,0 +1,15 @@ +#define CATCH_CONFIG_MAIN + +#include <catch2/catch.hpp> + +int Factorial( int number ) { + return number <= 1 ? 1 : Factorial( number - 1 ) * number; +} + +TEST_CASE( "Factorial Tests", "[single-file]" ) { + REQUIRE( Factorial(0) == 1 ); + REQUIRE( Factorial(1) == 1 ); + REQUIRE( Factorial(2) == 2 ); + REQUIRE( Factorial(3) == 6 ); + REQUIRE( Factorial(10) == 3628800 ); +} \ No newline at end of file diff --git a/packages/Catch2/.gitignore b/packages/Catch2/.gitignore index ffce8e91c77f8eea789dfc26a5d781a3e1065544..f017e9e09f991ed589a0f3b27b8bc490be28b5c1 100644 --- a/packages/Catch2/.gitignore +++ b/packages/Catch2/.gitignore @@ -27,3 +27,4 @@ Build .vs cmake-build-* benchmark-dir +.conan/test_package/build diff --git a/packages/Catch2/.gitrepo b/packages/Catch2/.gitrepo index 5c9fe5b98047e2bd6495c7a894c42e09244a586b..69a7ef8a31ff838cc194e72ba5b5218ceba72434 100644 --- a/packages/Catch2/.gitrepo +++ b/packages/Catch2/.gitrepo @@ -6,6 +6,7 @@ [subrepo] remote = git@github.com:catchorg/Catch2.git branch = master - commit = 9e1bdca4667295fcb16265eae00efa8423f07007 - parent = cd9b656f2a2e7fe914557e186f30b2123bcb98b4 - cmdver = 0.3.1 + commit = 461843b1f02a4bf5c59db88ff201d2c56fabf3a4 + parent = 948c251985efea2e0b476fbab221850efee6a689 + cmdver = 0.4.0 + method = merge diff --git a/packages/Catch2/.travis.yml b/packages/Catch2/.travis.yml index 1d38d8602c7ccc509ee8ce1cd997664247f46dd1..ebf238591ce2994fe2368e3e2e1e95c1859ab698 100644 --- a/packages/Catch2/.travis.yml +++ b/packages/Catch2/.travis.yml @@ -1,5 +1,4 @@ language: cpp -sudo: false branches: except: @@ -271,6 +270,19 @@ matrix: packages: ['clang-6.0', 'libstdc++-8-dev'] env: COMPILER='clang++-6.0' CPP17=1 EXAMPLES=1 COVERAGE=1 EXTRAS=1 + # 8/ Conan + - language: python + python: + - "3.7" + dist: xenial + install: + - pip install conan conan-package-tools + env: + - CONAN_GCC_VERSIONS=8 + - CONAN_DOCKER_IMAGE=conanio/gcc8 + script: + - python .conan/build.py + install: - DEPS_DIR="${TRAVIS_BUILD_DIR}/deps" - mkdir -p ${DEPS_DIR} && cd ${DEPS_DIR} diff --git a/packages/Catch2/CMakeLists.txt b/packages/Catch2/CMakeLists.txt index 09793f7b3c2a304868fdb0cc4e8fcd48ef961b61..802ff45908124b66eddd885e75817076f6bc505d 100644 --- a/packages/Catch2/CMakeLists.txt +++ b/packages/Catch2/CMakeLists.txt @@ -6,7 +6,7 @@ if(NOT DEFINED PROJECT_NAME) set(NOT_SUBPROJECT ON) endif() -project(Catch2 LANGUAGES CXX VERSION 2.4.1) +project(Catch2 LANGUAGES CXX VERSION 2.5.0) # Provide path for scripts list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/CMake") diff --git a/packages/Catch2/README.md b/packages/Catch2/README.md index 73162bbf498736c05f891e28df04248fa6c25d30..f1f67f5b3ecad065675f125206e8675b8339e86e 100644 --- a/packages/Catch2/README.md +++ b/packages/Catch2/README.md @@ -5,11 +5,11 @@ [](https://travis-ci.org/catchorg/Catch2) [](https://ci.appveyor.com/project/catchorg/catch2) [](https://codecov.io/gh/catchorg/Catch2) -[](https://wandbox.org/permlink/E0msqwbW7U4PVbHn) +[](https://wandbox.org/permlink/7lDqHmzKQxA2eaM0) [](https://discord.gg/4CWS9zD) -<a href="https://github.com/catchorg/Catch2/releases/download/v2.4.1/catch.hpp">The latest version of the single header can be downloaded directly using this link</a> +<a href="https://github.com/catchorg/Catch2/releases/download/v2.5.0/catch.hpp">The latest version of the single header can be downloaded directly using this link</a> ## Catch2 is released! diff --git a/packages/Catch2/conanfile.py b/packages/Catch2/conanfile.py index 19b2c65e68bfb5f2d8378cb7108c2c494d599510..a7cebb9223756ded639e564e124ee7890035d276 100644 --- a/packages/Catch2/conanfile.py +++ b/packages/Catch2/conanfile.py @@ -3,19 +3,15 @@ from conans import ConanFile, CMake class CatchConan(ConanFile): - name = "Catch" - version = "2.4.1" + name = "Catch2" description = "A modern, C++-native, header-only, framework for unit-tests, TDD and BDD" - author = "philsquared" - generators = "cmake" - # Only needed until conan 1.5 is released - settings = "compiler", "arch" - exports_sources = "single_include/*", "CMakeLists.txt", "CMake/catch2.pc.in", "LICENSE.txt" + topics = ("conan", "catch2", "header-only", "unit-test", "tdd", "bdd") url = "https://github.com/catchorg/Catch2" - license = "Boost Software License - Version 1.0. http://www.boost.org/LICENSE_1_0.txt" - - def build(self): - pass + homepage = url + license = "BSL-1.0" + exports = "LICENSE.txt" + exports_sources = ("single_include/*", "CMakeLists.txt", "CMake/*", "contrib/*") + generators = "cmake" def package(self): cmake = CMake(self) diff --git a/packages/Catch2/contrib/CatchAddTests.cmake b/packages/Catch2/contrib/CatchAddTests.cmake index 07856130663918ddf6c6bfa9154c87f20046c6a1..2220ce3ac6b987b1e8b1ae82466a3f715916687c 100644 --- a/packages/Catch2/contrib/CatchAddTests.cmake +++ b/packages/Catch2/contrib/CatchAddTests.cmake @@ -51,12 +51,14 @@ string(REPLACE "\n" ";" output "${output}") # Parse output foreach(line ${output}) set(test ${line}) + # use escape commas to handle properly test cases with commans inside the name + string(REPLACE "," "\\," test_name ${test}) # ...and add to script add_command(add_test "${prefix}${test}${suffix}" ${TEST_EXECUTOR} "${TEST_EXECUTABLE}" - "${test}" + "${test_name}" ${extra_args} ) add_command(set_tests_properties diff --git a/packages/Catch2/contrib/ParseAndAddCatchTests.cmake b/packages/Catch2/contrib/ParseAndAddCatchTests.cmake index 85c06a0dd93c5e80dea87564948d405b40ab0e33..e7c64f01261d7a32cd00a7245cca1bbb0a34a993 100644 --- a/packages/Catch2/contrib/ParseAndAddCatchTests.cmake +++ b/packages/Catch2/contrib/ParseAndAddCatchTests.cmake @@ -39,6 +39,11 @@ # PARSE_CATCH_TESTS_ADD_TO_CONFIGURE_DEPENDS (Default OFF) # # -- causes CMake to rerun when file with tests changes so that new tests will be discovered # # # +# One can also set (locally) the optional variable OptionalCatchTestLauncher to precise the way # +# a test should be run. For instance to use test MPI, one can write # +# set(OptionalCatchTestLauncher ${MPIEXEC} ${MPIEXEC_NUMPROC_FLAG} ${NUMPROC}) # +# just before calling this ParseAndAddCatchTests function # +# # #==================================================================================================# cmake_minimum_required(VERSION 2.8.8) @@ -168,7 +173,7 @@ function(ParseFile SourceFile TestTarget) endif() # Add the test and set its properties - add_test(NAME "\"${CTestName}\"" COMMAND ${TestTarget} ${Name} ${AdditionalCatchParameters}) + add_test(NAME "\"${CTestName}\"" COMMAND ${OptionalCatchTestLauncher} ${TestTarget} ${Name} ${AdditionalCatchParameters}) set_tests_properties("\"${CTestName}\"" PROPERTIES FAIL_REGULAR_EXPRESSION "No tests ran" LABELS "${Labels}") endif() diff --git a/packages/Catch2/docs/Readme.md b/packages/Catch2/docs/Readme.md index 9087551816921b362ac463e5afb1418851ba489a..721880ab7baa565d657dae3fb672fd46424a30dd 100644 --- a/packages/Catch2/docs/Readme.md +++ b/packages/Catch2/docs/Readme.md @@ -13,6 +13,7 @@ Writing tests: * [Reporters](reporters.md#top) * [Event Listeners](event-listeners.md#top) * [Data Generators](generators.md#top) +* [Other macros](other-macros.md#top) Fine tuning: * [Supplying your own main()](own-main.md#top) @@ -35,3 +36,4 @@ Other: * [Open Source Projects using Catch](opensource-users.md#top) * [Contributing](contributing.md#top) * [Release Notes](release-notes.md#top) +* [Deprecations and incoming changes](deprecations.md#top) diff --git a/packages/Catch2/docs/cmake-integration.md b/packages/Catch2/docs/cmake-integration.md index a075c040f2ba7561b97cec8808f93c6e48acc11a..246e7f0ec22c5a451b755bc0618fe4f66ca50fff 100644 --- a/packages/Catch2/docs/cmake-integration.md +++ b/packages/Catch2/docs/cmake-integration.md @@ -172,6 +172,16 @@ step will be re-ran when the test files change, letting new tests be automatically discovered. Defaults to `OFF`. +Optionally, one can specify a launching command to run tests by setting the +variable `OptionalCatchTestLauncher` before calling `ParseAndAddCatchTests`. For +instance to run some tests using `MPI` and other sequentially, one can write +```cmake +set(OptionalCatchTestLauncher ${MPIEXEC} ${MPIEXEC_NUMPROC_FLAG} ${NUMPROC}) +ParseAndAddCatchTests(mpi_foo) +unset(OptionalCatchTestLauncher) +ParseAndAddCatchTests(bar) +``` + ## CMake project options Catch2's CMake project also provides some options for other projects diff --git a/packages/Catch2/docs/deprecations.md b/packages/Catch2/docs/deprecations.md new file mode 100644 index 0000000000000000000000000000000000000000..b80476842f4a4912efe49df9a04ac3809a9476f2 --- /dev/null +++ b/packages/Catch2/docs/deprecations.md @@ -0,0 +1,88 @@ +<a id="top"></a> +# Deprecations and incoming changes + +This page documents current deprecations and upcoming planned changes +inside Catch2. The difference between these is that a deprecated feature +will be removed, while a planned change to a feature means that the +feature will behave differently, but will still be present. Obviously, +either of these is a breaking change, and thus will not happen until +at least the next major release. + + +## Deprecations + +### `--list-*` return values + +The return codes of the `--list-*` family of command line arguments +will no longer be equal to the number of tests/tags/etc found, instead +it will be 0 for success and non-zero for failure. + + +### `--list-test-names-only` + +`--list-test-names-only` command line argument will be removed. + + +### `ANON_TEST_CASE` + +`ANON_TEST_CASE` is scheduled for removal, as it can be fully replaced +by a `TEST_CASE` with no arguments. + + +### Secondary description amongst tags + +Currently, the tags part of `TEST_CASE` (and others) macro can also +contain text that is not part of tags. This text is then separated into +a "description" of the test case, but the description is then never used +apart from writing it out for `--list-tests -v high`. + +Because it isn't actually used nor documented, and brings complications +to Catch2's internals, description support will be removed. + + +## Planned changes + + +### Reporter verbosities + +The current implementation of verbosities, where the reporter is checked +up-front whether it supports the requested verbosity, is fundamentally +misguided and will be changed. The new implementation will no longer check +whether the specified reporter supports the requested verbosity, instead +it will be up to the reporters to deal with verbosities as they see fit +(with an expectation that unsupported verbosities will be, at most, +warnings, but not errors). + + +### Output format of `--list-*` command line parameters + +The various list operations will be piped through reporters. This means +that e.g. XML reporter will write the output as machine-parseable XML, +while the Console reporter will keep the current, human-oriented output. + + +### `CHECKED_IF` and `CHECKED_ELSE` + +To make the `CHECKED_IF` and `CHECKED_ELSE` macros more useful, they will +be marked as "OK to fail" (`Catch::ResultDisposition::SuppressFail` flag +will be added), which means that their failure will not fail the test, +making the `else` actually useful. + + +### Change semantics of `[.]` and tag exclusion + +Currently, given these 2 tests +```cpp +TEST_CASE("A", "[.][foo]") {} +TEST_CASE("B", "[.][bar]") {} +``` +specifying `[foo]` as the testspec will run test "A" and specifying +`~[foo]` will run test "B", even though it is hidden. Also, specifying +`~[baz]` will run both tests. This behaviour is often surprising and will +be changed so that hidden tests are included in a run only if they +positively match a testspec. + + +--- + +[Home](Readme.md#top) diff --git a/packages/Catch2/docs/logging.md b/packages/Catch2/docs/logging.md index 39ae5c7ac32dd8e8640b3a56880bab6c088b2b8b..423ce6a8787ec6943fac3a642ef71b0f6a605b0c 100644 --- a/packages/Catch2/docs/logging.md +++ b/packages/Catch2/docs/logging.md @@ -57,20 +57,37 @@ The message is reported and the test case fails. AS `FAIL`, but does not abort the test -## Quickly capture a variable value +## Quickly capture value of variables or expressions -**CAPTURE(** _expression_ **)** +**CAPTURE(** _expression1_, _expression2_, ... **)** -Sometimes you just want to log the name and value of a variable. While you can easily do this with the INFO macro, above, as a convenience the CAPTURE macro handles the stringising of the variable name for you (actually it works with any expression, not just variables). +Sometimes you just want to log a value of variable, or expression. For +convenience, we provide the `CAPTURE` macro, that can take a variable, +or an expression, and prints out that variable/expression and its value +at the time of capture. -E.g. -```c++ -CAPTURE( theAnswer ); +e.g. `CAPTURE( theAnswer );` will log message "theAnswer := 42", while +```cpp +int a = 1, b = 2, c = 3; +CAPTURE( a, b, c, a + b, c > b, a == 1); +``` +will log a total of 6 messages: +``` +a := 1 +b := 2 +c := 3 +a + b := 3 +c > b := true +a == 1 := true ``` -This would log something like: +You can also capture expressions that use commas inside parentheses +(e.g. function calls), brackets, or braces (e.g. initializers). To +properly capture expression that contains template parameters list +(in other words, it contains commas between angle brackets), you need +to enclose the expression inside parentheses: +`CAPTURE( (std::pair<int, int>{1, 2}) );` -<pre>"theAnswer := 42"</pre> --- diff --git a/packages/Catch2/docs/opensource-users.md b/packages/Catch2/docs/opensource-users.md index 25e5a437b0538be030ab0d4c83360ae2da330f2a..f094167e538e4edec1c76ee9dc2205380df7a793 100644 --- a/packages/Catch2/docs/opensource-users.md +++ b/packages/Catch2/docs/opensource-users.md @@ -32,6 +32,9 @@ A, single-header-only, type-safe, command line parser - which also prints format ### [Couchbase-lite-core](https://github.com/couchbase/couchbase-lite-core) The next-generation core storage and query engine for Couchbase Lite +### [cppcodec](https://github.com/tplgy/cppcodec) +Header-only C++11 library to encode/decode base64, base64url, base32, base32hex and hex (a.k.a. base16) as specified in RFC 4648, plus Crockford's base32. + ### [DtCraft](https://github.com/twhuang-uiuc/DtCraft) A High-performance Cluster Computing Engine diff --git a/packages/Catch2/docs/other-macros.md b/packages/Catch2/docs/other-macros.md new file mode 100644 index 0000000000000000000000000000000000000000..6f5fac7b06dbbc6c02145be2c93cdc09ca15ddcf --- /dev/null +++ b/packages/Catch2/docs/other-macros.md @@ -0,0 +1,150 @@ +<a id="top"></a> +# Other macros + +This page serves as a reference for macros that are not documented +elsewhere. For now, these macros are separated into 2 rough categories, +"assertion related macros" and "test case related macros". + +## Assertion related macros + +* `CHECKED_IF` and `CHECKED_ELSE` + +`CHECKED_IF( expr )` is an `if` replacement, that also applies Catch2's +stringification machinery to the _expr_ and records the result. As with +`if`, the block after a `CHECKED_IF` is entered only if the expression +evaluates to `true`. `CHECKED_ELSE( expr )` work similarly, but the block +is entered only if the _expr_ evaluated to `false`. + +Example: +```cpp +int a = ...; +int b = ...; +CHECKED_IF( a == b ) { + // This block is entered when a == b +} CHECKED_ELSE ( a == b ) { + // This block is entered when a != b +} +``` + +* `CHECK_NOFAIL` + +`CHECK_NOFAIL( expr )` is a variant of `CHECK` that does not fail the test +case if _expr_ evaluates to `false`. This can be useful for checking some +assumption, that might be violated without the test neccessarily failing. + +Example output: +``` +main.cpp:6: +FAILED - but was ok: + CHECK_NOFAIL( 1 == 2 ) + +main.cpp:7: +PASSED: + CHECK( 2 == 2 ) +``` + +* `SUCCEED` + +`SUCCEED( msg )` is mostly equivalent with `INFO( msg ); REQUIRE( true );`. +In other words, `SUCCEED` is for cases where just reaching a certain line +means that the test has been a success. + +Example usage: +```cpp +TEST_CASE( "SUCCEED showcase" ) { + int I = 1; + SUCCEED( "I is " << I ); +} +``` + +* `STATIC_REQUIRE` + +`STATIC_REQUIRE( expr )` is a macro that can be used the same way as a +`static_assert`, but also registers the success with Catch2, so it is +reported as a success at runtime. The whole check can also be deferred +to the runtime, by defining `CATCH_CONFIG_RUNTIME_STATIC_REQUIRE` before +including the Catch2 header. + +Example: +```cpp +TEST_CASE("STATIC_REQUIRE showcase", "[traits]") { + STATIC_REQUIRE( std::is_void<void>::value ); + STATIC_REQUIRE_FALSE( std::is_void<int>::value ); +} +``` + +## Test case related macros + +* `METHOD_AS_TEST_CASE` + +`METHOD_AS_TEST_CASE( member-function-pointer, description )` lets you +register a member function of a class as a Catch2 test case. The class +will be separately instantiated for each method registered in this way. + +```cpp +class TestClass { + std::string s; + +public: + TestClass() + :s( "hello" ) + {} + + void testCase() { + REQUIRE( s == "hello" ); + } +}; + + +METHOD_AS_TEST_CASE( TestClass::testCase, "Use class's method as a test case", "[class]" ) +``` + +* `REGISTER_TEST_CASE` + +`REGISTER_TEST_CASE( function, description )` let's you register +a `function` as a test case. The function has to have `void()` signature, +the description can contain both name and tags. + +Example: +```cpp +REGISTER_TEST_CASE( someFunction, "ManuallyRegistered", "[tags]" ); +``` + +_Note that the registration still has to happen before Catch2's session +is initiated. This means that it either needs to be done in a global +constructor, or before Catch2's session is created in user's own main._ + + +* `ANON_TEST_CASE` + +`ANON_TEST_CASE` is a `TEST_CASE` replacement that will autogenerate +unique name. The advantage of this is that you do not have to think +of a name for the test case,`the disadvantage is that the name doesn't +neccessarily remain stable across different links, and thus it might be +hard to run directly. + +Example: +```cpp +ANON_TEST_CASE() { + SUCCEED("Hello from anonymous test case"); +} +``` + +* `DYNAMIC_SECTION` + +`DYNAMIC_SECTION` is a `SECTION` where the user can use `operator<<` to +create the final name for that section. This can be useful with e.g. +generators, or when creating a `SECTION` dynamically, within a loop. + +Example: +```cpp +TEST_CASE( "looped SECTION tests" ) { + int a = 1; + + for( int b = 0; b < 10; ++b ) { + DYNAMIC_SECTION( "b is currently: " << b ) { + CHECK( b > a ); + } + } +} +``` diff --git a/packages/Catch2/docs/release-notes.md b/packages/Catch2/docs/release-notes.md index f31f0e8760762908299d78e4bbab0318adf4b686..bc85006dee526b62a1611063fda0d8ec5cb36ef4 100644 --- a/packages/Catch2/docs/release-notes.md +++ b/packages/Catch2/docs/release-notes.md @@ -2,6 +2,8 @@ # Release notes **Contents**<br> +[2.5.0](#250)<br> +[2.4.2](#242)<br> [2.4.1](#241)<br> [2.4.0](#240)<br> [2.3.0](#230)<br> @@ -16,6 +18,50 @@ [Older versions](#older-versions)<br> [Even Older versions](#even-older-versions)<br> +## 2.5.0 + +### Improvements +* Added support for templated tests via `TEMPLATE_TEST_CASE` (#1437) + + +### Fixes +* Fixed compilation of `PredicateMatcher<const char*>` by removing partial specialization of `MatcherMethod<T*>` +* Listeners now implicitly support any verbosity (#1426) +* Fixed compilation with Embarcadero builder by introducing `Catch::isnan` polyfill (#1438) +* Fixed `CAPTURE` asserting for non-trivial captures (#1436, #1448) + + +### Miscellaneous +* We should now be providing first party Conan support via https://bintray.com/catchorg/Catch2 (#1443) +* Added new section "deprecations and planned changes" to the documentation + * It contains summary of what is deprecated and might change with next major version +* From this release forward, the released headers should be pgp signed (#430) + * KeyID `E29C 46F3 B8A7 5028 6079 3B7D ECC9 C20E 314B 2360` + * or https://codingnest.com/files/horenmar-publickey.asc + + +## 2.4.2 + +### Improvements +* XmlReporter now also outputs the RNG seed that was used in a run (#1404) +* `Catch::Session::applyCommandLine` now also accepts `wchar_t` arguments. + * However, Catch2 still does not support unicode. +* Added `STATIC_REQUIRE` macro (#1356, #1362) +* Catch2's singleton's are now cleaned up even if tests are run (#1411) + * This is mostly useful as a FP prevention for users who define their own main. +* Specifying an invalid reporter via `-r` is now reported sooner (#1351, #1422) + + +### Fixes +* Stringification no longer assumes that `char` is signed (#1399, #1407) + * This caused a `Wtautological-compare` warning. +* SFINAE for `operator<<` no longer sees different overload set than the actual insertion (#1403) + + +### Contrib +* `catch_discover_tests` correctly adds tests with comma in name (#1327, #1409) +* Added a new customization point in how the tests are launched to `catch_discover_tests` + ## 2.4.1 diff --git a/packages/Catch2/docs/release-process.md b/packages/Catch2/docs/release-process.md index b556c3990cd980cbbf61ac20c2dd8648cc21e696..91e338c3a0aabbb61b8989c1cf59abfdcb271bfe 100644 --- a/packages/Catch2/docs/release-process.md +++ b/packages/Catch2/docs/release-process.md @@ -8,11 +8,11 @@ When enough changes have accumulated, it is time to release new version of Catch These steps are necessary and have to be performed before each new release. They serve to make sure that the new release is correct and linked-to from the standard places. -### Approval testing +### Testing -Catch's releases are primarily validated against output from previous release, stored in `projects/SelfTest/Baselines`. To validate current sources, build the SelfTest binary and pass it to the `approvalTests.py` script: `approvalTests.py <path/to/SelfTest>`. - -There should be no differences, as Approval tests should be updated when changes to Catch are made, but if there are, then they need to be manually reviewed and either approved (using `approve.py`) or Catch requires other fixes. +All of the tests are currently run in our CI setup based on TravisCI and +AppVeyor. As long as the last commit tested green, the release can +proceed. ### Incrementing version number @@ -27,7 +27,7 @@ version numbers everywhere and pushing the new version to Wandbox. ### Release notes -Once a release is ready, release notes need to be written. They should summarize changes done since last release. For rough idea of expected notes see previous releases. Once written, release notes should be placed in `docs/release-notes.md`. +Once a release is ready, release notes need to be written. They should summarize changes done since last release. For rough idea of expected notes see previous releases. Once written, release notes should be added to `docs/release-notes.md`. ### Commit and push update to GitHub @@ -43,11 +43,8 @@ description should contain the release notes for the current release. Single header version of `catch.hpp` *needs* to be attached as a binary, as that is where the official download link links to. Preferably it should use linux line endings. All non-bundled reporters (Automake, -TAP, TeamCity) should also be attached as binaries, as they are dependent -on a specific version of the single-include header. - - -## Optional steps +TAP, TeamCity) should also be attached as binaries, as they might be +dependent on a specific version of the single-include header. -Because Catch's [vcpkg](https://github.com/Microsoft/vcpkg) port updates -itself automagically, there are no optional steps at this time. +Since 2.5.0, the release tag and the "binaries" (headers) should be PGP +signed. diff --git a/packages/Catch2/docs/test-cases-and-sections.md b/packages/Catch2/docs/test-cases-and-sections.md index 621d226ee9801b437f2a77154ba0d9bc58ebeee8..abd55cd09dcb3a0c78f3a6f742ad32d5e5314737 100644 --- a/packages/Catch2/docs/test-cases-and-sections.md +++ b/packages/Catch2/docs/test-cases-and-sections.md @@ -1,6 +1,12 @@ <a id="top"></a> # Test cases and sections +**Contents**<br> +[Tags](#tags)<br> +[Tag aliases](#tag-aliases)<br> +[BDD-style test cases](#bdd-style-test-cases)<br> +[Type parametrised test cases](#type-parametrised-test-cases)<br> + While Catch fully supports the traditional, xUnit, style of class-based fixtures containing test case methods this is not the preferred style. Instead Catch provides a powerful mechanism for nesting test case sections within a test case. For a more detailed discussion see the [tutorial](tutorial.md#test-cases-and-sections). @@ -86,6 +92,105 @@ When any of these macros are used the console reporter recognises them and forma Other than the additional prefixes and the formatting in the console reporter these macros behave exactly as ```TEST_CASE```s and ```SECTION```s. As such there is nothing enforcing the correct sequencing of these macros - that's up to the programmer! +## Type parametrised test cases + +In addition to `TEST_CASE`s, Catch2 also supports test cases parametrised +by types, in the form of `TEMPLATE_TEST_CASE` and +`TEMPLATE_PRODUCT_TEST_CASE`. + +* **TEMPLATE_TEST_CASE(** _test name_ , _tags_, _type1_, _type2_, ..., _typen_ **)** + +_test name_ and _tag_ are exactly the same as they are in `TEST_CASE`, +with the difference that the tag string must be provided (however, it +can be empty). _type1_ through _typen_ is the list of types for which +this test case should run, and, inside the test code, the current type +is available as the `TestType` type. + +Because of limitations of the C++ preprocessor, if you want to specify +a type with multiple template parameters, you need to enclose it in +parentheses, e.g. `std::map<int, std::string>` needs to be passed as +`(std::map<int, std::string>)`. + +Example: +```cpp +TEMPLATE_TEST_CASE( "vectors can be sized and resized", "[vector][template]", int, std::string, (std::tuple<int,float>) ) { + + std::vector<TestType> v( 5 ); + + REQUIRE( v.size() == 5 ); + REQUIRE( v.capacity() >= 5 ); + + SECTION( "resizing bigger changes size and capacity" ) { + v.resize( 10 ); + + REQUIRE( v.size() == 10 ); + REQUIRE( v.capacity() >= 10 ); + } + SECTION( "resizing smaller changes size but not capacity" ) { + v.resize( 0 ); + + REQUIRE( v.size() == 0 ); + REQUIRE( v.capacity() >= 5 ); + + SECTION( "We can use the 'swap trick' to reset the capacity" ) { + std::vector<TestType> empty; + empty.swap( v ); + + REQUIRE( v.capacity() == 0 ); + } + } + SECTION( "reserving smaller does not change size or capacity" ) { + v.reserve( 0 ); + + REQUIRE( v.size() == 5 ); + REQUIRE( v.capacity() >= 5 ); + } +} +``` + +* **TEMPLATE_PRODUCT_TEST_CASE(** _test name_ , _tags_, (_template-type1_, _template-type2_, ..., _template-typen_), (_template-arg1_, _template-arg2_, ..., _template-argm_) **)** + +_template-type1_ through _template-typen_ is list of template template +types which should be combined with each of _template-arg1_ through + _template-argm_, resulting in _n * m_ test cases. Inside the test case, +the resulting type is available under the name of `TestType`. + +To specify more than 1 type as a single _template-type_ or _template-arg_, +you must enclose the types in an additional set of parentheses, e.g. +`((int, float), (char, double))` specifies 2 template-args, each +consisting of 2 concrete types (`int`, `float` and `char`, `double` +respectively). You can also omit the outer set of parentheses if you +specify only one type as the full set of either the _template-types_, +or the _template-args_. + + +Example: +``` +template< typename T> +struct Foo { + size_t size() { + return 0; + } +}; + +TEMPLATE_PRODUCT_TEST_CASE("A Template product test case", "[template][product]", (std::vector, Foo), (int, float)) { + TestType x; + REQUIRE(x.size() == 0); +} +``` + +You can also have different arities in the _template-arg_ packs: +``` +TEMPLATE_PRODUCT_TEST_CASE("Product with differing arities", "[template][product]", std::tuple, (int, (int, double), (int, double, float))) { + TestType x; + REQUIRE(std::tuple_size<TestType>::value >= 1); +} +``` + +_While there is an upper limit on the number of types you can specify +in single `TEMPLATE_TEST_CASE` or `TEMPLATE_PRODUCT_TEST_CASE`, the limit +is very high and should not be encountered in practice._ + --- [Home](Readme.md#top) diff --git a/packages/Catch2/docs/test-fixtures.md b/packages/Catch2/docs/test-fixtures.md index 1dc7babae0d30788f8a32696e33da278b66743a7..6b29ce68b1707a51963d99fea26dbb4c92ce71da 100644 --- a/packages/Catch2/docs/test-fixtures.md +++ b/packages/Catch2/docs/test-fixtures.md @@ -30,6 +30,60 @@ class UniqueTestsFixture { The two test cases here will create uniquely-named derived classes of UniqueTestsFixture and thus can access the `getID()` protected method and `conn` member variables. This ensures that both the test cases are able to create a DBConnection using the same method (DRY principle) and that any ID's created are unique such that the order that tests are executed does not matter. + +Catch2 also provides `TEMPLATE_TEST_CASE_METHOD` and +`TEMPLATE_PRODUCT_TEST_CASE_METHOD` that can be used together +with templated fixtures and templated template fixtures to perform +tests for multiple different types. Unlike `TEST_CASE_METHOD`, +`TEMPLATE_TEST_CASE_METHOD` and `TEMPLATE_PRODUCT_TEST_CASE_METHOD` do +require the tag specification to be non-empty, as it is followed by +further macro arguments. + +Also note that, because of limitations of the C++ preprocessor, if you +want to specify a type with multiple template parameters, you need to +enclose it in parentheses, e.g. `std::map<int, std::string>` needs to be +passed as `(std::map<int, std::string>)`. +In the case of `TEMPLATE_PRODUCT_TEST_CASE_METHOD`, if a member of the +type list should consist of more than single type, it needs to be enclosed +in another pair of parentheses, e.g. `(std::map, std::pair)` and +`((int, float), (char, double))`. + +Example: +```cpp +template< typename T > +struct Template_Fixture { + Template_Fixture(): m_a(1) {} + + T m_a; +}; + +TEMPLATE_TEST_CASE_METHOD(Template_Fixture,"A TEMPLATE_TEST_CASE_METHOD based test run that succeeds", "[class][template]", int, float, double) { + REQUIRE( Template_Fixture<TestType>::m_a == 1 ); +} + +template<typename T> +struct Template_Template_Fixture { + Template_Template_Fixture() {} + + T m_a; +}; + +template<typename T> +struct Foo_class { + size_t size() { + return 0; + } +}; + +TEMPLATE_PRODUCT_TEST_CASE_METHOD(Template_Template_Fixture, "A TEMPLATE_PRODUCT_TEST_CASE_METHOD based test succeeds", "[class][template]", (Foo_class, std::vector), int) { + REQUIRE( Template_Template_Fixture<TestType>::m_a.size() == 0 ); +} +``` + +_While there is an upper limit on the number of types you can specify +in single `TEMPLATE_TEST_CASE_METHOD` or `TEMPLATE_PRODUCT_TEST_CASE_METHOD`, +the limit is very high and should not be encountered in practice._ + --- [Home](Readme.md#top) diff --git a/packages/Catch2/docs/tostring.md b/packages/Catch2/docs/tostring.md index be79f6e9455c33f49051b44bef9afe1531126ece..933f2e619fe3cb5ceae815ac83fbff60488a7e99 100644 --- a/packages/Catch2/docs/tostring.md +++ b/packages/Catch2/docs/tostring.md @@ -23,7 +23,7 @@ std::ostream& operator << ( std::ostream& os, T const& value ) { (where ```T``` is your type and ```convertMyTypeToString``` is where you'll write whatever code is necessary to make your type printable - it doesn't have to be in another function). -You should put this function in the same namespace as your type and have it declared before including Catch's header. +You should put this function in the same namespace as your type, or the global namespace, and have it declared before including Catch's header. ## Catch::StringMaker specialisation If you don't want to provide an ```operator <<``` overload, or you want to convert your type differently for testing purposes, you can provide a specialization for `Catch::StringMaker<T>`: diff --git a/packages/Catch2/docs/tutorial.md b/packages/Catch2/docs/tutorial.md index 387a250a1432fad5bf784db4b239f1e808634316..7c0f81450a860e24354266dbd429bd2f1e0cc77b 100644 --- a/packages/Catch2/docs/tutorial.md +++ b/packages/Catch2/docs/tutorial.md @@ -8,6 +8,7 @@ [Test cases and sections](#test-cases-and-sections)<br> [BDD-Style](#bdd-style)<br> [Scaling up](#scaling-up)<br> +[Type parametrised test cases](#type-parametrised-test-cases)<br> [Next steps](#next-steps)<br> ## Getting Catch2 @@ -22,7 +23,7 @@ The full source for Catch2, including test projects, documentation, and other th ## Where to put it? -Catch2 is header only. All you need to do is drop the file somewhere reachable from your project - either in some central location you can set your header search path to find, or directly into your project tree itself! This is a particularly good option for other Open-Source projects that want to use Catch for their test suite. See [this blog entry for more on that](http://www.levelofindirection.com/journal/2011/5/27/unit-testing-in-c-and-objective-c-just-got-ridiculously-easi.html). +Catch2 is header only. All you need to do is drop the file somewhere reachable from your project - either in some central location you can set your header search path to find, or directly into your project tree itself! This is a particularly good option for other Open-Source projects that want to use Catch for their test suite. See [this blog entry for more on that](http://www.levelofindirection.com/journal/2011/5/27/unit-testing-in-c-and-objective-c-just-got-ridiculously-easi.html). The rest of this tutorial will assume that the Catch2 single-include header (or the include folder) is available unqualified - but you may need to prefix it with a folder name if necessary. @@ -31,7 +32,7 @@ package, you need to include the header as `#include <catch2/catch.hpp>`_ ## Writing tests -Let's start with a really simple example ([code](../examples/010-TestCase.cpp)). Say you have written a function to calculate factorials and now you want to test it (let's leave aside TDD for now). +Let's start with a really simple example ([code](../examples/010-TestCase.cpp)). Say you have written a function to calculate factorials and now you want to test it (let's leave aside TDD for now). ```c++ unsigned int Factorial( unsigned int number ) { @@ -122,31 +123,31 @@ Catch takes a different approach (to both NUnit and xUnit) that is a more natura TEST_CASE( "vectors can be sized and resized", "[vector]" ) { std::vector<int> v( 5 ); - + REQUIRE( v.size() == 5 ); REQUIRE( v.capacity() >= 5 ); - + SECTION( "resizing bigger changes size and capacity" ) { v.resize( 10 ); - + REQUIRE( v.size() == 10 ); REQUIRE( v.capacity() >= 10 ); } SECTION( "resizing smaller changes size but not capacity" ) { v.resize( 0 ); - + REQUIRE( v.size() == 0 ); REQUIRE( v.capacity() >= 5 ); } SECTION( "reserving bigger changes capacity but not size" ) { v.reserve( 10 ); - + REQUIRE( v.size() == 5 ); REQUIRE( v.capacity() >= 10 ); } SECTION( "reserving smaller does not change size or capacity" ) { v.reserve( 0 ); - + REQUIRE( v.size() == 5 ); REQUIRE( v.capacity() >= 5 ); } @@ -163,13 +164,13 @@ The power of sections really shows, however, when we need to execute a sequence ```c++ SECTION( "reserving bigger changes capacity but not size" ) { v.reserve( 10 ); - + REQUIRE( v.size() == 5 ); REQUIRE( v.capacity() >= 10 ); - + SECTION( "reserving smaller again does not change capacity" ) { v.reserve( 7 ); - + REQUIRE( v.capacity() >= 10 ); } } @@ -188,13 +189,13 @@ SCENARIO( "vectors can be sized and resized", "[vector]" ) { GIVEN( "A vector with some items" ) { std::vector<int> v( 5 ); - + REQUIRE( v.size() == 5 ); REQUIRE( v.capacity() >= 5 ); - + WHEN( "the size is increased" ) { v.resize( 10 ); - + THEN( "the size and capacity change" ) { REQUIRE( v.size() == 10 ); REQUIRE( v.capacity() >= 10 ); @@ -202,7 +203,7 @@ SCENARIO( "vectors can be sized and resized", "[vector]" ) { } WHEN( "the size is reduced" ) { v.resize( 0 ); - + THEN( "the size changes but not capacity" ) { REQUIRE( v.size() == 0 ); REQUIRE( v.capacity() >= 5 ); @@ -210,7 +211,7 @@ SCENARIO( "vectors can be sized and resized", "[vector]" ) { } WHEN( "more capacity is reserved" ) { v.reserve( 10 ); - + THEN( "the capacity changes but not the size" ) { REQUIRE( v.size() == 5 ); REQUIRE( v.capacity() >= 10 ); @@ -218,7 +219,7 @@ SCENARIO( "vectors can be sized and resized", "[vector]" ) { } WHEN( "less capacity is reserved" ) { v.reserve( 0 ); - + THEN( "neither size nor capacity are changed" ) { REQUIRE( v.size() == 5 ); REQUIRE( v.capacity() >= 5 ); @@ -256,6 +257,17 @@ In fact it is usually a good idea to put the block with the ```#define``` [in it Do not write your tests in header files! +## Type parametrised test cases + +Test cases in Catch2 can be also parametrised by type, via the +`TEMPLATE_TEST_CASE` and `TEMPLATE_PRODUCT_TEST_CASE` macros, +which behave in the same way the `TEST_CASE` macro, but are run for +every type or type combination. + +For more details, see our documentation on [test cases and +sections](test-cases-and-sections.md#type-parametrised-test-cases). + + ## Next steps This has been a brief introduction to get you up and running with Catch, and to point out some of the key differences between Catch and other frameworks you may already be familiar with. This will get you going quite far already and you are now in a position to dive in and write some tests. diff --git a/packages/Catch2/docs/why-catch.md b/packages/Catch2/docs/why-catch.md index 45f58a6ab7cb1932b8f2a6fdd8605d0a94659641..86cc55bc56b52d8982a9e31ef788cae2102f8848 100644 --- a/packages/Catch2/docs/why-catch.md +++ b/packages/Catch2/docs/why-catch.md @@ -6,7 +6,7 @@ including (but not limited to), [Google Test](http://code.google.com/p/googletest/), [Boost.Test](http://www.boost.org/doc/libs/1_49_0/libs/test/doc/html/index.html), [CppUnit](http://sourceforge.net/apps/mediawiki/cppunit/index.php?title=Main_Page), -[Cute](http://r2.ifs.hsr.ch/cute), +[Cute](http://www.cute-test.com), [many, many more](http://en.wikipedia.org/wiki/List_of_unit_testing_frameworks#C.2B.2B). So what does Catch bring to the party that differentiates it from these? Apart from a Catchy name, of course. diff --git a/packages/Catch2/include/catch.hpp b/packages/Catch2/include/catch.hpp index f8b380c4e4053062fa1b94ab6254699b25aed918..727f602ee738b1fda8b88fe8016074209068e14c 100644 --- a/packages/Catch2/include/catch.hpp +++ b/packages/Catch2/include/catch.hpp @@ -10,8 +10,8 @@ #define TWOBLUECUBES_CATCH_HPP_INCLUDED #define CATCH_VERSION_MAJOR 2 -#define CATCH_VERSION_MINOR 4 -#define CATCH_VERSION_PATCH 1 +#define CATCH_VERSION_MINOR 5 +#define CATCH_VERSION_PATCH 0 #ifdef __clang__ # pragma clang system_header @@ -145,6 +145,28 @@ #define CATCH_ANON_TEST_CASE() INTERNAL_CATCH_TESTCASE() +#ifndef CATCH_CONFIG_TRADITIONAL_MSVC_PREPROCESSOR +#define CATCH_TEMPLATE_TEST_CASE( ... ) INTERNAL_CATCH_TEMPLATE_TEST_CASE( __VA_ARGS__ ) +#define CATCH_TEMPLATE_TEST_CASE_METHOD( className, ... ) INTERNAL_CATCH_TEMPLATE_TEST_CASE_METHOD( className, __VA_ARGS__ ) +#define CATCH_TEMPLATE_PRODUCT_TEST_CASE( ... ) INTERNAL_CATCH_TEMPLATE_PRODUCT_TEST_CASE( __VA_ARGS__ ) +#define CATCH_TEMPLATE_PRODUCT_TEST_CASE_METHOD( className, ... ) INTERNAL_CATCH_TEMPLATE_PRODUCT_TEST_CASE_METHOD( className, __VA_ARGS__ ) +#else +#define CATCH_TEMPLATE_TEST_CASE( ... ) INTERNAL_CATCH_EXPAND_VARGS( INTERNAL_CATCH_TEMPLATE_TEST_CASE( __VA_ARGS__ ) ) +#define CATCH_TEMPLATE_TEST_CASE_METHOD( className, ... ) INTERNAL_CATCH_EXPAND_VARGS( INTERNAL_CATCH_TEMPLATE_TEST_CASE_METHOD( className, __VA_ARGS__ ) ) +#define CATCH_TEMPLATE_PRODUCT_TEST_CASE( ... ) INTERNAL_CATCH_EXPAND_VARGS( INTERNAL_CATCH_TEMPLATE_PRODUCT_TEST_CASE( __VA_ARGS__ ) ) +#define CATCH_TEMPLATE_PRODUCT_TEST_CASE_METHOD( className, ... ) INTERNAL_CATCH_EXPAND_VARGS( INTERNAL_CATCH_TEMPLATE_PRODUCT_TEST_CASE_METHOD( className, __VA_ARGS__ ) ) +#endif + + +#if !defined(CATCH_CONFIG_RUNTIME_STATIC_REQUIRE) +#define CATCH_STATIC_REQUIRE( ... ) static_assert( __VA_ARGS__ , #__VA_ARGS__ ); CATCH_SUCCEED( #__VA_ARGS__ ) +#define CATCH_STATIC_REQUIRE_FALSE( ... ) static_assert( !(__VA_ARGS__), "!(" #__VA_ARGS__ ")" ); CATCH_SUCCEED( #__VA_ARGS__ ) +#else +#define CATCH_STATIC_REQUIRE( ... ) CATCH_REQUIRE( __VA_ARGS__ ) +#define CATCH_STATIC_REQUIRE_FALSE( ... ) CATCH_REQUIRE_FALSE( __VA_ARGS__ ) +#endif + + // "BDD-style" convenience wrappers #define CATCH_SCENARIO( ... ) CATCH_TEST_CASE( "Scenario: " __VA_ARGS__ ) #define CATCH_SCENARIO_METHOD( className, ... ) INTERNAL_CATCH_TEST_CASE_METHOD( className, "Scenario: " __VA_ARGS__ ) @@ -205,6 +227,27 @@ #define SUCCEED( ... ) INTERNAL_CATCH_MSG( "SUCCEED", Catch::ResultWas::Ok, Catch::ResultDisposition::ContinueOnFailure, __VA_ARGS__ ) #define ANON_TEST_CASE() INTERNAL_CATCH_TESTCASE() +#ifndef CATCH_CONFIG_TRADITIONAL_MSVC_PREPROCESSOR +#define TEMPLATE_TEST_CASE( ... ) INTERNAL_CATCH_TEMPLATE_TEST_CASE( __VA_ARGS__ ) +#define TEMPLATE_TEST_CASE_METHOD( className, ... ) INTERNAL_CATCH_TEMPLATE_TEST_CASE_METHOD( className, __VA_ARGS__ ) +#define TEMPLATE_PRODUCT_TEST_CASE( ... ) INTERNAL_CATCH_TEMPLATE_PRODUCT_TEST_CASE( __VA_ARGS__ ) +#define TEMPLATE_PRODUCT_TEST_CASE_METHOD( className, ... ) INTERNAL_CATCH_TEMPLATE_PRODUCT_TEST_CASE_METHOD( className, __VA_ARGS__ ) +#else +#define TEMPLATE_TEST_CASE( ... ) INTERNAL_CATCH_EXPAND_VARGS( INTERNAL_CATCH_TEMPLATE_TEST_CASE( __VA_ARGS__ ) ) +#define TEMPLATE_TEST_CASE_METHOD( className, ... ) INTERNAL_CATCH_EXPAND_VARGS( INTERNAL_CATCH_TEMPLATE_TEST_CASE_METHOD( className, __VA_ARGS__ ) ) +#define TEMPLATE_PRODUCT_TEST_CASE( ... ) INTERNAL_CATCH_EXPAND_VARGS( INTERNAL_CATCH_TEMPLATE_PRODUCT_TEST_CASE( __VA_ARGS__ ) ) +#define TEMPLATE_PRODUCT_TEST_CASE_METHOD( className, ... ) INTERNAL_CATCH_EXPAND_VARGS( INTERNAL_CATCH_TEMPLATE_PRODUCT_TEST_CASE_METHOD( className, __VA_ARGS__ ) ) +#endif + + +#if !defined(CATCH_CONFIG_RUNTIME_STATIC_REQUIRE) +#define STATIC_REQUIRE( ... ) static_assert( __VA_ARGS__, #__VA_ARGS__ ); SUCCEED( #__VA_ARGS__ ) +#define STATIC_REQUIRE_FALSE( ... ) static_assert( !(__VA_ARGS__), "!(" #__VA_ARGS__ ")" ); SUCCEED( "!(" #__VA_ARGS__ ")" ) +#else +#define STATIC_REQUIRE( ... ) REQUIRE( __VA_ARGS__ ) +#define STATIC_REQUIRE_FALSE( ... ) REQUIRE_FALSE( __VA_ARGS__ ) +#endif + #endif #define CATCH_TRANSLATE_EXCEPTION( signature ) INTERNAL_CATCH_TRANSLATE_EXCEPTION( signature ) @@ -275,6 +318,18 @@ using Catch::Detail::Approx; #define CATCH_ANON_TEST_CASE() INTERNAL_CATCH_TESTCASE_NO_REGISTRATION(INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_S_T____ )) +#ifndef CATCH_CONFIG_TRADITIONAL_MSVC_PREPROCESSOR +#define CATCH_TEMPLATE_TEST_CASE( ... ) INTERNAL_CATCH_TEMPLATE_TEST_CASE_NO_REGISTRATION(INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_M_P_L_A_T_E____T_E_S_T____ ) ) +#define CATCH_TEMPLATE_TEST_CASE_METHOD( className, ... ) INTERNAL_CATCH_TEMPLATE_TEST_CASE_METHOD_NO_REGISTRATION(INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_M_P_L_A_T_E____T_E_S_T____ ), className ) +#define CATCH_TEMPLATE_PRODUCT_TEST_CASE( ... ) CATCH_TEMPLATE_TEST_CASE( __VA_ARGS__ ) +#define CATCH_TEMPLATE_PRODUCT_TEST_CASE_METHOD( className, ... ) CATCH_TEMPLATE_TEST_CASE_METHOD( className, __VA_ARGS__ ) +#else +#define CATCH_TEMPLATE_TEST_CASE( ... ) INTERNAL_CATCH_EXPAND_VARGS( INTERNAL_CATCH_TEMPLATE_TEST_CASE_NO_REGISTRATION(INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_M_P_L_A_T_E____T_E_S_T____ ) ) ) +#define CATCH_TEMPLATE_TEST_CASE_METHOD( className, ... ) INTERNAL_CATCH_EXPAND_VARGS( INTERNAL_CATCH_TEMPLATE_TEST_CASE_METHOD_NO_REGISTRATION(INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_M_P_L_A_T_E____T_E_S_T____ ), className ) ) +#define CATCH_TEMPLATE_PRODUCT_TEST_CASE( ... ) CATCH_TEMPLATE_TEST_CASE( __VA_ARGS__ ) +#define CATCH_TEMPLATE_PRODUCT_TEST_CASE_METHOD( className, ... ) CATCH_TEMPLATE_TEST_CASE_METHOD( className, __VA_ARGS__ ) +#endif + // "BDD-style" convenience wrappers #define CATCH_SCENARIO( ... ) INTERNAL_CATCH_TESTCASE_NO_REGISTRATION(INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_S_T____ )) #define CATCH_SCENARIO_METHOD( className, ... ) INTERNAL_CATCH_TESTCASE_METHOD_NO_REGISTRATION(INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_S_T____ ), className ) @@ -285,6 +340,9 @@ using Catch::Detail::Approx; #define CATCH_THEN( desc ) #define CATCH_AND_THEN( desc ) +#define CATCH_STATIC_REQUIRE( ... ) (void)(0) +#define CATCH_STATIC_REQUIRE_FALSE( ... ) (void)(0) + // If CATCH_CONFIG_PREFIX_ALL is not defined then the CATCH_ prefix is not required #else @@ -335,6 +393,21 @@ using Catch::Detail::Approx; #define SUCCEED( ... ) (void)(0) #define ANON_TEST_CASE() INTERNAL_CATCH_TESTCASE_NO_REGISTRATION(INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_S_T____ )) +#ifndef CATCH_CONFIG_TRADITIONAL_MSVC_PREPROCESSOR +#define TEMPLATE_TEST_CASE( ... ) INTERNAL_CATCH_TEMPLATE_TEST_CASE_NO_REGISTRATION(INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_M_P_L_A_T_E____T_E_S_T____ ) ) +#define TEMPLATE_TEST_CASE_METHOD( className, ... ) INTERNAL_CATCH_TEMPLATE_TEST_CASE_METHOD_NO_REGISTRATION(INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_M_P_L_A_T_E____T_E_S_T____ ), className ) +#define TEMPLATE_PRODUCT_TEST_CASE( ... ) TEMPLATE_TEST_CASE( __VA_ARGS__ ) +#define TEMPLATE_PRODUCT_TEST_CASE_METHOD( className, ... ) TEMPLATE_TEST_CASE_METHOD( className, __VA_ARGS__ ) +#else +#define TEMPLATE_TEST_CASE( ... ) INTERNAL_CATCH_EXPAND_VARGS( INTERNAL_CATCH_TEMPLATE_TEST_CASE_NO_REGISTRATION(INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_M_P_L_A_T_E____T_E_S_T____ ) ) ) +#define TEMPLATE_TEST_CASE_METHOD( className, ... ) INTERNAL_CATCH_EXPAND_VARGS( INTERNAL_CATCH_TEMPLATE_TEST_CASE_METHOD_NO_REGISTRATION(INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_M_P_L_A_T_E____T_E_S_T____ ), className ) ) +#define TEMPLATE_PRODUCT_TEST_CASE( ... ) TEMPLATE_TEST_CASE( __VA_ARGS__ ) +#define TEMPLATE_PRODUCT_TEST_CASE_METHOD( className, ... ) TEMPLATE_TEST_CASE_METHOD( className, __VA_ARGS__ ) +#endif + +#define STATIC_REQUIRE( ... ) (void)(0) +#define STATIC_REQUIRE_FALSE( ... ) (void)(0) + #endif #define CATCH_TRANSLATE_EXCEPTION( signature ) INTERNAL_CATCH_TRANSLATE_EXCEPTION_NO_REG( INTERNAL_CATCH_UNIQUE_NAME( catch_internal_ExceptionTranslator ), signature ) diff --git a/packages/Catch2/include/external/clara.hpp b/packages/Catch2/include/external/clara.hpp index 3a7f88363711015a95f47f62b721b9deb185010f..056e0a3152600199ba9397bb03bdaeb5a617f8ad 100644 --- a/packages/Catch2/include/external/clara.hpp +++ b/packages/Catch2/include/external/clara.hpp @@ -5,7 +5,7 @@ // // See https://github.com/philsquared/Clara for more details -// Clara v1.1.4 +// Clara v1.1.5 #ifndef CATCH_CLARA_HPP_INCLUDED #define CATCH_CLARA_HPP_INCLUDED @@ -34,8 +34,8 @@ // // A single-header library for wrapping and laying out basic text, by Phil Nash // -// This work is licensed under the BSD 2-Clause license. -// See the accompanying LICENSE file, or the one at https://opensource.org/licenses/BSD-2-Clause +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // // This project is hosted at https://github.com/philsquared/textflowcpp @@ -52,317 +52,326 @@ #endif -namespace Catch { namespace clara { namespace TextFlow { - - inline auto isWhitespace( char c ) -> bool { - static std::string chars = " \t\n\r"; - return chars.find( c ) != std::string::npos; - } - inline auto isBreakableBefore( char c ) -> bool { - static std::string chars = "[({<|"; - return chars.find( c ) != std::string::npos; - } - inline auto isBreakableAfter( char c ) -> bool { - static std::string chars = "])}>.,:;*+-=&/\\"; - return chars.find( c ) != std::string::npos; - } - - class Columns; - - class Column { - std::vector<std::string> m_strings; - size_t m_width = CATCH_CLARA_TEXTFLOW_CONFIG_CONSOLE_WIDTH; - size_t m_indent = 0; - size_t m_initialIndent = std::string::npos; - - public: - class iterator { - friend Column; - - Column const& m_column; - size_t m_stringIndex = 0; - size_t m_pos = 0; - - size_t m_len = 0; - size_t m_end = 0; - bool m_suffix = false; - - iterator( Column const& column, size_t stringIndex ) - : m_column( column ), - m_stringIndex( stringIndex ) - {} - - auto line() const -> std::string const& { return m_column.m_strings[m_stringIndex]; } - - auto isBoundary( size_t at ) const -> bool { - assert( at > 0 ); - assert( at <= line().size() ); - - return at == line().size() || - ( isWhitespace( line()[at] ) && !isWhitespace( line()[at-1] ) ) || - isBreakableBefore( line()[at] ) || - isBreakableAfter( line()[at-1] ); - } - - void calcLength() { - assert( m_stringIndex < m_column.m_strings.size() ); - - m_suffix = false; - auto width = m_column.m_width-indent(); - m_end = m_pos; - while( m_end < line().size() && line()[m_end] != '\n' ) - ++m_end; - - if( m_end < m_pos + width ) { - m_len = m_end - m_pos; - } - else { - size_t len = width; - while (len > 0 && !isBoundary(m_pos + len)) - --len; - while (len > 0 && isWhitespace( line()[m_pos + len - 1] )) - --len; - - if (len > 0) { - m_len = len; - } else { - m_suffix = true; - m_len = width - 1; - } - } - } - - auto indent() const -> size_t { - auto initial = m_pos == 0 && m_stringIndex == 0 ? m_column.m_initialIndent : std::string::npos; - return initial == std::string::npos ? m_column.m_indent : initial; - } - - auto addIndentAndSuffix(std::string const &plain) const -> std::string { - return std::string( indent(), ' ' ) + (m_suffix ? plain + "-" : plain); - } - - public: - explicit iterator( Column const& column ) : m_column( column ) { - assert( m_column.m_width > m_column.m_indent ); - assert( m_column.m_initialIndent == std::string::npos || m_column.m_width > m_column.m_initialIndent ); - calcLength(); - if( m_len == 0 ) - m_stringIndex++; // Empty string - } - - auto operator *() const -> std::string { - assert( m_stringIndex < m_column.m_strings.size() ); - assert( m_pos <= m_end ); - if( m_pos + m_column.m_width < m_end ) - return addIndentAndSuffix(line().substr(m_pos, m_len)); - else - return addIndentAndSuffix(line().substr(m_pos, m_end - m_pos)); - } - - auto operator ++() -> iterator& { - m_pos += m_len; - if( m_pos < line().size() && line()[m_pos] == '\n' ) - m_pos += 1; - else - while( m_pos < line().size() && isWhitespace( line()[m_pos] ) ) - ++m_pos; - - if( m_pos == line().size() ) { - m_pos = 0; - ++m_stringIndex; - } - if( m_stringIndex < m_column.m_strings.size() ) - calcLength(); - return *this; - } - auto operator ++(int) -> iterator { - iterator prev( *this ); - operator++(); - return prev; - } - - auto operator ==( iterator const& other ) const -> bool { - return - m_pos == other.m_pos && - m_stringIndex == other.m_stringIndex && - &m_column == &other.m_column; - } - auto operator !=( iterator const& other ) const -> bool { - return !operator==( other ); - } - }; - using const_iterator = iterator; - - explicit Column( std::string const& text ) { m_strings.push_back( text ); } - - auto width( size_t newWidth ) -> Column& { - assert( newWidth > 0 ); - m_width = newWidth; - return *this; - } - auto indent( size_t newIndent ) -> Column& { - m_indent = newIndent; - return *this; - } - auto initialIndent( size_t newIndent ) -> Column& { - m_initialIndent = newIndent; - return *this; - } - - auto width() const -> size_t { return m_width; } - auto begin() const -> iterator { return iterator( *this ); } - auto end() const -> iterator { return { *this, m_strings.size() }; } - - inline friend std::ostream& operator << ( std::ostream& os, Column const& col ) { - bool first = true; - for( auto line : col ) { - if( first ) - first = false; - else - os << "\n"; - os << line; - } - return os; - } - - auto operator + ( Column const& other ) -> Columns; - - auto toString() const -> std::string { - std::ostringstream oss; - oss << *this; - return oss.str(); - } - }; - - class Spacer : public Column { - - public: - explicit Spacer( size_t spaceWidth ) : Column( "" ) { - width( spaceWidth ); - } - }; - - class Columns { - std::vector<Column> m_columns; - - public: - - class iterator { - friend Columns; - struct EndTag {}; - - std::vector<Column> const& m_columns; - std::vector<Column::iterator> m_iterators; - size_t m_activeIterators; - - iterator( Columns const& columns, EndTag ) - : m_columns( columns.m_columns ), - m_activeIterators( 0 ) - { - m_iterators.reserve( m_columns.size() ); - - for( auto const& col : m_columns ) - m_iterators.push_back( col.end() ); - } - - public: - explicit iterator( Columns const& columns ) - : m_columns( columns.m_columns ), - m_activeIterators( m_columns.size() ) - { - m_iterators.reserve( m_columns.size() ); - - for( auto const& col : m_columns ) - m_iterators.push_back( col.begin() ); - } - - auto operator ==( iterator const& other ) const -> bool { - return m_iterators == other.m_iterators; - } - auto operator !=( iterator const& other ) const -> bool { - return m_iterators != other.m_iterators; - } - auto operator *() const -> std::string { - std::string row, padding; - - for( size_t i = 0; i < m_columns.size(); ++i ) { - auto width = m_columns[i].width(); - if( m_iterators[i] != m_columns[i].end() ) { - std::string col = *m_iterators[i]; - row += padding + col; - if( col.size() < width ) - padding = std::string( width - col.size(), ' ' ); - else - padding = ""; - } - else { - padding += std::string( width, ' ' ); - } - } - return row; - } - auto operator ++() -> iterator& { - for( size_t i = 0; i < m_columns.size(); ++i ) { - if (m_iterators[i] != m_columns[i].end()) - ++m_iterators[i]; - } - return *this; - } - auto operator ++(int) -> iterator { - iterator prev( *this ); - operator++(); - return prev; - } - }; - using const_iterator = iterator; - - auto begin() const -> iterator { return iterator( *this ); } - auto end() const -> iterator { return { *this, iterator::EndTag() }; } - - auto operator += ( Column const& col ) -> Columns& { - m_columns.push_back( col ); - return *this; - } - auto operator + ( Column const& col ) -> Columns { - Columns combined = *this; - combined += col; - return combined; - } - - inline friend std::ostream& operator << ( std::ostream& os, Columns const& cols ) { - - bool first = true; - for( auto line : cols ) { - if( first ) - first = false; - else - os << "\n"; - os << line; - } - return os; - } - - auto toString() const -> std::string { - std::ostringstream oss; - oss << *this; - return oss.str(); - } - }; - - inline auto Column::operator + ( Column const& other ) -> Columns { - Columns cols; - cols += *this; - cols += other; - return cols; - } -}}} // namespace Catch::clara::TextFlow - +namespace Catch { +namespace clara { +namespace TextFlow { + +inline auto isWhitespace(char c) -> bool { + static std::string chars = " \t\n\r"; + return chars.find(c) != std::string::npos; +} +inline auto isBreakableBefore(char c) -> bool { + static std::string chars = "[({<|"; + return chars.find(c) != std::string::npos; +} +inline auto isBreakableAfter(char c) -> bool { + static std::string chars = "])}>.,:;*+-=&/\\"; + return chars.find(c) != std::string::npos; +} + +class Columns; + +class Column { + std::vector<std::string> m_strings; + size_t m_width = CATCH_CLARA_TEXTFLOW_CONFIG_CONSOLE_WIDTH; + size_t m_indent = 0; + size_t m_initialIndent = std::string::npos; + +public: + class iterator { + friend Column; + + Column const& m_column; + size_t m_stringIndex = 0; + size_t m_pos = 0; + + size_t m_len = 0; + size_t m_end = 0; + bool m_suffix = false; + + iterator(Column const& column, size_t stringIndex) + : m_column(column), + m_stringIndex(stringIndex) {} + + auto line() const -> std::string const& { return m_column.m_strings[m_stringIndex]; } + + auto isBoundary(size_t at) const -> bool { + assert(at > 0); + assert(at <= line().size()); + + return at == line().size() || + (isWhitespace(line()[at]) && !isWhitespace(line()[at - 1])) || + isBreakableBefore(line()[at]) || + isBreakableAfter(line()[at - 1]); + } + + void calcLength() { + assert(m_stringIndex < m_column.m_strings.size()); + + m_suffix = false; + auto width = m_column.m_width - indent(); + m_end = m_pos; + while (m_end < line().size() && line()[m_end] != '\n') + ++m_end; + + if (m_end < m_pos + width) { + m_len = m_end - m_pos; + } else { + size_t len = width; + while (len > 0 && !isBoundary(m_pos + len)) + --len; + while (len > 0 && isWhitespace(line()[m_pos + len - 1])) + --len; + + if (len > 0) { + m_len = len; + } else { + m_suffix = true; + m_len = width - 1; + } + } + } + + auto indent() const -> size_t { + auto initial = m_pos == 0 && m_stringIndex == 0 ? m_column.m_initialIndent : std::string::npos; + return initial == std::string::npos ? m_column.m_indent : initial; + } + + auto addIndentAndSuffix(std::string const &plain) const -> std::string { + return std::string(indent(), ' ') + (m_suffix ? plain + "-" : plain); + } + + public: + using difference_type = std::ptrdiff_t; + using value_type = std::string; + using pointer = value_type * ; + using reference = value_type & ; + using iterator_category = std::forward_iterator_tag; + + explicit iterator(Column const& column) : m_column(column) { + assert(m_column.m_width > m_column.m_indent); + assert(m_column.m_initialIndent == std::string::npos || m_column.m_width > m_column.m_initialIndent); + calcLength(); + if (m_len == 0) + m_stringIndex++; // Empty string + } + + auto operator *() const -> std::string { + assert(m_stringIndex < m_column.m_strings.size()); + assert(m_pos <= m_end); + return addIndentAndSuffix(line().substr(m_pos, m_len)); + } + + auto operator ++() -> iterator& { + m_pos += m_len; + if (m_pos < line().size() && line()[m_pos] == '\n') + m_pos += 1; + else + while (m_pos < line().size() && isWhitespace(line()[m_pos])) + ++m_pos; + + if (m_pos == line().size()) { + m_pos = 0; + ++m_stringIndex; + } + if (m_stringIndex < m_column.m_strings.size()) + calcLength(); + return *this; + } + auto operator ++(int) -> iterator { + iterator prev(*this); + operator++(); + return prev; + } + + auto operator ==(iterator const& other) const -> bool { + return + m_pos == other.m_pos && + m_stringIndex == other.m_stringIndex && + &m_column == &other.m_column; + } + auto operator !=(iterator const& other) const -> bool { + return !operator==(other); + } + }; + using const_iterator = iterator; + + explicit Column(std::string const& text) { m_strings.push_back(text); } + + auto width(size_t newWidth) -> Column& { + assert(newWidth > 0); + m_width = newWidth; + return *this; + } + auto indent(size_t newIndent) -> Column& { + m_indent = newIndent; + return *this; + } + auto initialIndent(size_t newIndent) -> Column& { + m_initialIndent = newIndent; + return *this; + } + + auto width() const -> size_t { return m_width; } + auto begin() const -> iterator { return iterator(*this); } + auto end() const -> iterator { return { *this, m_strings.size() }; } + + inline friend std::ostream& operator << (std::ostream& os, Column const& col) { + bool first = true; + for (auto line : col) { + if (first) + first = false; + else + os << "\n"; + os << line; + } + return os; + } + + auto operator + (Column const& other)->Columns; + + auto toString() const -> std::string { + std::ostringstream oss; + oss << *this; + return oss.str(); + } +}; + +class Spacer : public Column { + +public: + explicit Spacer(size_t spaceWidth) : Column("") { + width(spaceWidth); + } +}; + +class Columns { + std::vector<Column> m_columns; + +public: + + class iterator { + friend Columns; + struct EndTag {}; + + std::vector<Column> const& m_columns; + std::vector<Column::iterator> m_iterators; + size_t m_activeIterators; + + iterator(Columns const& columns, EndTag) + : m_columns(columns.m_columns), + m_activeIterators(0) { + m_iterators.reserve(m_columns.size()); + + for (auto const& col : m_columns) + m_iterators.push_back(col.end()); + } + + public: + using difference_type = std::ptrdiff_t; + using value_type = std::string; + using pointer = value_type * ; + using reference = value_type & ; + using iterator_category = std::forward_iterator_tag; + + explicit iterator(Columns const& columns) + : m_columns(columns.m_columns), + m_activeIterators(m_columns.size()) { + m_iterators.reserve(m_columns.size()); + + for (auto const& col : m_columns) + m_iterators.push_back(col.begin()); + } + + auto operator ==(iterator const& other) const -> bool { + return m_iterators == other.m_iterators; + } + auto operator !=(iterator const& other) const -> bool { + return m_iterators != other.m_iterators; + } + auto operator *() const -> std::string { + std::string row, padding; + + for (size_t i = 0; i < m_columns.size(); ++i) { + auto width = m_columns[i].width(); + if (m_iterators[i] != m_columns[i].end()) { + std::string col = *m_iterators[i]; + row += padding + col; + if (col.size() < width) + padding = std::string(width - col.size(), ' '); + else + padding = ""; + } else { + padding += std::string(width, ' '); + } + } + return row; + } + auto operator ++() -> iterator& { + for (size_t i = 0; i < m_columns.size(); ++i) { + if (m_iterators[i] != m_columns[i].end()) + ++m_iterators[i]; + } + return *this; + } + auto operator ++(int) -> iterator { + iterator prev(*this); + operator++(); + return prev; + } + }; + using const_iterator = iterator; + + auto begin() const -> iterator { return iterator(*this); } + auto end() const -> iterator { return { *this, iterator::EndTag() }; } + + auto operator += (Column const& col) -> Columns& { + m_columns.push_back(col); + return *this; + } + auto operator + (Column const& col) -> Columns { + Columns combined = *this; + combined += col; + return combined; + } + + inline friend std::ostream& operator << (std::ostream& os, Columns const& cols) { + + bool first = true; + for (auto line : cols) { + if (first) + first = false; + else + os << "\n"; + os << line; + } + return os; + } + + auto toString() const -> std::string { + std::ostringstream oss; + oss << *this; + return oss.str(); + } +}; + +inline auto Column::operator + (Column const& other) -> Columns { + Columns cols; + cols += *this; + cols += other; + return cols; +} +} + +} +} #endif // CATCH_CLARA_TEXTFLOW_HPP_INCLUDED // ----------- end of #include from clara_textflow.hpp ----------- // ........... back in clara.hpp +#include <string> #include <memory> #include <set> #include <algorithm> diff --git a/packages/Catch2/include/internal/catch_commandline.cpp b/packages/Catch2/include/internal/catch_commandline.cpp index c57b7ed74dc9ecb3ddb357ac2d84a43f5ab4c182..66759ebbf168c842d48ef8ad356f612640108fd0 100644 --- a/packages/Catch2/include/internal/catch_commandline.cpp +++ b/packages/Catch2/include/internal/catch_commandline.cpp @@ -10,6 +10,9 @@ #include "catch_string_manip.h" +#include "catch_interfaces_registry_hub.h" +#include "catch_interfaces_reporter.h" + #include <fstream> #include <ctime> @@ -105,6 +108,18 @@ namespace Catch { return ParserResult::runtimeError( "Unrecognised verbosity, '" + verbosity + "'" ); return ParserResult::ok( ParseResultType::Matched ); }; + auto const setReporter = [&]( std::string const& reporter ) { + IReporterRegistry::FactoryMap const& factories = getRegistryHub().getReporterRegistry().getFactories(); + + auto lcReporter = toLower( reporter ); + auto result = factories.find( lcReporter ); + + if( factories.end() != result ) + config.reporterName = lcReporter; + else + return ParserResult::runtimeError( "Unrecognized reporter, '" + reporter + "'. Check available with --list-reporters" ); + return ParserResult::ok( ParseResultType::Matched ); + }; auto cli = ExeName( config.processName ) @@ -130,7 +145,7 @@ namespace Catch { | Opt( config.outputFilename, "filename" ) ["-o"]["--out"] ( "output filename" ) - | Opt( config.reporterName, "name" ) + | Opt( setReporter, "name" ) ["-r"]["--reporter"] ( "reporter to use (defaults to console)" ) | Opt( config.name, "name" ) diff --git a/packages/Catch2/include/internal/catch_common.h b/packages/Catch2/include/internal/catch_common.h index 4aaf80c590f79e070641944d048f22f071ed40a7..b332e164bb2e9ebd3d7dfe3b799af11974107f72 100644 --- a/packages/Catch2/include/internal/catch_common.h +++ b/packages/Catch2/include/internal/catch_common.h @@ -22,6 +22,10 @@ #include <string> #include <cstdint> +// We need a dummy global operator<< so we can bring it into Catch namespace later +struct Catch_global_namespace_dummy {}; +std::ostream& operator<<(std::ostream&, Catch_global_namespace_dummy); + namespace Catch { struct CaseSensitive { enum Choice { @@ -63,6 +67,11 @@ namespace Catch { std::ostream& operator << ( std::ostream& os, SourceLineInfo const& info ); + // Bring in operator<< from global namespace into Catch namespace + // This is necessary because the overload of operator<< above makes + // lookup stop at namespace Catch + using ::operator<<; + // Use this in variadic streaming macros to allow // >> +StreamEndStop // as well as diff --git a/packages/Catch2/include/internal/catch_compiler_capabilities.h b/packages/Catch2/include/internal/catch_compiler_capabilities.h index aa3e599e30a1b9a5c5615f152184667ee547f26c..cf3a44242144ac67e07ff97714040755c158b771 100644 --- a/packages/Catch2/include/internal/catch_compiler_capabilities.h +++ b/packages/Catch2/include/internal/catch_compiler_capabilities.h @@ -136,6 +136,13 @@ # define CATCH_INTERNAL_CONFIG_WINDOWS_SEH # endif +// MSVC traditional preprocessor needs some workaround for __VA_ARGS__ +// _MSVC_TRADITIONAL == 0 means new conformant preprocessor +// _MSVC_TRADITIONAL == 1 means old traditional non-conformant preprocessor +# if !defined(_MSVC_TRADITIONAL) || (defined(_MSVC_TRADITIONAL) && _MSVC_TRADITIONAL) +# define CATCH_INTERNAL_CONFIG_TRADITIONAL_MSVC_PREPROCESSOR +# endif + #endif // _MSC_VER //////////////////////////////////////////////////////////////////////////////// @@ -150,6 +157,12 @@ # define CATCH_INTERNAL_CONFIG_NO_WCHAR #endif // __DJGPP__ +//////////////////////////////////////////////////////////////////////////////// +// Embarcadero C++Build +#if defined(__BORLANDC__) + #define CATCH_INTERNAL_CONFIG_POLYFILL_ISNAN +#endif + //////////////////////////////////////////////////////////////////////////////// // Use of __COUNTER__ is suppressed during code analysis in @@ -231,6 +244,10 @@ # define CATCH_CONFIG_DISABLE_EXCEPTIONS #endif +#if defined(CATCH_INTERNAL_CONFIG_POLYFILL_ISNAN) && !defined(CATCH_CONFIG_NO_POLYFILL_ISNAN) && !defined(CATCH_CONFIG_POLYFILL_ISNAN) +# define CATCH_CONFIG_POLYFILL_ISNAN +#endif + #if !defined(CATCH_INTERNAL_SUPPRESS_PARENTHESES_WARNINGS) # define CATCH_INTERNAL_SUPPRESS_PARENTHESES_WARNINGS # define CATCH_INTERNAL_UNSUPPRESS_PARENTHESES_WARNINGS @@ -254,6 +271,9 @@ #define CATCH_CATCH_ANON(type) catch (type) #endif +#if defined(CATCH_INTERNAL_CONFIG_TRADITIONAL_MSVC_PREPROCESSOR) && !defined(CATCH_CONFIG_NO_TRADITIONAL_MSVC_PREPROCESSOR) && !defined(CATCH_CONFIG_TRADITIONAL_MSVC_PREPROCESSOR) +#define CATCH_CONFIG_TRADITIONAL_MSVC_PREPROCESSOR +#endif #endif // TWOBLUECUBES_CATCH_COMPILER_CAPABILITIES_HPP_INCLUDED diff --git a/packages/Catch2/include/internal/catch_leak_detector.cpp b/packages/Catch2/include/internal/catch_leak_detector.cpp index dd160d9c44644f04b2119cf608663260441b7cac..7a30e8a140eed12dfdd19aa5346659438e751d49 100644 --- a/packages/Catch2/include/internal/catch_leak_detector.cpp +++ b/packages/Catch2/include/internal/catch_leak_detector.cpp @@ -6,6 +6,7 @@ */ #include "catch_leak_detector.h" + #include "catch_interfaces_registry_hub.h" #ifdef CATCH_CONFIG_WINDOWS_CRTDBG @@ -30,3 +31,7 @@ namespace Catch { Catch::LeakDetector::LeakDetector() {} #endif + +Catch::LeakDetector::~LeakDetector() { + Catch::cleanUp(); +} diff --git a/packages/Catch2/include/internal/catch_leak_detector.h b/packages/Catch2/include/internal/catch_leak_detector.h index bfb0b4298d2278fcaa0252c006fdb9d9b806afb5..633457ac8f0b16ae2f3419185da61f0ac91f5dc7 100644 --- a/packages/Catch2/include/internal/catch_leak_detector.h +++ b/packages/Catch2/include/internal/catch_leak_detector.h @@ -11,6 +11,7 @@ namespace Catch { struct LeakDetector { LeakDetector(); + ~LeakDetector(); }; } diff --git a/packages/Catch2/include/internal/catch_list.cpp b/packages/Catch2/include/internal/catch_list.cpp index 3b0e33f112e88dd7ed6e8105c994dbad64ee9049..6010ec15d2f238aa92d9b92880a914a1464562ed 100644 --- a/packages/Catch2/include/internal/catch_list.cpp +++ b/packages/Catch2/include/internal/catch_list.cpp @@ -124,7 +124,7 @@ namespace Catch { return tagCounts.size(); } - std::size_t listReporters( Config const& /*config*/ ) { + std::size_t listReporters() { Catch::cout() << "Available reporters:\n"; IReporterRegistry::FactoryMap const& factories = getRegistryHub().getReporterRegistry().getFactories(); std::size_t maxNameLen = 0; @@ -155,7 +155,7 @@ namespace Catch { if( config.listTags() ) listedCount = listedCount.valueOr(0) + listTags( config ); if( config.listReporters() ) - listedCount = listedCount.valueOr(0) + listReporters( config ); + listedCount = listedCount.valueOr(0) + listReporters(); return listedCount; } diff --git a/packages/Catch2/include/internal/catch_list.h b/packages/Catch2/include/internal/catch_list.h index 4bc96ec5176bac819a29ae54c62f226e717ede04..bd29d97066a623417bd47d8b3dadc0d705ab8115 100644 --- a/packages/Catch2/include/internal/catch_list.h +++ b/packages/Catch2/include/internal/catch_list.h @@ -29,7 +29,7 @@ namespace Catch { std::size_t listTags( Config const& config ); - std::size_t listReporters( Config const& /*config*/ ); + std::size_t listReporters(); Option<std::size_t> list( Config const& config ); diff --git a/packages/Catch2/include/internal/catch_matchers.h b/packages/Catch2/include/internal/catch_matchers.h index 29692fc05e6e19b55c7271193acbccf89b93dc35..aebd4c23948b120b0f9e8b961a149fac188fc4cf 100644 --- a/packages/Catch2/include/internal/catch_matchers.h +++ b/packages/Catch2/include/internal/catch_matchers.h @@ -43,10 +43,6 @@ namespace Matchers { struct MatcherMethod { virtual bool match( ObjectT const& arg ) const = 0; }; - template<typename PtrT> - struct MatcherMethod<PtrT*> { - virtual bool match( PtrT* arg ) const = 0; - }; #ifdef __clang__ # pragma clang diagnostic pop diff --git a/packages/Catch2/include/internal/catch_matchers_floating.cpp b/packages/Catch2/include/internal/catch_matchers_floating.cpp index 312069867d1ec167cd0a6d8542925e3527b6c684..9bc082edea23cba86d93603c411af6f4a439d2f6 100644 --- a/packages/Catch2/include/internal/catch_matchers_floating.cpp +++ b/packages/Catch2/include/internal/catch_matchers_floating.cpp @@ -7,6 +7,7 @@ #include "catch_matchers_floating.h" #include "catch_enforce.h" +#include "catch_polyfills.hpp" #include "catch_to_string.hpp" #include "catch_tostring.h" @@ -57,7 +58,7 @@ template <typename FP> bool almostEqualUlps(FP lhs, FP rhs, int maxUlpDiff) { // Comparison with NaN should always be false. // This way we can rule it out before getting into the ugly details - if (std::isnan(lhs) || std::isnan(rhs)) { + if (Catch::isnan(lhs) || Catch::isnan(rhs)) { return false; } diff --git a/packages/Catch2/include/internal/catch_message.cpp b/packages/Catch2/include/internal/catch_message.cpp index df905bf6b498dd40c28175471dee11f0b1e8c80a..98a4dae119aa3880c8e4b29595ab4ede675165e3 100644 --- a/packages/Catch2/include/internal/catch_message.cpp +++ b/packages/Catch2/include/internal/catch_message.cpp @@ -11,6 +11,7 @@ #include "catch_uncaught_exceptions.h" #include <cassert> +#include <stack> namespace Catch { @@ -60,19 +61,48 @@ namespace Catch { Capturer::Capturer( StringRef macroName, SourceLineInfo const& lineInfo, ResultWas::OfType resultType, StringRef names ) { - auto start = std::string::npos; - for( size_t pos = 0; pos <= names.size(); ++pos ) { + auto trimmed = [&] (size_t start, size_t end) { + while (names[start] == ',' || isspace(names[start])) { + ++start; + } + while (names[end] == ',' || isspace(names[end])) { + --end; + } + return names.substr(start, end - start + 1); + }; + + size_t start = 0; + std::stack<char> openings; + for (size_t pos = 0; pos < names.size(); ++pos) { char c = names[pos]; - if( pos == names.size() || c == ' ' || c == '\t' || c == ',' || c == ']' ) { - if( start != std::string::npos ) { - m_messages.push_back( MessageInfo( macroName, lineInfo, resultType ) ); - m_messages.back().message = names.substr( start, pos-start) + " := "; - start = std::string::npos; + switch (c) { + case '[': + case '{': + case '(': + // It is basically impossible to disambiguate between + // comparison and start of template args in this context +// case '<': + openings.push(c); + break; + case ']': + case '}': + case ')': +// case '>': + openings.pop(); + break; + case ',': + if (start != pos && openings.size() == 0) { + m_messages.emplace_back(macroName, lineInfo, resultType); + m_messages.back().message = trimmed(start, pos); + m_messages.back().message += " := "; + start = pos; } } - else if( c != '[' && c != ']' && start == std::string::npos ) - start = pos; } + assert(openings.size() == 0 && "Mismatched openings"); + m_messages.emplace_back(macroName, lineInfo, resultType); + m_messages.back().message = trimmed(start, names.size() - 1); + m_messages.back().message += " := "; } Capturer::~Capturer() { if ( !uncaught_exceptions() ){ @@ -82,7 +112,7 @@ namespace Catch { } } - void Capturer::captureValue( size_t index, StringRef value ) { + void Capturer::captureValue( size_t index, std::string const& value ) { assert( index < m_messages.size() ); m_messages[index].message += value; m_resultCapture.pushScopedMessage( m_messages[index] ); diff --git a/packages/Catch2/include/internal/catch_message.h b/packages/Catch2/include/internal/catch_message.h index 73f9efd16231623d88372cd18b2b1f56e7d56413..e81069bfb87067b155819dd688b146b080c3b2f3 100644 --- a/packages/Catch2/include/internal/catch_message.h +++ b/packages/Catch2/include/internal/catch_message.h @@ -77,16 +77,16 @@ namespace Catch { Capturer( StringRef macroName, SourceLineInfo const& lineInfo, ResultWas::OfType resultType, StringRef names ); ~Capturer(); - void captureValue( size_t index, StringRef value ); + void captureValue( size_t index, std::string const& value ); template<typename T> - void captureValues( size_t index, T&& value ) { + void captureValues( size_t index, T const& value ) { captureValue( index, Catch::Detail::stringify( value ) ); } template<typename T, typename... Ts> - void captureValues( size_t index, T&& value, Ts&&... values ) { - captureValues( index, value ); + void captureValues( size_t index, T const& value, Ts const&... values ) { + captureValue( index, Catch::Detail::stringify(value) ); captureValues( index+1, values... ); } }; diff --git a/packages/Catch2/include/internal/catch_meta.hpp b/packages/Catch2/include/internal/catch_meta.hpp new file mode 100644 index 0000000000000000000000000000000000000000..43ba30fbc0470453048e1a4128bb16db15c22f00 --- /dev/null +++ b/packages/Catch2/include/internal/catch_meta.hpp @@ -0,0 +1,76 @@ +/* + * Created by Jozef on 02/12/2018. + * Copyright 2018 Two Blue Cubes Ltd. All rights reserved. + * + * Distributed under the Boost Software License, Version 1.0. (See accompanying + * file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + */ + +#ifndef TWOBLUECUBES_CATCH_META_HPP_INCLUDED +#define TWOBLUECUBES_CATCH_META_HPP_INCLUDED + +template< typename... > +struct TypeList{}; + +template< typename... > +struct append; + +template< template<typename...> class L1 + , typename...E1 + , template<typename...> class L2 + , typename...E2 + > +struct append< L1<E1...>, L2<E2...> > +{ + using type = L1<E1..., E2...>; +}; + +template< template<typename...> class L1 + , typename...E1 + , template<typename...> class L2 + , typename...E2 + , typename...Rest + > +struct append< L1<E1...>, L2<E2...>, Rest...> +{ + using type = typename append< L1<E1..., E2...>, Rest... >::type; +}; + +template< template<typename...> class + , typename... + > +struct rewrap; + +template< template<typename...> class Container + , template<typename...> class List + , typename...elems + > +struct rewrap<Container, List<elems...>> +{ + using type = TypeList< Container< elems... > >; +}; + +template< template<typename...> class Container + , template<typename...> class List + , class...Elems + , typename...Elements> +struct rewrap<Container, List<Elems...>, Elements...> +{ + using type = typename append<TypeList<Container<Elems...>>, typename rewrap<Container, Elements...>::type>::type; +}; + +template< template<typename...> class...Containers > +struct combine +{ + template< typename...Types > + struct with_types + { + template< template <typename...> class Final > + struct into + { + using type = typename append<Final<>, typename rewrap<Containers, Types...>::type...>::type; + }; + }; +}; + +#endif // TWOBLUECUBES_CATCH_META_HPP_INCLUDED diff --git a/packages/Catch2/include/internal/catch_polyfills.cpp b/packages/Catch2/include/internal/catch_polyfills.cpp new file mode 100644 index 0000000000000000000000000000000000000000..68a2c827c41e4b56d10406623ff129993a93f5d8 --- /dev/null +++ b/packages/Catch2/include/internal/catch_polyfills.cpp @@ -0,0 +1,31 @@ +/* + * Created by Martin on 17/11/2017. + * + * Distributed under the Boost Software License, Version 1.0. (See accompanying + * file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + */ + +#include "catch_polyfills.hpp" + +#include <cmath> + +namespace Catch { + +#if !defined(CATCH_CONFIG_POLYFILL_ISNAN) + bool isnan(float f) { + return std::isnan(f); + } + bool isnan(double d) { + return std::isnan(d); + } +#else + // For now we only use this for embarcadero + bool isnan(float f) { + return std::_isnan(f); + } + bool isnan(double d) { + return std::_isnan(d); + } +#endif + +} // end namespace Catch diff --git a/packages/Catch2/include/internal/catch_polyfills.hpp b/packages/Catch2/include/internal/catch_polyfills.hpp new file mode 100644 index 0000000000000000000000000000000000000000..ba4189ef3d7f75fcd052e90e8990be3b52fdb964 --- /dev/null +++ b/packages/Catch2/include/internal/catch_polyfills.hpp @@ -0,0 +1,15 @@ +/* + * Created by Martin on 17/11/2017. + * + * Distributed under the Boost Software License, Version 1.0. (See accompanying + * file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + */ +#ifndef TWOBLUECUBES_CATCH_POLYFILLS_HPP_INCLUDED +#define TWOBLUECUBES_CATCH_POLYFILLS_HPP_INCLUDED + +namespace Catch { + bool isnan(float f); + bool isnan(double d); +} + +#endif // TWOBLUECUBES_CATCH_POLYFILLS_HPP_INCLUDED diff --git a/packages/Catch2/include/internal/catch_preprocessor.hpp b/packages/Catch2/include/internal/catch_preprocessor.hpp new file mode 100644 index 0000000000000000000000000000000000000000..e58e0bc583c0f10a028e78452b8a549877915429 --- /dev/null +++ b/packages/Catch2/include/internal/catch_preprocessor.hpp @@ -0,0 +1,79 @@ +/* + * Created by Jozef on 12/11/2018. + * Copyright 2017 Two Blue Cubes Ltd. All rights reserved. + * + * Distributed under the Boost Software License, Version 1.0. (See accompanying + * file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + */ + +#ifndef TWOBLUECUBES_CATCH_PREPROCESSOR_HPP_INCLUDED +#define TWOBLUECUBES_CATCH_PREPROCESSOR_HPP_INCLUDED + +#define CATCH_RECURSION_LEVEL0(...) __VA_ARGS__ +#define CATCH_RECURSION_LEVEL1(...) CATCH_RECURSION_LEVEL0(CATCH_RECURSION_LEVEL0(CATCH_RECURSION_LEVEL0(__VA_ARGS__))) +#define CATCH_RECURSION_LEVEL2(...) CATCH_RECURSION_LEVEL1(CATCH_RECURSION_LEVEL1(CATCH_RECURSION_LEVEL1(__VA_ARGS__))) +#define CATCH_RECURSION_LEVEL3(...) CATCH_RECURSION_LEVEL2(CATCH_RECURSION_LEVEL2(CATCH_RECURSION_LEVEL2(__VA_ARGS__))) +#define CATCH_RECURSION_LEVEL4(...) CATCH_RECURSION_LEVEL3(CATCH_RECURSION_LEVEL3(CATCH_RECURSION_LEVEL3(__VA_ARGS__))) +#define CATCH_RECURSION_LEVEL5(...) CATCH_RECURSION_LEVEL4(CATCH_RECURSION_LEVEL4(CATCH_RECURSION_LEVEL4(__VA_ARGS__))) + +#ifdef CATCH_CONFIG_TRADITIONAL_MSVC_PREPROCESSOR +#define INTERNAL_CATCH_EXPAND_VARGS(...) __VA_ARGS__ +// MSVC needs more evaluations +#define CATCH_RECURSION_LEVEL6(...) CATCH_RECURSION_LEVEL5(CATCH_RECURSION_LEVEL5(CATCH_RECURSION_LEVEL5(__VA_ARGS__))) +#define CATCH_RECURSE(...) CATCH_RECURSION_LEVEL6(CATCH_RECURSION_LEVEL6(__VA_ARGS__)) +#else +#define CATCH_RECURSE(...) CATCH_RECURSION_LEVEL5(__VA_ARGS__) +#endif + +#define CATCH_REC_END(...) +#define CATCH_REC_OUT + +#define CATCH_EMPTY() +#define CATCH_DEFER(id) id CATCH_EMPTY() + +#define CATCH_REC_GET_END2() 0, CATCH_REC_END +#define CATCH_REC_GET_END1(...) CATCH_REC_GET_END2 +#define CATCH_REC_GET_END(...) CATCH_REC_GET_END1 +#define CATCH_REC_NEXT0(test, next, ...) next CATCH_REC_OUT +#define CATCH_REC_NEXT1(test, next) CATCH_DEFER ( CATCH_REC_NEXT0 ) ( test, next, 0) +#define CATCH_REC_NEXT(test, next) CATCH_REC_NEXT1(CATCH_REC_GET_END test, next) + +#define CATCH_REC_LIST0(f, x, peek, ...) , f(x) CATCH_DEFER ( CATCH_REC_NEXT(peek, CATCH_REC_LIST1) ) ( f, peek, __VA_ARGS__ ) +#define CATCH_REC_LIST1(f, x, peek, ...) , f(x) CATCH_DEFER ( CATCH_REC_NEXT(peek, CATCH_REC_LIST0) ) ( f, peek, __VA_ARGS__ ) +#define CATCH_REC_LIST2(f, x, peek, ...) f(x) CATCH_DEFER ( CATCH_REC_NEXT(peek, CATCH_REC_LIST1) ) ( f, peek, __VA_ARGS__ ) + +#define CATCH_REC_LIST0_UD(f, userdata, x, peek, ...) , f(userdata, x) CATCH_DEFER ( CATCH_REC_NEXT(peek, CATCH_REC_LIST1_UD) ) ( f, userdata, peek, __VA_ARGS__ ) +#define CATCH_REC_LIST1_UD(f, userdata, x, peek, ...) , f(userdata, x) CATCH_DEFER ( CATCH_REC_NEXT(peek, CATCH_REC_LIST0_UD) ) ( f, userdata, peek, __VA_ARGS__ ) +#define CATCH_REC_LIST2_UD(f, userdata, x, peek, ...) f(userdata, x) CATCH_DEFER ( CATCH_REC_NEXT(peek, CATCH_REC_LIST1_UD) ) ( f, userdata, peek, __VA_ARGS__ ) + +// Applies the function macro `f` to each of the remaining parameters, inserts commas between the results, +// and passes userdata as the first parameter to each invocation, +// e.g. CATCH_REC_LIST_UD(f, x, a, b, c) evaluates to f(x, a), f(x, b), f(x, c) +#define CATCH_REC_LIST_UD(f, userdata, ...) CATCH_RECURSE(CATCH_REC_LIST2_UD(f, userdata, __VA_ARGS__, ()()(), ()()(), ()()(), 0)) + +#define CATCH_REC_LIST(f, ...) CATCH_RECURSE(CATCH_REC_LIST2(f, __VA_ARGS__, ()()(), ()()(), ()()(), 0)) + +#define INTERNAL_CATCH_EXPAND1(param) INTERNAL_CATCH_EXPAND2(param) +#define INTERNAL_CATCH_EXPAND2(...) INTERNAL_CATCH_NO## __VA_ARGS__ +#define INTERNAL_CATCH_DEF(...) INTERNAL_CATCH_DEF __VA_ARGS__ +#define INTERNAL_CATCH_NOINTERNAL_CATCH_DEF + +#define INTERNAL_CATCH_REMOVE_PARENS(...) INTERNAL_CATCH_EXPAND1(INTERNAL_CATCH_DEF __VA_ARGS__) + +#define INTERNAL_CATCH_TEMPLATE_UNIQUE_NAME2(Name, ...) INTERNAL_CATCH_TEMPLATE_UNIQUE_NAME3(Name, __VA_ARGS__) +#ifndef CATCH_CONFIG_TRADITIONAL_MSVC_PREPROCESSOR +#define INTERNAL_CATCH_TEMPLATE_UNIQUE_NAME3(Name,...) Name " - " #__VA_ARGS__ +#define INTERNAL_CATCH_TEMPLATE_UNIQUE_NAME(Name,...) INTERNAL_CATCH_TEMPLATE_UNIQUE_NAME2(Name, INTERNAL_CATCH_REMOVE_PARENS(__VA_ARGS__)) +#else +// MSVC is adding extra space and needs more calls to properly remove () +#define INTERNAL_CATCH_TEMPLATE_UNIQUE_NAME3(Name,...) Name " -" #__VA_ARGS__ +#define INTERNAL_CATCH_TEMPLATE_UNIQUE_NAME1(Name, ...) INTERNAL_CATCH_TEMPLATE_UNIQUE_NAME2(Name, __VA_ARGS__) +#define INTERNAL_CATCH_TEMPLATE_UNIQUE_NAME(Name, ...) INTERNAL_CATCH_TEMPLATE_UNIQUE_NAME1(Name, INTERNAL_CATCH_EXPAND_VARGS(INTERNAL_CATCH_REMOVE_PARENS(__VA_ARGS__))) +#endif + +#define INTERNAL_CATCH_MAKE_TYPE_LIST(types) TypeList<INTERNAL_CATCH_REMOVE_PARENS(types)> + +#define INTERNAL_CATCH_MAKE_TYPE_LISTS_FROM_TYPES(types)\ + CATCH_REC_LIST(INTERNAL_CATCH_MAKE_TYPE_LIST,INTERNAL_CATCH_REMOVE_PARENS(types)) + +#endif // TWOBLUECUBES_CATCH_PREPROCESSOR_HPP_INCLUDED diff --git a/packages/Catch2/include/internal/catch_session.cpp b/packages/Catch2/include/internal/catch_session.cpp index 5d028ed21e84186c9094fbc8039394ee7c5db1fc..0920521c0085667951c778ade00b716f5e624532 100644 --- a/packages/Catch2/include/internal/catch_session.cpp +++ b/packages/Catch2/include/internal/catch_session.cpp @@ -54,8 +54,6 @@ namespace Catch { Catch::Totals runTests(std::shared_ptr<Config> const& config) { - // FixMe: Add listeners in order first, then add reporters. - auto reporter = makeReporter(config); RunContext context(config, std::move(reporter)); @@ -185,22 +183,8 @@ namespace Catch { return 0; } - void Session::useConfigData( ConfigData const& configData ) { - m_configData = configData; - m_config.reset(); - } - - int Session::run( int argc, char* argv[] ) { - if( m_startupExceptions ) - return 1; - int returnCode = applyCommandLine( argc, argv ); - if( returnCode == 0 ) - returnCode = run(); - return returnCode; - } - #if defined(CATCH_CONFIG_WCHAR) && defined(WIN32) && defined(UNICODE) - int Session::run( int argc, wchar_t* const argv[] ) { + int Session::applyCommandLine( int argc, wchar_t const * const * argv ) { char **utf8Argv = new char *[ argc ]; @@ -212,7 +196,7 @@ namespace Catch { WideCharToMultiByte( CP_UTF8, 0, argv[i], -1, utf8Argv[i], bufSize, NULL, NULL ); } - int returnCode = run( argc, utf8Argv ); + int returnCode = applyCommandLine( argc, utf8Argv ); for ( int i = 0; i < argc; ++i ) delete [] utf8Argv[ i ]; @@ -222,6 +206,12 @@ namespace Catch { return returnCode; } #endif + + void Session::useConfigData( ConfigData const& configData ) { + m_configData = configData; + m_config.reset(); + } + int Session::run() { if( ( m_configData.waitForKeypress & WaitForKeypress::BeforeStart ) != 0 ) { Catch::cout() << "...waiting for enter/ return before starting" << std::endl; diff --git a/packages/Catch2/include/internal/catch_session.h b/packages/Catch2/include/internal/catch_session.h index eb8013cd2f18f4b6b6b3b97096a07a5263badcd5..af820da44729926729d368a754445375593bf93a 100644 --- a/packages/Catch2/include/internal/catch_session.h +++ b/packages/Catch2/include/internal/catch_session.h @@ -26,13 +26,22 @@ namespace Catch { void libIdentify(); int applyCommandLine( int argc, char const * const * argv ); + #if defined(CATCH_CONFIG_WCHAR) && defined(WIN32) && defined(UNICODE) + int applyCommandLine( int argc, wchar_t const * const * argv ); + #endif void useConfigData( ConfigData const& configData ); - int run( int argc, char* argv[] ); - #if defined(CATCH_CONFIG_WCHAR) && defined(WIN32) && defined(UNICODE) - int run( int argc, wchar_t* const argv[] ); - #endif + template<typename CharT> + int run(int argc, CharT const * const argv[]) { + if (m_startupExceptions) + return 1; + int returnCode = applyCommandLine(argc, argv); + if (returnCode == 0) + returnCode = run(); + return returnCode; + } + int run(); clara::Parser const& cli() const; diff --git a/packages/Catch2/include/internal/catch_test_registry.h b/packages/Catch2/include/internal/catch_test_registry.h index 71304483486780207f365a19f44033778c349b05..7ad8c802d22a32d7ce417632b8e886d19c2b2e79 100644 --- a/packages/Catch2/include/internal/catch_test_registry.h +++ b/packages/Catch2/include/internal/catch_test_registry.h @@ -12,6 +12,9 @@ #include "catch_interfaces_testcase.h" #include "catch_compiler_capabilities.h" #include "catch_stringref.h" +#include "catch_type_traits.hpp" +#include "catch_preprocessor.hpp" +#include "catch_meta.hpp" namespace Catch { @@ -47,22 +50,28 @@ struct AutoReg : NonCopyable { } // end namespace Catch -#define INTERNAL_CATCH_EXPAND1(param) INTERNAL_CATCH_EXPAND2(param) -#define INTERNAL_CATCH_EXPAND2(...) INTERNAL_CATCH_NO## __VA_ARGS__ -#define INTERNAL_CATCH_DEF(...) INTERNAL_CATCH_DEF __VA_ARGS__ -#define INTERNAL_CATCH_NOINTERNAL_CATCH_DEF - #if defined(CATCH_CONFIG_DISABLE) #define INTERNAL_CATCH_TESTCASE_NO_REGISTRATION( TestName, ... ) \ static void TestName() #define INTERNAL_CATCH_TESTCASE_METHOD_NO_REGISTRATION( TestName, ClassName, ... ) \ namespace{ \ - struct TestName : INTERNAL_CATCH_EXPAND1(INTERNAL_CATCH_DEF ClassName) { \ + struct TestName : INTERNAL_CATCH_REMOVE_PARENS(ClassName) { \ void test(); \ }; \ } \ void TestName::test() - + #define INTERNAL_CATCH_TEMPLATE_TEST_CASE_NO_REGISTRATION( TestName, ... ) \ + template<typename TestType> \ + static void TestName() + #define INTERNAL_CATCH_TEMPLATE_TEST_CASE_METHOD_NO_REGISTRATION( TestName, ClassName, ... ) \ + namespace{ \ + template<typename TestType> \ + struct TestName : INTERNAL_CATCH_REMOVE_PARENS(ClassName <TestType>) { \ + void test(); \ + }; \ + } \ + template<typename TestType> \ + void TestName::test() #endif /////////////////////////////////////////////////////////////////////////////// @@ -85,7 +94,7 @@ struct AutoReg : NonCopyable { #define INTERNAL_CATCH_TEST_CASE_METHOD2( TestName, ClassName, ... )\ CATCH_INTERNAL_SUPPRESS_GLOBALS_WARNINGS \ namespace{ \ - struct TestName : INTERNAL_CATCH_EXPAND1(INTERNAL_CATCH_DEF ClassName) { \ + struct TestName : INTERNAL_CATCH_REMOVE_PARENS(ClassName) { \ void test(); \ }; \ Catch::AutoReg INTERNAL_CATCH_UNIQUE_NAME( autoRegistrar ) ( Catch::makeTestInvoker( &TestName::test ), CATCH_INTERNAL_LINEINFO, #ClassName, Catch::NameAndTags{ __VA_ARGS__ } ); /* NOLINT */ \ @@ -101,5 +110,142 @@ struct AutoReg : NonCopyable { Catch::AutoReg INTERNAL_CATCH_UNIQUE_NAME( autoRegistrar )( Catch::makeTestInvoker( Function ), CATCH_INTERNAL_LINEINFO, Catch::StringRef(), Catch::NameAndTags{ __VA_ARGS__ } ); /* NOLINT */ \ CATCH_INTERNAL_UNSUPPRESS_GLOBALS_WARNINGS + /////////////////////////////////////////////////////////////////////////////// + #define INTERNAL_CATCH_TEMPLATE_TEST_CASE_2(TestName, TestFunc, Name, Tags, ... )\ + CATCH_INTERNAL_SUPPRESS_GLOBALS_WARNINGS \ + template<typename TestType> \ + static void TestFunc();\ + namespace {\ + template<typename...Types> \ + struct TestName{\ + template<typename...Ts> \ + TestName(Ts...names){\ + CATCH_INTERNAL_CHECK_UNIQUE_TYPES(CATCH_REC_LIST(INTERNAL_CATCH_REMOVE_PARENS, __VA_ARGS__)) \ + using expander = int[];\ + (void)expander{(Catch::AutoReg( Catch::makeTestInvoker( &TestFunc<Types> ), CATCH_INTERNAL_LINEINFO, Catch::StringRef(), Catch::NameAndTags{ names, Tags } ), 0)... };/* NOLINT */ \ + }\ + };\ + INTERNAL_CATCH_TEMPLATE_REGISTRY_INITIATE(TestName, Name, __VA_ARGS__) \ + }\ + CATCH_INTERNAL_UNSUPPRESS_GLOBALS_WARNINGS \ + template<typename TestType> \ + static void TestFunc() + +#if defined(CATCH_CPP17_OR_GREATER) +#define CATCH_INTERNAL_CHECK_UNIQUE_TYPES(...) static_assert(Catch::is_unique<__VA_ARGS__>,"Duplicate type detected in declaration of template test case"); +#else +#define CATCH_INTERNAL_CHECK_UNIQUE_TYPES(...) static_assert(Catch::is_unique<__VA_ARGS__>::value,"Duplicate type detected in declaration of template test case"); +#endif + +#ifndef CATCH_CONFIG_TRADITIONAL_MSVC_PREPROCESSOR + #define INTERNAL_CATCH_TEMPLATE_TEST_CASE(Name, Tags, ...) \ + INTERNAL_CATCH_TEMPLATE_TEST_CASE_2( INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_M_P_L_A_T_E____T_E_S_T____ ), INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_M_P_L_A_T_E____T_E_S_T____F_U_N_C____ ), Name, Tags, __VA_ARGS__ ) +#else + #define INTERNAL_CATCH_TEMPLATE_TEST_CASE(Name, Tags, ...) \ + INTERNAL_CATCH_EXPAND_VARGS( INTERNAL_CATCH_TEMPLATE_TEST_CASE_2( INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_M_P_L_A_T_E____T_E_S_T____ ), INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_M_P_L_A_T_E____T_E_S_T____F_U_N_C____ ), Name, Tags, __VA_ARGS__ ) ) +#endif + + #define INTERNAL_CATCH_TEMPLATE_REGISTRY_INITIATE(TestName, Name, ...)\ + static int INTERNAL_CATCH_UNIQUE_NAME( globalRegistrar ) = [](){\ + TestName<CATCH_REC_LIST(INTERNAL_CATCH_REMOVE_PARENS, __VA_ARGS__)>(CATCH_REC_LIST_UD(INTERNAL_CATCH_TEMPLATE_UNIQUE_NAME,Name, __VA_ARGS__));\ + return 0;\ + }(); + + #define INTERNAL_CATCH_TEMPLATE_PRODUCT_TEST_CASE2(TestName, TestFuncName, Name, Tags, TmplTypes, TypesList) \ + CATCH_INTERNAL_SUPPRESS_GLOBALS_WARNINGS \ + template<typename TestType> static void TestFuncName(); \ + namespace { \ + template<typename... Types> \ + struct TestName { \ + TestName() { \ + CATCH_INTERNAL_CHECK_UNIQUE_TYPES(Types...) \ + int index = 0; \ + using expander = int[]; \ + (void)expander{(Catch::AutoReg( Catch::makeTestInvoker( &TestFuncName<Types> ), CATCH_INTERNAL_LINEINFO, Catch::StringRef(), Catch::NameAndTags{ Name " - " + Catch::StringMaker<int>::convert(index++), Tags } ), 0)... };/* NOLINT */ \ + } \ + }; \ + static int INTERNAL_CATCH_UNIQUE_NAME( globalRegistrar ) = [](){ \ + using TestInit = combine<INTERNAL_CATCH_REMOVE_PARENS(TmplTypes)> \ + ::with_types<INTERNAL_CATCH_MAKE_TYPE_LISTS_FROM_TYPES(TypesList)>::into<TestName>::type; \ + TestInit(); \ + return 0; \ + }(); \ + } \ + CATCH_INTERNAL_UNSUPPRESS_GLOBALS_WARNINGS \ + template<typename TestType> \ + static void TestFuncName() + +#ifndef CATCH_CONFIG_TRADITIONAL_MSVC_PREPROCESSOR + #define INTERNAL_CATCH_TEMPLATE_PRODUCT_TEST_CASE(Name, Tags, ...)\ + INTERNAL_CATCH_TEMPLATE_PRODUCT_TEST_CASE2(INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_M_P_L_A_T_E____T_E_S_T____ ), INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_M_P_L_A_T_E____T_E_S_T____F_U_N_C____ ),Name,Tags,__VA_ARGS__) +#else + #define INTERNAL_CATCH_TEMPLATE_PRODUCT_TEST_CASE(Name, Tags, ...)\ + INTERNAL_CATCH_EXPAND_VARGS( INTERNAL_CATCH_TEMPLATE_PRODUCT_TEST_CASE2( INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_M_P_L_A_T_E____T_E_S_T____ ), INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_M_P_L_A_T_E____T_E_S_T____F_U_N_C____ ), Name, Tags, __VA_ARGS__ ) ) +#endif + + #define INTERNAL_CATCH_TEMPLATE_TEST_CASE_METHOD_2( TestNameClass, TestName, ClassName, Name, Tags, ... ) \ + CATCH_INTERNAL_SUPPRESS_GLOBALS_WARNINGS \ + namespace{ \ + template<typename TestType> \ + struct TestName : INTERNAL_CATCH_REMOVE_PARENS(ClassName <TestType>) { \ + void test();\ + };\ + template<typename...Types> \ + struct TestNameClass{\ + template<typename...Ts> \ + TestNameClass(Ts...names){\ + CATCH_INTERNAL_CHECK_UNIQUE_TYPES(CATCH_REC_LIST(INTERNAL_CATCH_REMOVE_PARENS, __VA_ARGS__)) \ + using expander = int[];\ + (void)expander{(Catch::AutoReg( Catch::makeTestInvoker( &TestName<Types>::test ), CATCH_INTERNAL_LINEINFO, #ClassName, Catch::NameAndTags{ names, Tags } ), 0)... };/* NOLINT */ \ + }\ + };\ + INTERNAL_CATCH_TEMPLATE_REGISTRY_INITIATE(TestNameClass, Name, __VA_ARGS__)\ + }\ + CATCH_INTERNAL_UNSUPPRESS_GLOBALS_WARNINGS\ + template<typename TestType> \ + void TestName<TestType>::test() + +#ifndef CATCH_CONFIG_TRADITIONAL_MSVC_PREPROCESSOR + #define INTERNAL_CATCH_TEMPLATE_TEST_CASE_METHOD( ClassName, Name, Tags,... ) \ + INTERNAL_CATCH_TEMPLATE_TEST_CASE_METHOD_2( INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_M_P_L_A_T_E____T_E_S_T____C_L_A_S_S____ ), INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_M_P_L_A_T_E____T_E_S_T____ ) , ClassName, Name, Tags, __VA_ARGS__ ) +#else + #define INTERNAL_CATCH_TEMPLATE_TEST_CASE_METHOD( ClassName, Name, Tags,... ) \ + INTERNAL_CATCH_EXPAND_VARGS( INTERNAL_CATCH_TEMPLATE_TEST_CASE_METHOD_2( INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_M_P_L_A_T_E____T_E_S_T____C_L_A_S_S____ ), INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_M_P_L_A_T_E____T_E_S_T____ ) , ClassName, Name, Tags, __VA_ARGS__ ) ) +#endif + + #define INTERNAL_CATCH_TEMPLATE_PRODUCT_TEST_CASE_METHOD_2(TestNameClass, TestName, ClassName, Name, Tags, TmplTypes, TypesList)\ + CATCH_INTERNAL_SUPPRESS_GLOBALS_WARNINGS \ + template<typename TestType> \ + struct TestName : INTERNAL_CATCH_REMOVE_PARENS(ClassName <TestType>) { \ + void test();\ + };\ + namespace {\ + template<typename...Types>\ + struct TestNameClass{\ + TestNameClass(){\ + CATCH_INTERNAL_CHECK_UNIQUE_TYPES(Types...)\ + int index = 0;\ + using expander = int[];\ + (void)expander{(Catch::AutoReg( Catch::makeTestInvoker( &TestName<Types>::test ), CATCH_INTERNAL_LINEINFO, #ClassName, Catch::NameAndTags{ Name " - " + Catch::StringMaker<int>::convert(index++), Tags } ), 0)... };/* NOLINT */ \ + }\ + };\ + static int INTERNAL_CATCH_UNIQUE_NAME( globalRegistrar ) = [](){\ + using TestInit = combine<INTERNAL_CATCH_REMOVE_PARENS(TmplTypes)>\ + ::with_types<INTERNAL_CATCH_MAKE_TYPE_LISTS_FROM_TYPES(TypesList)>::into<TestNameClass>::type;\ + TestInit();\ + return 0;\ + }(); \ + }\ + CATCH_INTERNAL_UNSUPPRESS_GLOBALS_WARNINGS \ + template<typename TestType> \ + void TestName<TestType>::test() + +#ifndef CATCH_CONFIG_TRADITIONAL_MSVC_PREPROCESSOR + #define INTERNAL_CATCH_TEMPLATE_PRODUCT_TEST_CASE_METHOD( ClassName, Name, Tags, ... )\ + INTERNAL_CATCH_TEMPLATE_PRODUCT_TEST_CASE_METHOD_2( INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_M_P_L_A_T_E____T_E_S_T____ ), INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_M_P_L_A_T_E____T_E_S_T____F_U_N_C____ ), ClassName, Name, Tags, __VA_ARGS__ ) +#else + #define INTERNAL_CATCH_TEMPLATE_PRODUCT_TEST_CASE_METHOD( ClassName, Name, Tags, ... )\ + INTERNAL_CATCH_EXPAND_VARGS( INTERNAL_CATCH_TEMPLATE_PRODUCT_TEST_CASE_METHOD_2( INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_M_P_L_A_T_E____T_E_S_T____ ), INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_M_P_L_A_T_E____T_E_S_T____F_U_N_C____ ), ClassName, Name, Tags, __VA_ARGS__ ) ) +#endif #endif // TWOBLUECUBES_CATCH_TEST_REGISTRY_HPP_INCLUDED diff --git a/packages/Catch2/include/internal/catch_tostring.cpp b/packages/Catch2/include/internal/catch_tostring.cpp index 4e0c027d3b0e09931bd7403e0669e84b38f748fe..b857d3fbcd1ef992968377847a5f96f404fa432e 100644 --- a/packages/Catch2/include/internal/catch_tostring.cpp +++ b/packages/Catch2/include/internal/catch_tostring.cpp @@ -20,6 +20,7 @@ #include "catch_tostring.h" #include "catch_interfaces_config.h" #include "catch_context.h" +#include "catch_polyfills.hpp" #include <cmath> #include <iomanip> @@ -68,7 +69,7 @@ namespace Detail { template<typename T> std::string fpToString( T value, int precision ) { - if (std::isnan(value)) { + if (Catch::isnan(value)) { return "nan"; } @@ -205,7 +206,7 @@ std::string StringMaker<bool>::convert(bool b) { return b ? "true" : "false"; } -std::string StringMaker<char>::convert(char value) { +std::string StringMaker<signed char>::convert(signed char value) { if (value == '\r') { return "'\\r'"; } else if (value == '\f') { @@ -222,8 +223,8 @@ std::string StringMaker<char>::convert(char value) { return chstr; } } -std::string StringMaker<signed char>::convert(signed char c) { - return ::Catch::Detail::stringify(static_cast<char>(c)); +std::string StringMaker<char>::convert(char c) { + return ::Catch::Detail::stringify(static_cast<signed char>(c)); } std::string StringMaker<unsigned char>::convert(unsigned char c) { return ::Catch::Detail::stringify(static_cast<char>(c)); diff --git a/packages/Catch2/include/internal/catch_tostring.h b/packages/Catch2/include/internal/catch_tostring.h index 137d97592f9c97653ba49e97b5223d2e519b7ef6..3aff268bc312d584a520c8465fbfd07240262266 100644 --- a/packages/Catch2/include/internal/catch_tostring.h +++ b/packages/Catch2/include/internal/catch_tostring.h @@ -29,15 +29,7 @@ #pragma warning(disable:4180) // We attempt to stream a function (address) by const&, which MSVC complains about but is harmless #endif - -// We need a dummy global operator<< so we can bring it into Catch namespace later -struct Catch_global_namespace_dummy {}; -std::ostream& operator<<(std::ostream&, Catch_global_namespace_dummy); - namespace Catch { - // Bring in operator<< from global namespace into Catch namespace - using ::operator<<; - namespace Detail { extern const std::string unprintableString; diff --git a/packages/Catch2/include/internal/catch_type_traits.hpp b/packages/Catch2/include/internal/catch_type_traits.hpp new file mode 100644 index 0000000000000000000000000000000000000000..88615484bb9086eed6e3924a69d8b7a1f6282d31 --- /dev/null +++ b/packages/Catch2/include/internal/catch_type_traits.hpp @@ -0,0 +1,38 @@ +/* + * Created by Jozef on 12/11/2018. + * Copyright 2017 Two Blue Cubes Ltd. All rights reserved. + * + * Distributed under the Boost Software License, Version 1.0. (See accompanying + * file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + */ + +#ifndef TWOBLUECUBES_CATCH_TYPE_TRAITS_HPP_INCLUDED +#define TWOBLUECUBES_CATCH_TYPE_TRAITS_HPP_INCLUDED + +namespace Catch{ + +#ifdef CATCH_CPP17_OR_GREATER + template <typename...> + inline constexpr auto is_unique = std::true_type{}; + + template <typename T, typename... Rest> + inline constexpr auto is_unique<T, Rest...> = std::bool_constant< + (!std::is_same_v<T, Rest> && ...) && is_unique<Rest...> + >{}; +#else + +template <typename...> +struct is_unique : std::true_type{}; + +template <typename T0, typename T1, typename... Rest> +struct is_unique<T0, T1, Rest...> : std::integral_constant +<bool, + !std::is_same<T0, T1>::value + && is_unique<T0, Rest...>::value + && is_unique<T1, Rest...>::value +>{}; + +#endif +} + +#endif // TWOBLUECUBES_CATCH_TYPE_TRAITS_HPP_INCLUDED diff --git a/packages/Catch2/include/internal/catch_version.cpp b/packages/Catch2/include/internal/catch_version.cpp index a57553c0d0b9382e5e98eb1d91df924a1f0f186f..16887eb22a8d0c367e9010e12c68215e124e685d 100644 --- a/packages/Catch2/include/internal/catch_version.cpp +++ b/packages/Catch2/include/internal/catch_version.cpp @@ -37,7 +37,7 @@ namespace Catch { } Version const& libraryVersion() { - static Version version( 2, 4, 1, "", 0 ); + static Version version( 2, 5, 0, "", 0 ); return version; } diff --git a/packages/Catch2/include/reporters/catch_reporter_bases.cpp b/packages/Catch2/include/reporters/catch_reporter_bases.cpp index 4dd4f95dcae06f08f191ceca0bf982a4a98a2d10..fa441ee547f10a7ac194f525376a96217b2b6b35 100644 --- a/packages/Catch2/include/reporters/catch_reporter_bases.cpp +++ b/packages/Catch2/include/reporters/catch_reporter_bases.cpp @@ -30,7 +30,7 @@ namespace Catch { // + 1 for null terminator const std::size_t maxDoubleSize = DBL_MAX_10_EXP + 1 + 1 + 3 + 1; char buffer[maxDoubleSize]; - + // Save previous errno, to prevent sprintf from overwriting it ErrnoGuard guard; #ifdef _MSC_VER @@ -45,6 +45,10 @@ namespace Catch { TestEventListenerBase::TestEventListenerBase(ReporterConfig const & _config) :StreamingReporterBase(_config) {} + std::set<Verbosity> TestEventListenerBase::getSupportedVerbosities() { + return { Verbosity::Quiet, Verbosity::Normal, Verbosity::High }; + } + void TestEventListenerBase::assertionStarting(AssertionInfo const &) {} bool TestEventListenerBase::assertionEnded(AssertionStats const &) { diff --git a/packages/Catch2/include/reporters/catch_reporter_bases.hpp b/packages/Catch2/include/reporters/catch_reporter_bases.hpp index ae1618fe4150bcf830ed4cd42e2677fd1d1307de..4a27db681c4f8b77cfce8f0b9662c4a091703e06 100644 --- a/packages/Catch2/include/reporters/catch_reporter_bases.hpp +++ b/packages/Catch2/include/reporters/catch_reporter_bases.hpp @@ -217,7 +217,7 @@ namespace Catch { node->children.push_back(m_rootSection); m_testCases.push_back(node); m_rootSection.reset(); - + assert(m_deepestSection); m_deepestSection->stdOut = testCaseStats.stdOut; m_deepestSection->stdErr = testCaseStats.stdErr; @@ -266,6 +266,8 @@ namespace Catch { struct TestEventListenerBase : StreamingReporterBase<TestEventListenerBase> { TestEventListenerBase( ReporterConfig const& _config ); + static std::set<Verbosity> getSupportedVerbosities(); + void assertionStarting(AssertionInfo const&) override; bool assertionEnded(AssertionStats const&) override; }; diff --git a/packages/Catch2/include/reporters/catch_reporter_console.cpp b/packages/Catch2/include/reporters/catch_reporter_console.cpp index 54b62cd808bcbf34fbafeced15974135cfcdb0ae..500677b9caab33a422527151eeab1d3284794247 100644 --- a/packages/Catch2/include/reporters/catch_reporter_console.cpp +++ b/packages/Catch2/include/reporters/catch_reporter_console.cpp @@ -111,8 +111,6 @@ public: void print() const { printSourceInfo(); if (stats.totals.assertions.total() > 0) { - if (result.isOk()) - stream << '\n'; printResultType(); printOriginalExpression(); printReconstructedExpression(); diff --git a/packages/Catch2/include/reporters/catch_reporter_xml.cpp b/packages/Catch2/include/reporters/catch_reporter_xml.cpp index c32005370dc6652eb205cbbd14d1de030ab1bb5e..902014cf45c29d5ef519c74af9193cec12132827 100644 --- a/packages/Catch2/include/reporters/catch_reporter_xml.cpp +++ b/packages/Catch2/include/reporters/catch_reporter_xml.cpp @@ -55,6 +55,9 @@ namespace Catch { m_xml.startElement( "Catch" ); if( !m_config->name().empty() ) m_xml.writeAttribute( "name", m_config->name() ); + if( m_config->rngSeed() != 0 ) + m_xml.scopedElement( "Randomness" ) + .writeAttribute( "seed", m_config->rngSeed() ); } void XmlReporter::testGroupStarting( GroupInfo const& groupInfo ) { diff --git a/packages/Catch2/projects/CMakeLists.txt b/packages/Catch2/projects/CMakeLists.txt index 8e2e4b13eb094863e59e1a0ca0f1361aeff35e20..fbd3fd2ee2cb49b0ee0a2ea364d5b5166235c24e 100644 --- a/packages/Catch2/projects/CMakeLists.txt +++ b/packages/Catch2/projects/CMakeLists.txt @@ -118,11 +118,14 @@ set(INTERNAL_HEADERS ${HEADER_DIR}/internal/catch_matchers_string.h ${HEADER_DIR}/internal/catch_matchers_vector.h ${HEADER_DIR}/internal/catch_message.h + ${HEADER_DIR}/internal/catch_meta.hpp ${HEADER_DIR}/internal/catch_objc.hpp ${HEADER_DIR}/internal/catch_objc_arc.hpp ${HEADER_DIR}/internal/catch_option.hpp ${HEADER_DIR}/internal/catch_output_redirect.h ${HEADER_DIR}/internal/catch_platform.h + ${HEADER_DIR}/internal/catch_polyfills.hpp + ${HEADER_DIR}/internal/catch_preprocessor.hpp ${HEADER_DIR}/internal/catch_random_number_generator.h ${HEADER_DIR}/internal/catch_reenable_warnings.h ${HEADER_DIR}/internal/catch_reporter_registrars.hpp @@ -153,6 +156,7 @@ set(INTERNAL_HEADERS ${HEADER_DIR}/internal/catch_to_string.hpp ${HEADER_DIR}/internal/catch_tostring.h ${HEADER_DIR}/internal/catch_totals.h + ${HEADER_DIR}/internal/catch_type_traits.hpp ${HEADER_DIR}/internal/catch_uncaught_exceptions.h ${HEADER_DIR}/internal/catch_user_interfaces.h ${HEADER_DIR}/internal/catch_version.h @@ -196,6 +200,7 @@ set(IMPL_SOURCES ${HEADER_DIR}/internal/catch_output_redirect.cpp ${HEADER_DIR}/internal/catch_registry_hub.cpp ${HEADER_DIR}/internal/catch_interfaces_reporter.cpp + ${HEADER_DIR}/internal/catch_polyfills.cpp ${HEADER_DIR}/internal/catch_random_number_generator.cpp ${HEADER_DIR}/internal/catch_reporter_registry.cpp ${HEADER_DIR}/internal/catch_result_type.cpp @@ -303,7 +308,7 @@ if ( CMAKE_CXX_COMPILER_ID MATCHES "Clang" ) endif() if ( CMAKE_CXX_COMPILER_ID MATCHES "MSVC" ) STRING(REGEX REPLACE "/W[0-9]" "/W4" CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS}) # override default warning level - target_compile_options( SelfTest PRIVATE /w44265 /w44061 /w44062 ) + target_compile_options( SelfTest PRIVATE /w44265 /w44061 /w44062 /w45038 ) if (CATCH_ENABLE_WERROR) target_compile_options( SelfTest PRIVATE /WX) endif() diff --git a/packages/Catch2/projects/ExtraTests/X01-PrefixedMacros.cpp b/packages/Catch2/projects/ExtraTests/X01-PrefixedMacros.cpp index 08bf404fb8ca4639b38d99dff4c0ecade13dba63..7671cbc4dfefe762efaca7078501206b96df562e 100644 --- a/packages/Catch2/projects/ExtraTests/X01-PrefixedMacros.cpp +++ b/packages/Catch2/projects/ExtraTests/X01-PrefixedMacros.cpp @@ -2,8 +2,12 @@ // Test that Catch's prefixed macros compile and run properly. #define CATCH_CONFIG_MAIN +// This won't provide full coverage, but it might be worth checking +// the other branch as well +#define CATCH_CONFIG_RUNTIME_STATIC_REQUIRE #include <catch2/catch.hpp> +#include <type_traits> #include <stdexcept> [[noreturn]] @@ -23,7 +27,7 @@ CATCH_TEST_CASE("PrefixedMacros") { CATCH_REQUIRE_THROWS_WITH(this_throws(), "Some msg"); CATCH_REQUIRE_THROWS_MATCHES(this_throws(), std::runtime_error, Predicate<std::runtime_error>([](std::runtime_error const&) { return true; })); CATCH_REQUIRE_NOTHROW(this_doesnt_throw()); - + CATCH_CHECK( 1 == 1 ); CATCH_CHECK_FALSE( 1 != 1 ); CATCH_CHECKED_IF( 1 == 1 ) { @@ -31,15 +35,15 @@ CATCH_TEST_CASE("PrefixedMacros") { } CATCH_CHECKED_ELSE ( 1 == 1 ) { CATCH_SUCCEED("don't care"); } - + CATCH_CHECK_NOFAIL(1 == 2); - + CATCH_CHECK_THROWS(this_throws()); CATCH_CHECK_THROWS_AS(this_throws(), std::runtime_error); CATCH_CHECK_THROWS_WITH(this_throws(), "Some msg"); CATCH_CHECK_THROWS_MATCHES(this_throws(), std::runtime_error, Predicate<std::runtime_error>([](std::runtime_error const&) { return true; })); - CATCH_CHECK_NOTHROW(this_doesnt_throw()); - + CATCH_CHECK_NOTHROW(this_doesnt_throw()); + CATCH_REQUIRE_THAT("abcd", Equals("abcd")); CATCH_CHECK_THAT("bdef", Equals("bdef")); @@ -52,6 +56,9 @@ CATCH_TEST_CASE("PrefixedMacros") { CATCH_FAIL_CHECK( "failure" ); } } + + CATCH_STATIC_REQUIRE( std::is_void<void>::value ); + CATCH_STATIC_REQUIRE_FALSE( std::is_void<int>::value ); } CATCH_ANON_TEST_CASE() { diff --git a/packages/Catch2/projects/SelfTest/Baselines/compact.sw.approved.txt b/packages/Catch2/projects/SelfTest/Baselines/compact.sw.approved.txt index 2138d26ee9b7fe660a03371ca7bcfaa0b4c2f905..547678ceaf728571cfacbdcb3b003ad21ba52178 100644 --- a/packages/Catch2/projects/SelfTest/Baselines/compact.sw.approved.txt +++ b/packages/Catch2/projects/SelfTest/Baselines/compact.sw.approved.txt @@ -13,6 +13,7 @@ Misc.tests.cpp:<line number>: passed: Compilation.tests.cpp:<line number>: passed: std::memcmp(uarr, "123", sizeof(uarr)) == 0 for: 0 == 0 with 2 messages: 'uarr := "123"' and 'sarr := "456"' Compilation.tests.cpp:<line number>: passed: std::memcmp(sarr, "456", sizeof(sarr)) == 0 for: 0 == 0 with 2 messages: 'uarr := "123"' and 'sarr := "456"' Compilation.tests.cpp:<line number>: passed: +Compilation.tests.cpp:<line number>: passed: h1 == h2 for: [1403 helper] == [1403 helper] Exception.tests.cpp:<line number>: failed: unexpected exception with message: 'answer := 42' with 1 message: 'expected exception' Exception.tests.cpp:<line number>: failed: unexpected exception with message: 'answer := 42'; expression was: thisThrows() with 1 message: 'expected exception' Exception.tests.cpp:<line number>: passed: thisThrows() with 1 message: 'answer := 42' @@ -158,8 +159,26 @@ Generators.tests.cpp:<line number>: passed: x < y for: 10 < 109 Generators.tests.cpp:<line number>: passed: x < y for: 10 < 110 Class.tests.cpp:<line number>: failed: s == "world" for: "hello" == "world" Class.tests.cpp:<line number>: passed: s == "hello" for: "hello" == "hello" +Class.tests.cpp:<line number>: failed: Template_Fixture_2<TestType>::m_a.size() == 1 for: 0 == 1 +Class.tests.cpp:<line number>: failed: Template_Fixture_2<TestType>::m_a.size() == 1 for: 0 == 1 +Class.tests.cpp:<line number>: failed: Template_Fixture_2<TestType>::m_a.size() == 1 for: 0 == 1 +Class.tests.cpp:<line number>: failed: Template_Fixture_2<TestType>::m_a.size() == 1 for: 0 == 1 +Class.tests.cpp:<line number>: passed: Template_Fixture_2<TestType>::m_a.size() == 0 for: 0 == 0 +Class.tests.cpp:<line number>: passed: Template_Fixture_2<TestType>::m_a.size() == 0 for: 0 == 0 +Class.tests.cpp:<line number>: passed: Template_Fixture_2<TestType>::m_a.size() == 0 for: 0 == 0 +Class.tests.cpp:<line number>: passed: Template_Fixture_2<TestType>::m_a.size() == 0 for: 0 == 0 +Class.tests.cpp:<line number>: failed: Template_Fixture<TestType>::m_a == 2 for: 1.0 == 2 +Class.tests.cpp:<line number>: failed: Template_Fixture<TestType>::m_a == 2 for: 1.0f == 2 +Class.tests.cpp:<line number>: failed: Template_Fixture<TestType>::m_a == 2 for: 1 == 2 +Class.tests.cpp:<line number>: passed: Template_Fixture<TestType>::m_a == 1 for: 1.0 == 1 +Class.tests.cpp:<line number>: passed: Template_Fixture<TestType>::m_a == 1 for: 1.0f == 1 +Class.tests.cpp:<line number>: passed: Template_Fixture<TestType>::m_a == 1 for: 1 == 1 Class.tests.cpp:<line number>: failed: m_a == 2 for: 1 == 2 Class.tests.cpp:<line number>: passed: m_a == 1 for: 1 == 1 +Misc.tests.cpp:<line number>: passed: x.size() == 0 for: 0 == 0 +Misc.tests.cpp:<line number>: passed: x.size() == 0 for: 0 == 0 +Misc.tests.cpp:<line number>: passed: x.size() == 0 for: 0 == 0 +Misc.tests.cpp:<line number>: passed: x.size() == 0 for: 0 == 0 Approx.tests.cpp:<line number>: passed: d == 1.23_a for: 1.23 == Approx( 1.23 ) Approx.tests.cpp:<line number>: passed: d != 1.22_a for: 1.23 != Approx( 1.22 ) Approx.tests.cpp:<line number>: passed: -d == -1.23_a for: -1.23 == Approx( -1.23 ) @@ -221,18 +240,20 @@ Approx.tests.cpp:<line number>: passed: NAN != Approx(NAN) for: nanf != Approx( Approx.tests.cpp:<line number>: passed: !(NAN == Approx(NAN)) for: !(nanf == Approx( nan )) Tricky.tests.cpp:<line number>: passed: y.v == 0 for: 0 == 0 Tricky.tests.cpp:<line number>: passed: 0 == y.v for: 0 == 0 +Message.tests.cpp:<line number>: passed: with 7 messages: 'a := 1' and 'b := 2' and 'c := 3' and 'a + b := 3' and 'a+b := 3' and 'c > b := true' and 'a == 1 := true' +Message.tests.cpp:<line number>: passed: with 7 messages: 'std::vector<int>{1, 2, 3}[0, 1, 2] := 3' and 'std::vector<int>{1, 2, 3}[(0, 1)] := 2' and 'std::vector<int>{1, 2, 3}[0] := 1' and '(helper_1436<int, int>{12, -12}) := { 12, -12 }' and '(helper_1436<int, int>(-12, 12)) := { -12, 12 }' and '(1, 2) := 2' and '(2, 3) := 3' ToStringGeneral.tests.cpp:<line number>: passed: true with 1 message: 'i := 2' ToStringGeneral.tests.cpp:<line number>: passed: true with 1 message: '3' -ToStringGeneral.tests.cpp:<line number>: passed: tab == '/t' for: '/t' == '/t' -ToStringGeneral.tests.cpp:<line number>: passed: newline == '/n' for: '/n' == '/n' -ToStringGeneral.tests.cpp:<line number>: passed: carr_return == '/r' for: '/r' == '/r' -ToStringGeneral.tests.cpp:<line number>: passed: form_feed == '/f' for: '/f' == '/f' +ToStringGeneral.tests.cpp:<line number>: passed: tab == '\t' for: '\t' == '\t' +ToStringGeneral.tests.cpp:<line number>: passed: newline == '\n' for: '\n' == '\n' +ToStringGeneral.tests.cpp:<line number>: passed: carr_return == '\r' for: '\r' == '\r' +ToStringGeneral.tests.cpp:<line number>: passed: form_feed == '\f' for: '\f' == '\f' ToStringGeneral.tests.cpp:<line number>: passed: space == ' ' for: ' ' == ' ' ToStringGeneral.tests.cpp:<line number>: passed: c == chars[i] for: 'a' == 'a' ToStringGeneral.tests.cpp:<line number>: passed: c == chars[i] for: 'z' == 'z' ToStringGeneral.tests.cpp:<line number>: passed: c == chars[i] for: 'A' == 'A' ToStringGeneral.tests.cpp:<line number>: passed: c == chars[i] for: 'Z' == 'Z' -ToStringGeneral.tests.cpp:<line number>: passed: null_terminator == '/0' for: 0 == 0 +ToStringGeneral.tests.cpp:<line number>: passed: null_terminator == '\0' for: 0 == 0 ToStringGeneral.tests.cpp:<line number>: passed: c == i for: 2 == 2 ToStringGeneral.tests.cpp:<line number>: passed: c == i for: 3 == 3 ToStringGeneral.tests.cpp:<line number>: passed: c == i for: 4 == 4 @@ -495,6 +516,8 @@ Exception.tests.cpp:<line number>: failed: unexpected exception with message: 'c Tricky.tests.cpp:<line number>: passed: True for: {?} Tricky.tests.cpp:<line number>: passed: !False for: true Tricky.tests.cpp:<line number>: passed: !(False) for: !{?} +Compilation.tests.cpp:<line number>: passed: with 1 message: 'std::is_void<void>::value' +Compilation.tests.cpp:<line number>: passed: with 1 message: '!(std::is_void<int>::value)' Condition.tests.cpp:<line number>: failed: data.int_seven > 7 for: 7 > 7 Condition.tests.cpp:<line number>: failed: data.int_seven < 7 for: 7 < 7 Condition.tests.cpp:<line number>: failed: data.int_seven > 8 for: 7 > 8 @@ -676,6 +699,7 @@ Condition.tests.cpp:<line number>: passed: cpc != 0 for: 0x<hex digits> != 0 Condition.tests.cpp:<line number>: passed: returnsNull() == 0 for: {null string} == 0 Condition.tests.cpp:<line number>: passed: returnsConstNull() == 0 for: {null string} == 0 Condition.tests.cpp:<line number>: passed: 0 != p for: 0 != 0x<hex digits> +Matchers.tests.cpp:<line number>: passed: "foo", Predicate<const char*>([] (const char* const&) { return true; }) for: "foo" matches undescribed predicate CmdLine.tests.cpp:<line number>: passed: result for: {?} CmdLine.tests.cpp:<line number>: passed: config.processName == "" for: "" == "" CmdLine.tests.cpp:<line number>: passed: result for: {?} @@ -704,6 +728,8 @@ CmdLine.tests.cpp:<line number>: passed: config.reporterName == "xml" for: "xml" CmdLine.tests.cpp:<line number>: passed: cli.parse({"test", "--reporter", "junit"}) for: {?} CmdLine.tests.cpp:<line number>: passed: config.reporterName == "junit" for: "junit" == "junit" CmdLine.tests.cpp:<line number>: passed: !(cli.parse({ "test", "-r", "xml", "-r", "junit" })) for: !{?} +CmdLine.tests.cpp:<line number>: passed: !result for: true +CmdLine.tests.cpp:<line number>: passed: result.errorMessage(), Contains("Unrecognized reporter") for: "Unrecognized reporter, 'unsupported'. Check available with --list-reporters" contains: "Unrecognized reporter" CmdLine.tests.cpp:<line number>: passed: cli.parse({"test", "-b"}) for: {?} CmdLine.tests.cpp:<line number>: passed: config.shouldDebugBreak == true for: true == true CmdLine.tests.cpp:<line number>: passed: cli.parse({"test", "--break"}) for: {?} @@ -736,6 +762,9 @@ CmdLine.tests.cpp:<line number>: passed: cli.parse({"test", "--use-colour", "no" CmdLine.tests.cpp:<line number>: passed: config.useColour == UseColour::No for: 2 == 2 CmdLine.tests.cpp:<line number>: passed: !result for: true CmdLine.tests.cpp:<line number>: passed: result.errorMessage(), Contains( "colour mode must be one of" ) for: "colour mode must be one of: auto, yes or no. 'wrong' not recognised" contains: "colour mode must be one of" +Misc.tests.cpp:<line number>: passed: std::tuple_size<TestType>::value >= 1 for: 1 >= 1 +Misc.tests.cpp:<line number>: passed: std::tuple_size<TestType>::value >= 1 for: 2 >= 1 +Misc.tests.cpp:<line number>: passed: std::tuple_size<TestType>::value >= 1 for: 3 >= 1 Decomposition.tests.cpp:<line number>: failed: truthy(false) for: Hey, its truthy! Matchers.tests.cpp:<line number>: failed: testStringForMatching(), Matches("this STRING contains 'abc' as a substring") for: "this string contains 'abc' as a substring" matches "this STRING contains 'abc' as a substring" case sensitively Matchers.tests.cpp:<line number>: failed: testStringForMatching(), Matches("contains 'abc' as a substring") for: "this string contains 'abc' as a substring" matches "contains 'abc' as a substring" case sensitively @@ -865,6 +894,74 @@ TagAlias.tests.cpp:<line number>: passed: registry.add( "[no ampersat]", "", Cat TagAlias.tests.cpp:<line number>: passed: registry.add( "[the @ is not at the start]", "", Catch::SourceLineInfo( "file", 3 ) ) TagAlias.tests.cpp:<line number>: passed: registry.add( "@no square bracket at start]", "", Catch::SourceLineInfo( "file", 3 ) ) TagAlias.tests.cpp:<line number>: passed: registry.add( "[@no square bracket at end", "", Catch::SourceLineInfo( "file", 3 ) ) +Misc.tests.cpp:<line number>: passed: v.size() == 5 for: 5 == 5 +Misc.tests.cpp:<line number>: passed: v.capacity() >= 5 for: 5 >= 5 +Misc.tests.cpp:<line number>: passed: v.size() == 10 for: 10 == 10 +Misc.tests.cpp:<line number>: passed: v.capacity() >= 10 for: 10 >= 10 +Misc.tests.cpp:<line number>: passed: v.size() == 5 for: 5 == 5 +Misc.tests.cpp:<line number>: passed: v.capacity() >= 5 for: 5 >= 5 +Misc.tests.cpp:<line number>: passed: v.size() == 0 for: 0 == 0 +Misc.tests.cpp:<line number>: passed: v.capacity() >= 5 for: 5 >= 5 +Misc.tests.cpp:<line number>: passed: v.capacity() == 0 for: 0 == 0 +Misc.tests.cpp:<line number>: passed: v.size() == 5 for: 5 == 5 +Misc.tests.cpp:<line number>: passed: v.capacity() >= 5 for: 5 >= 5 +Misc.tests.cpp:<line number>: passed: v.size() == 5 for: 5 == 5 +Misc.tests.cpp:<line number>: passed: v.capacity() >= 10 for: 10 >= 10 +Misc.tests.cpp:<line number>: passed: v.size() == 5 for: 5 == 5 +Misc.tests.cpp:<line number>: passed: v.capacity() >= 5 for: 5 >= 5 +Misc.tests.cpp:<line number>: passed: v.size() == 5 for: 5 == 5 +Misc.tests.cpp:<line number>: passed: v.capacity() >= 5 for: 5 >= 5 +Misc.tests.cpp:<line number>: passed: v.size() == 5 for: 5 == 5 +Misc.tests.cpp:<line number>: passed: v.capacity() >= 5 for: 5 >= 5 +Misc.tests.cpp:<line number>: passed: v.size() == 10 for: 10 == 10 +Misc.tests.cpp:<line number>: passed: v.capacity() >= 10 for: 10 >= 10 +Misc.tests.cpp:<line number>: passed: v.size() == 5 for: 5 == 5 +Misc.tests.cpp:<line number>: passed: v.capacity() >= 5 for: 5 >= 5 +Misc.tests.cpp:<line number>: passed: v.size() == 0 for: 0 == 0 +Misc.tests.cpp:<line number>: passed: v.capacity() >= 5 for: 5 >= 5 +Misc.tests.cpp:<line number>: passed: v.capacity() == 0 for: 0 == 0 +Misc.tests.cpp:<line number>: passed: v.size() == 5 for: 5 == 5 +Misc.tests.cpp:<line number>: passed: v.capacity() >= 5 for: 5 >= 5 +Misc.tests.cpp:<line number>: passed: v.size() == 5 for: 5 == 5 +Misc.tests.cpp:<line number>: passed: v.capacity() >= 10 for: 10 >= 10 +Misc.tests.cpp:<line number>: passed: v.size() == 5 for: 5 == 5 +Misc.tests.cpp:<line number>: passed: v.capacity() >= 5 for: 5 >= 5 +Misc.tests.cpp:<line number>: passed: v.size() == 5 for: 5 == 5 +Misc.tests.cpp:<line number>: passed: v.capacity() >= 5 for: 5 >= 5 +Misc.tests.cpp:<line number>: passed: v.size() == 5 for: 5 == 5 +Misc.tests.cpp:<line number>: passed: v.capacity() >= 5 for: 5 >= 5 +Misc.tests.cpp:<line number>: passed: v.size() == 10 for: 10 == 10 +Misc.tests.cpp:<line number>: passed: v.capacity() >= 10 for: 10 >= 10 +Misc.tests.cpp:<line number>: passed: v.size() == 5 for: 5 == 5 +Misc.tests.cpp:<line number>: passed: v.capacity() >= 5 for: 5 >= 5 +Misc.tests.cpp:<line number>: passed: v.size() == 0 for: 0 == 0 +Misc.tests.cpp:<line number>: passed: v.capacity() >= 5 for: 5 >= 5 +Misc.tests.cpp:<line number>: passed: v.capacity() == 0 for: 0 == 0 +Misc.tests.cpp:<line number>: passed: v.size() == 5 for: 5 == 5 +Misc.tests.cpp:<line number>: passed: v.capacity() >= 5 for: 5 >= 5 +Misc.tests.cpp:<line number>: passed: v.size() == 5 for: 5 == 5 +Misc.tests.cpp:<line number>: passed: v.capacity() >= 10 for: 10 >= 10 +Misc.tests.cpp:<line number>: passed: v.size() == 5 for: 5 == 5 +Misc.tests.cpp:<line number>: passed: v.capacity() >= 5 for: 5 >= 5 +Misc.tests.cpp:<line number>: passed: v.size() == 5 for: 5 == 5 +Misc.tests.cpp:<line number>: passed: v.capacity() >= 5 for: 5 >= 5 +Misc.tests.cpp:<line number>: passed: v.size() == 5 for: 5 == 5 +Misc.tests.cpp:<line number>: passed: v.capacity() >= 5 for: 5 >= 5 +Misc.tests.cpp:<line number>: passed: v.size() == 10 for: 10 == 10 +Misc.tests.cpp:<line number>: passed: v.capacity() >= 10 for: 10 >= 10 +Misc.tests.cpp:<line number>: passed: v.size() == 5 for: 5 == 5 +Misc.tests.cpp:<line number>: passed: v.capacity() >= 5 for: 5 >= 5 +Misc.tests.cpp:<line number>: passed: v.size() == 0 for: 0 == 0 +Misc.tests.cpp:<line number>: passed: v.capacity() >= 5 for: 5 >= 5 +Misc.tests.cpp:<line number>: passed: v.capacity() == 0 for: 0 == 0 +Misc.tests.cpp:<line number>: passed: v.size() == 5 for: 5 == 5 +Misc.tests.cpp:<line number>: passed: v.capacity() >= 5 for: 5 >= 5 +Misc.tests.cpp:<line number>: passed: v.size() == 5 for: 5 == 5 +Misc.tests.cpp:<line number>: passed: v.capacity() >= 10 for: 10 >= 10 +Misc.tests.cpp:<line number>: passed: v.size() == 5 for: 5 == 5 +Misc.tests.cpp:<line number>: passed: v.capacity() >= 5 for: 5 >= 5 +Misc.tests.cpp:<line number>: passed: v.size() == 5 for: 5 == 5 +Misc.tests.cpp:<line number>: passed: v.capacity() >= 5 for: 5 >= 5 VariadicMacros.tests.cpp:<line number>: passed: with 1 message: 'no assertions' Tricky.tests.cpp:<line number>: passed: 0x<hex digits> == bit30and31 for: 3221225472 (0x<hex digits>) == 3221225472 Message.tests.cpp:<line number>: failed - but was ok: 1 == 2 @@ -1064,50 +1161,50 @@ Xml.tests.cpp:<line number>: passed: encode( stringWithQuotes ) == stringWithQuo Xml.tests.cpp:<line number>: passed: encode( stringWithQuotes, Catch::XmlEncode::ForAttributes ) == "don't "quote" me on that" for: "don't "quote" me on that" == "don't "quote" me on that" -Xml.tests.cpp:<line number>: passed: encode( "[/x01]" ) == "[//x01]" for: "[/x01]" == "[/x01]" -Xml.tests.cpp:<line number>: passed: encode( "[/x7F]" ) == "[//x7F]" for: "[/x7F]" == "[/x7F]" +Xml.tests.cpp:<line number>: passed: encode( "[\x01]" ) == "[\\x01]" for: "[\x01]" == "[\x01]" +Xml.tests.cpp:<line number>: passed: encode( "[\x7F]" ) == "[\\x7F]" for: "[\x7F]" == "[\x7F]" Xml.tests.cpp:<line number>: passed: encode(u8"Here be 👾") == u8"Here be 👾" for: "Here be 👾" == "Here be 👾" Xml.tests.cpp:<line number>: passed: encode(u8"šš") == u8"šš" for: "šš" == "šš" -Xml.tests.cpp:<line number>: passed: encode("/xDF/xBF") == "/xDF/xBF" for: "߿" == "߿" -Xml.tests.cpp:<line number>: passed: encode("/xE0/xA0/x80") == "/xE0/xA0/x80" for: "ࠀ" == "ࠀ" -Xml.tests.cpp:<line number>: passed: encode("/xED/x9F/xBF") == "/xED/x9F/xBF" for: "" == "" -Xml.tests.cpp:<line number>: passed: encode("/xEE/x80/x80") == "/xEE/x80/x80" for: "" == "" -Xml.tests.cpp:<line number>: passed: encode("/xEF/xBF/xBF") == "/xEF/xBF/xBF" for: "" == "" -Xml.tests.cpp:<line number>: passed: encode("/xF0/x90/x80/x80") == "/xF0/x90/x80/x80" for: "𐀀" == "𐀀" -Xml.tests.cpp:<line number>: passed: encode("/xF4/x8F/xBF/xBF") == "/xF4/x8F/xBF/xBF" for: "" == "" -Xml.tests.cpp:<line number>: passed: encode("Here /xFF be 👾") == u8"Here //xFF be 👾" for: "Here /xFF be 👾" == "Here /xFF be 👾" -Xml.tests.cpp:<line number>: passed: encode("/xFF") == "//xFF" for: "/xFF" == "/xFF" -Xml.tests.cpp:<line number>: passed: encode("/xC5/xC5/xA0") == u8"//xC5Š" for: "/xC5Š" == "/xC5Š" -Xml.tests.cpp:<line number>: passed: encode("/xF4/x90/x80/x80") == u8"//xF4//x90//x80//x80" for: "/xF4/x90/x80/x80" == "/xF4/x90/x80/x80" -Xml.tests.cpp:<line number>: passed: encode("/xC0/x80") == u8"//xC0//x80" for: "/xC0/x80" == "/xC0/x80" -Xml.tests.cpp:<line number>: passed: encode("/xF0/x80/x80/x80") == u8"//xF0//x80//x80//x80" for: "/xF0/x80/x80/x80" == "/xF0/x80/x80/x80" -Xml.tests.cpp:<line number>: passed: encode("/xC1/xBF") == u8"//xC1//xBF" for: "/xC1/xBF" == "/xC1/xBF" -Xml.tests.cpp:<line number>: passed: encode("/xE0/x9F/xBF") == u8"//xE0//x9F//xBF" for: "/xE0/x9F/xBF" == "/xE0/x9F/xBF" -Xml.tests.cpp:<line number>: passed: encode("/xF0/x8F/xBF/xBF") == u8"//xF0//x8F//xBF//xBF" for: "/xF0/x8F/xBF/xBF" == "/xF0/x8F/xBF/xBF" -Xml.tests.cpp:<line number>: passed: encode("/xED/xA0/x80") == "/xED/xA0/x80" for: "���" == "���" -Xml.tests.cpp:<line number>: passed: encode("/xED/xAF/xBF") == "/xED/xAF/xBF" for: "���" == "���" -Xml.tests.cpp:<line number>: passed: encode("/xED/xB0/x80") == "/xED/xB0/x80" for: "���" == "���" -Xml.tests.cpp:<line number>: passed: encode("/xED/xBF/xBF") == "/xED/xBF/xBF" for: "���" == "���" -Xml.tests.cpp:<line number>: passed: encode("/x80") == u8"//x80" for: "/x80" == "/x80" -Xml.tests.cpp:<line number>: passed: encode("/x81") == u8"//x81" for: "/x81" == "/x81" -Xml.tests.cpp:<line number>: passed: encode("/xBC") == u8"//xBC" for: "/xBC" == "/xBC" -Xml.tests.cpp:<line number>: passed: encode("/xBF") == u8"//xBF" for: "/xBF" == "/xBF" -Xml.tests.cpp:<line number>: passed: encode("/xF5/x80/x80/x80") == u8"//xF5//x80//x80//x80" for: "/xF5/x80/x80/x80" == "/xF5/x80/x80/x80" -Xml.tests.cpp:<line number>: passed: encode("/xF6/x80/x80/x80") == u8"//xF6//x80//x80//x80" for: "/xF6/x80/x80/x80" == "/xF6/x80/x80/x80" -Xml.tests.cpp:<line number>: passed: encode("/xF7/x80/x80/x80") == u8"//xF7//x80//x80//x80" for: "/xF7/x80/x80/x80" == "/xF7/x80/x80/x80" -Xml.tests.cpp:<line number>: passed: encode("/xDE") == u8"//xDE" for: "/xDE" == "/xDE" -Xml.tests.cpp:<line number>: passed: encode("/xDF") == u8"//xDF" for: "/xDF" == "/xDF" -Xml.tests.cpp:<line number>: passed: encode("/xE0") == u8"//xE0" for: "/xE0" == "/xE0" -Xml.tests.cpp:<line number>: passed: encode("/xEF") == u8"//xEF" for: "/xEF" == "/xEF" -Xml.tests.cpp:<line number>: passed: encode("/xF0") == u8"//xF0" for: "/xF0" == "/xF0" -Xml.tests.cpp:<line number>: passed: encode("/xF4") == u8"//xF4" for: "/xF4" == "/xF4" -Xml.tests.cpp:<line number>: passed: encode("/xE0/x80") == u8"//xE0//x80" for: "/xE0/x80" == "/xE0/x80" -Xml.tests.cpp:<line number>: passed: encode("/xE0/xBF") == u8"//xE0//xBF" for: "/xE0/xBF" == "/xE0/xBF" -Xml.tests.cpp:<line number>: passed: encode("/xE1/x80") == u8"//xE1//x80" for: "/xE1/x80" == "/xE1/x80" -Xml.tests.cpp:<line number>: passed: encode("/xF0/x80") == u8"//xF0//x80" for: "/xF0/x80" == "/xF0/x80" -Xml.tests.cpp:<line number>: passed: encode("/xF4/x80") == u8"//xF4//x80" for: "/xF4/x80" == "/xF4/x80" -Xml.tests.cpp:<line number>: passed: encode("/xF0/x80/x80") == u8"//xF0//x80//x80" for: "/xF0/x80/x80" == "/xF0/x80/x80" -Xml.tests.cpp:<line number>: passed: encode("/xF4/x80/x80") == u8"//xF4//x80//x80" for: "/xF4/x80/x80" == "/xF4/x80/x80" +Xml.tests.cpp:<line number>: passed: encode("\xDF\xBF") == "\xDF\xBF" for: "߿" == "߿" +Xml.tests.cpp:<line number>: passed: encode("\xE0\xA0\x80") == "\xE0\xA0\x80" for: "ࠀ" == "ࠀ" +Xml.tests.cpp:<line number>: passed: encode("\xED\x9F\xBF") == "\xED\x9F\xBF" for: "" == "" +Xml.tests.cpp:<line number>: passed: encode("\xEE\x80\x80") == "\xEE\x80\x80" for: "" == "" +Xml.tests.cpp:<line number>: passed: encode("\xEF\xBF\xBF") == "\xEF\xBF\xBF" for: "" == "" +Xml.tests.cpp:<line number>: passed: encode("\xF0\x90\x80\x80") == "\xF0\x90\x80\x80" for: "𐀀" == "𐀀" +Xml.tests.cpp:<line number>: passed: encode("\xF4\x8F\xBF\xBF") == "\xF4\x8F\xBF\xBF" for: "" == "" +Xml.tests.cpp:<line number>: passed: encode("Here \xFF be 👾") == u8"Here \\xFF be 👾" for: "Here \xFF be 👾" == "Here \xFF be 👾" +Xml.tests.cpp:<line number>: passed: encode("\xFF") == "\\xFF" for: "\xFF" == "\xFF" +Xml.tests.cpp:<line number>: passed: encode("\xC5\xC5\xA0") == u8"\\xC5Š" for: "\xC5Š" == "\xC5Š" +Xml.tests.cpp:<line number>: passed: encode("\xF4\x90\x80\x80") == u8"\\xF4\\x90\\x80\\x80" for: "\xF4\x90\x80\x80" == "\xF4\x90\x80\x80" +Xml.tests.cpp:<line number>: passed: encode("\xC0\x80") == u8"\\xC0\\x80" for: "\xC0\x80" == "\xC0\x80" +Xml.tests.cpp:<line number>: passed: encode("\xF0\x80\x80\x80") == u8"\\xF0\\x80\\x80\\x80" for: "\xF0\x80\x80\x80" == "\xF0\x80\x80\x80" +Xml.tests.cpp:<line number>: passed: encode("\xC1\xBF") == u8"\\xC1\\xBF" for: "\xC1\xBF" == "\xC1\xBF" +Xml.tests.cpp:<line number>: passed: encode("\xE0\x9F\xBF") == u8"\\xE0\\x9F\\xBF" for: "\xE0\x9F\xBF" == "\xE0\x9F\xBF" +Xml.tests.cpp:<line number>: passed: encode("\xF0\x8F\xBF\xBF") == u8"\\xF0\\x8F\\xBF\\xBF" for: "\xF0\x8F\xBF\xBF" == "\xF0\x8F\xBF\xBF" +Xml.tests.cpp:<line number>: passed: encode("\xED\xA0\x80") == "\xED\xA0\x80" for: "���" == "���" +Xml.tests.cpp:<line number>: passed: encode("\xED\xAF\xBF") == "\xED\xAF\xBF" for: "���" == "���" +Xml.tests.cpp:<line number>: passed: encode("\xED\xB0\x80") == "\xED\xB0\x80" for: "���" == "���" +Xml.tests.cpp:<line number>: passed: encode("\xED\xBF\xBF") == "\xED\xBF\xBF" for: "���" == "���" +Xml.tests.cpp:<line number>: passed: encode("\x80") == u8"\\x80" for: "\x80" == "\x80" +Xml.tests.cpp:<line number>: passed: encode("\x81") == u8"\\x81" for: "\x81" == "\x81" +Xml.tests.cpp:<line number>: passed: encode("\xBC") == u8"\\xBC" for: "\xBC" == "\xBC" +Xml.tests.cpp:<line number>: passed: encode("\xBF") == u8"\\xBF" for: "\xBF" == "\xBF" +Xml.tests.cpp:<line number>: passed: encode("\xF5\x80\x80\x80") == u8"\\xF5\\x80\\x80\\x80" for: "\xF5\x80\x80\x80" == "\xF5\x80\x80\x80" +Xml.tests.cpp:<line number>: passed: encode("\xF6\x80\x80\x80") == u8"\\xF6\\x80\\x80\\x80" for: "\xF6\x80\x80\x80" == "\xF6\x80\x80\x80" +Xml.tests.cpp:<line number>: passed: encode("\xF7\x80\x80\x80") == u8"\\xF7\\x80\\x80\\x80" for: "\xF7\x80\x80\x80" == "\xF7\x80\x80\x80" +Xml.tests.cpp:<line number>: passed: encode("\xDE") == u8"\\xDE" for: "\xDE" == "\xDE" +Xml.tests.cpp:<line number>: passed: encode("\xDF") == u8"\\xDF" for: "\xDF" == "\xDF" +Xml.tests.cpp:<line number>: passed: encode("\xE0") == u8"\\xE0" for: "\xE0" == "\xE0" +Xml.tests.cpp:<line number>: passed: encode("\xEF") == u8"\\xEF" for: "\xEF" == "\xEF" +Xml.tests.cpp:<line number>: passed: encode("\xF0") == u8"\\xF0" for: "\xF0" == "\xF0" +Xml.tests.cpp:<line number>: passed: encode("\xF4") == u8"\\xF4" for: "\xF4" == "\xF4" +Xml.tests.cpp:<line number>: passed: encode("\xE0\x80") == u8"\\xE0\\x80" for: "\xE0\x80" == "\xE0\x80" +Xml.tests.cpp:<line number>: passed: encode("\xE0\xBF") == u8"\\xE0\\xBF" for: "\xE0\xBF" == "\xE0\xBF" +Xml.tests.cpp:<line number>: passed: encode("\xE1\x80") == u8"\\xE1\\x80" for: "\xE1\x80" == "\xE1\x80" +Xml.tests.cpp:<line number>: passed: encode("\xF0\x80") == u8"\\xF0\\x80" for: "\xF0\x80" == "\xF0\x80" +Xml.tests.cpp:<line number>: passed: encode("\xF4\x80") == u8"\\xF4\\x80" for: "\xF4\x80" == "\xF4\x80" +Xml.tests.cpp:<line number>: passed: encode("\xF0\x80\x80") == u8"\\xF0\\x80\\x80" for: "\xF0\x80\x80" == "\xF0\x80\x80" +Xml.tests.cpp:<line number>: passed: encode("\xF4\x80\x80") == u8"\\xF4\\x80\\x80" for: "\xF4\x80\x80" == "\xF4\x80\x80" ToStringVector.tests.cpp:<line number>: passed: Catch::Detail::stringify( empty ) == "{ }" for: "{ }" == "{ }" ToStringVector.tests.cpp:<line number>: passed: Catch::Detail::stringify( oneValue ) == "{ 42 }" for: "{ 42 }" == "{ 42 }" ToStringVector.tests.cpp:<line number>: passed: Catch::Detail::stringify( twoValues ) == "{ 42, 250 }" for: "{ 42, 250 }" == "{ 42, 250 }" @@ -1167,7 +1264,7 @@ Misc.tests.cpp:<line number>: passed: Misc.tests.cpp:<line number>: passed: makeString( false ) != static_cast<char*>(0) for: "valid string" != {null string} Misc.tests.cpp:<line number>: passed: makeString( true ) == static_cast<char*>(0) for: {null string} == {null string} Tricky.tests.cpp:<line number>: passed: ptr.get() == 0 for: 0 == 0 -ToStringPair.tests.cpp:<line number>: passed: ::Catch::Detail::stringify( pair ) == "{ { 42, /"Arthur/" }, { /"Ford/", 24 } }" for: "{ { 42, "Arthur" }, { "Ford", 24 } }" +ToStringPair.tests.cpp:<line number>: passed: ::Catch::Detail::stringify( pair ) == "{ { 42, \"Arthur\" }, { \"Ford\", 24 } }" for: "{ { 42, "Arthur" }, { "Ford", 24 } }" == "{ { 42, "Arthur" }, { "Ford", 24 } }" Tricky.tests.cpp:<line number>: passed: p == 0 for: 0 == 0 @@ -1191,18 +1288,18 @@ String.tests.cpp:<line number>: passed: s == "didn|'t" for: "didn|'t" == "didn|' Misc.tests.cpp:<line number>: failed: false with 1 message: '3' Message.tests.cpp:<line number>: failed: false with 2 messages: 'hi' and 'i := 7' ToStringGeneral.tests.cpp:<line number>: passed: Catch::Detail::stringify( emptyMap ) == "{ }" for: "{ }" == "{ }" -ToStringGeneral.tests.cpp:<line number>: passed: Catch::Detail::stringify( map ) == "{ { /"one/", 1 } }" for: "{ { "one", 1 } }" == "{ { "one", 1 } }" -ToStringGeneral.tests.cpp:<line number>: passed: Catch::Detail::stringify( map ) == "{ { /"abc/", 1 }, { /"def/", 2 }, { /"ghi/", 3 } }" for: "{ { "abc", 1 }, { "def", 2 }, { "ghi", 3 } }" +ToStringGeneral.tests.cpp:<line number>: passed: Catch::Detail::stringify( map ) == "{ { \"one\", 1 } }" for: "{ { "one", 1 } }" == "{ { "one", 1 } }" +ToStringGeneral.tests.cpp:<line number>: passed: Catch::Detail::stringify( map ) == "{ { \"abc\", 1 }, { \"def\", 2 }, { \"ghi\", 3 } }" for: "{ { "abc", 1 }, { "def", 2 }, { "ghi", 3 } }" == "{ { "abc", 1 }, { "def", 2 }, { "ghi", 3 } }" -ToStringPair.tests.cpp:<line number>: passed: ::Catch::Detail::stringify(value) == "{ 34, /"xyzzy/" }" for: "{ 34, "xyzzy" }" == "{ 34, "xyzzy" }" -ToStringPair.tests.cpp:<line number>: passed: ::Catch::Detail::stringify( value ) == "{ 34, /"xyzzy/" }" for: "{ 34, "xyzzy" }" == "{ 34, "xyzzy" }" +ToStringPair.tests.cpp:<line number>: passed: ::Catch::Detail::stringify(value) == "{ 34, \"xyzzy\" }" for: "{ 34, "xyzzy" }" == "{ 34, "xyzzy" }" +ToStringPair.tests.cpp:<line number>: passed: ::Catch::Detail::stringify( value ) == "{ 34, \"xyzzy\" }" for: "{ 34, "xyzzy" }" == "{ 34, "xyzzy" }" ToStringGeneral.tests.cpp:<line number>: passed: Catch::Detail::stringify( emptySet ) == "{ }" for: "{ }" == "{ }" -ToStringGeneral.tests.cpp:<line number>: passed: Catch::Detail::stringify( set ) == "{ /"one/" }" for: "{ "one" }" == "{ "one" }" -ToStringGeneral.tests.cpp:<line number>: passed: Catch::Detail::stringify( set ) == "{ /"abc/", /"def/", /"ghi/" }" for: "{ "abc", "def", "ghi" }" +ToStringGeneral.tests.cpp:<line number>: passed: Catch::Detail::stringify( set ) == "{ \"one\" }" for: "{ "one" }" == "{ "one" }" +ToStringGeneral.tests.cpp:<line number>: passed: Catch::Detail::stringify( set ) == "{ \"abc\", \"def\", \"ghi\" }" for: "{ "abc", "def", "ghi" }" == "{ "abc", "def", "ghi" }" -ToStringPair.tests.cpp:<line number>: passed: ::Catch::Detail::stringify( pr ) == "{ { /"green/", 55 } }" for: "{ { "green", 55 } }" +ToStringPair.tests.cpp:<line number>: passed: ::Catch::Detail::stringify( pr ) == "{ { \"green\", 55 } }" for: "{ { "green", 55 } }" == "{ { "green", 55 } }" Tricky.tests.cpp:<line number>: failed: std::string( "first" ) == "second" for: "first" == "second" @@ -1241,10 +1338,10 @@ Generators.tests.cpp:<line number>: passed: data.str.size() == data.len for: 3 = Generators.tests.cpp:<line number>: passed: data.str.size() == data.len for: 5 == 5 Generators.tests.cpp:<line number>: passed: data.str.size() == data.len for: 4 == 4 Exception.tests.cpp:<line number>: failed: unexpected exception with message: 'Why would you throw a std::string?' -Misc.tests.cpp:<line number>: passed: result == "/"wide load/"" for: ""wide load"" == ""wide load"" -Misc.tests.cpp:<line number>: passed: result == "/"wide load/"" for: ""wide load"" == ""wide load"" -Misc.tests.cpp:<line number>: passed: result == "/"wide load/"" for: ""wide load"" == ""wide load"" -Misc.tests.cpp:<line number>: passed: result == "/"wide load/"" for: ""wide load"" == ""wide load"" +Misc.tests.cpp:<line number>: passed: result == "\"wide load\"" for: ""wide load"" == ""wide load"" +Misc.tests.cpp:<line number>: passed: result == "\"wide load\"" for: ""wide load"" == ""wide load"" +Misc.tests.cpp:<line number>: passed: result == "\"wide load\"" for: ""wide load"" == ""wide load"" +Misc.tests.cpp:<line number>: passed: result == "\"wide load\"" for: ""wide load"" == ""wide load"" EnumToString.tests.cpp:<line number>: passed: ::Catch::Detail::stringify(e0) == "E2/V0" for: "E2/V0" == "E2/V0" EnumToString.tests.cpp:<line number>: passed: ::Catch::Detail::stringify(e1) == "E2/V1" for: "E2/V1" == "E2/V1" EnumToString.tests.cpp:<line number>: passed: ::Catch::Detail::stringify(e3) == "Unknown enum value 10" for: "Unknown enum value 10" @@ -1261,17 +1358,17 @@ ToStringTuple.tests.cpp:<line number>: passed: "{ }" == ::Catch::Detail::stringi ToStringTuple.tests.cpp:<line number>: passed: "1.2f" == ::Catch::Detail::stringify(float(1.2)) for: "1.2f" == "1.2f" ToStringTuple.tests.cpp:<line number>: passed: "{ 1.2f, 0 }" == ::Catch::Detail::stringify(type{1.2f,0}) for: "{ 1.2f, 0 }" == "{ 1.2f, 0 }" ToStringTuple.tests.cpp:<line number>: passed: "{ 0 }" == ::Catch::Detail::stringify(type{0}) for: "{ 0 }" == "{ 0 }" -ToStringTuple.tests.cpp:<line number>: passed: "{ 0, 42, /"Catch me/" }" == ::Catch::Detail::stringify(value) for: "{ 0, 42, "Catch me" }" +ToStringTuple.tests.cpp:<line number>: passed: "{ 0, 42, \"Catch me\" }" == ::Catch::Detail::stringify(value) for: "{ 0, 42, "Catch me" }" == "{ 0, 42, "Catch me" }" -ToStringTuple.tests.cpp:<line number>: passed: "{ /"hello/", /"world/" }" == ::Catch::Detail::stringify(type{"hello","world"}) for: "{ "hello", "world" }" +ToStringTuple.tests.cpp:<line number>: passed: "{ \"hello\", \"world\" }" == ::Catch::Detail::stringify(type{"hello","world"}) for: "{ "hello", "world" }" == "{ "hello", "world" }" ToStringTuple.tests.cpp:<line number>: passed: "{ { 42 }, { }, 1.2f }" == ::Catch::Detail::stringify(value) for: "{ { 42 }, { }, 1.2f }" == "{ { 42 }, { }, 1.2f }" ToStringVector.tests.cpp:<line number>: passed: ::Catch::Detail::stringify(v) == "{ }" for: "{ }" == "{ }" -ToStringVector.tests.cpp:<line number>: passed: ::Catch::Detail::stringify(v) == "{ { /"hello/" }, { /"world/" } }" for: "{ { "hello" }, { "world" } }" +ToStringVector.tests.cpp:<line number>: passed: ::Catch::Detail::stringify(v) == "{ { \"hello\" }, { \"world\" } }" for: "{ { "hello" }, { "world" } }" == "{ { "hello" }, { "world" } }" ToStringVector.tests.cpp:<line number>: passed: ::Catch::Detail::stringify(bools) == "{ }" for: "{ }" == "{ }" @@ -1284,8 +1381,8 @@ ToStringVector.tests.cpp:<line number>: passed: ::Catch::Detail::stringify(vv) = ToStringVector.tests.cpp:<line number>: passed: ::Catch::Detail::stringify(vv) == "{ 42 }" for: "{ 42 }" == "{ 42 }" ToStringVector.tests.cpp:<line number>: passed: ::Catch::Detail::stringify(vv) == "{ 42, 250 }" for: "{ 42, 250 }" == "{ 42, 250 }" ToStringVector.tests.cpp:<line number>: passed: ::Catch::Detail::stringify(vv) == "{ }" for: "{ }" == "{ }" -ToStringVector.tests.cpp:<line number>: passed: ::Catch::Detail::stringify(vv) == "{ /"hello/" }" for: "{ "hello" }" == "{ "hello" }" -ToStringVector.tests.cpp:<line number>: passed: ::Catch::Detail::stringify(vv) == "{ /"hello/", /"world/" }" for: "{ "hello", "world" }" +ToStringVector.tests.cpp:<line number>: passed: ::Catch::Detail::stringify(vv) == "{ \"hello\" }" for: "{ "hello" }" == "{ "hello" }" +ToStringVector.tests.cpp:<line number>: passed: ::Catch::Detail::stringify(vv) == "{ \"hello\", \"world\" }" for: "{ "hello", "world" }" == "{ "hello", "world" }" Misc.tests.cpp:<line number>: passed: v.size() == 5 for: 5 == 5 @@ -1307,5 +1404,5 @@ Misc.tests.cpp:<line number>: passed: v.size() == 5 for: 5 == 5 Misc.tests.cpp:<line number>: passed: v.capacity() >= 5 for: 5 >= 5 Misc.tests.cpp:<line number>: passed: Misc.tests.cpp:<line number>: passed: -Failed 62 test cases, failed 122 assertions. +Failed 69 test cases, failed 129 assertions. diff --git a/packages/Catch2/projects/SelfTest/Baselines/console.std.approved.txt b/packages/Catch2/projects/SelfTest/Baselines/console.std.approved.txt index 24755c802bbc3872813830ba0df7385d00aa1ea1..df483fda232e171c514b161fa33c2cee525a8545 100644 --- a/packages/Catch2/projects/SelfTest/Baselines/console.std.approved.txt +++ b/packages/Catch2/projects/SelfTest/Baselines/console.std.approved.txt @@ -3,6 +3,8 @@ <exe-name> is a <version> host application. Run with -? for options +Randomness seeded to: 1 + ------------------------------------------------------------------------------- #748 - captures with unexpected exceptions outside assertions @@ -90,6 +92,83 @@ Class.tests.cpp:<line number>: FAILED: with expansion: "hello" == "world" +------------------------------------------------------------------------------- +A TEMPLATE_PRODUCT_TEST_CASE_METHOD based test run that fails - 0 +------------------------------------------------------------------------------- +Class.tests.cpp:<line number> +............................................................................... + +Class.tests.cpp:<line number>: FAILED: + REQUIRE( Template_Fixture_2<TestType>::m_a.size() == 1 ) +with expansion: + 0 == 1 + +------------------------------------------------------------------------------- +A TEMPLATE_PRODUCT_TEST_CASE_METHOD based test run that fails - 1 +------------------------------------------------------------------------------- +Class.tests.cpp:<line number> +............................................................................... + +Class.tests.cpp:<line number>: FAILED: + REQUIRE( Template_Fixture_2<TestType>::m_a.size() == 1 ) +with expansion: + 0 == 1 + +------------------------------------------------------------------------------- +A TEMPLATE_PRODUCT_TEST_CASE_METHOD based test run that fails - 2 +------------------------------------------------------------------------------- +Class.tests.cpp:<line number> +............................................................................... + +Class.tests.cpp:<line number>: FAILED: + REQUIRE( Template_Fixture_2<TestType>::m_a.size() == 1 ) +with expansion: + 0 == 1 + +------------------------------------------------------------------------------- +A TEMPLATE_PRODUCT_TEST_CASE_METHOD based test run that fails - 3 +------------------------------------------------------------------------------- +Class.tests.cpp:<line number> +............................................................................... + +Class.tests.cpp:<line number>: FAILED: + REQUIRE( Template_Fixture_2<TestType>::m_a.size() == 1 ) +with expansion: + 0 == 1 + +------------------------------------------------------------------------------- +A TEMPLATE_TEST_CASE_METHOD based test run that fails - double +------------------------------------------------------------------------------- +Class.tests.cpp:<line number> +............................................................................... + +Class.tests.cpp:<line number>: FAILED: + REQUIRE( Template_Fixture<TestType>::m_a == 2 ) +with expansion: + 1.0 == 2 + +------------------------------------------------------------------------------- +A TEMPLATE_TEST_CASE_METHOD based test run that fails - float +------------------------------------------------------------------------------- +Class.tests.cpp:<line number> +............................................................................... + +Class.tests.cpp:<line number>: FAILED: + REQUIRE( Template_Fixture<TestType>::m_a == 2 ) +with expansion: + 1.0f == 2 + +------------------------------------------------------------------------------- +A TEMPLATE_TEST_CASE_METHOD based test run that fails - int +------------------------------------------------------------------------------- +Class.tests.cpp:<line number> +............................................................................... + +Class.tests.cpp:<line number>: FAILED: + REQUIRE( Template_Fixture<TestType>::m_a == 2 ) +with expansion: + 1 == 2 + ------------------------------------------------------------------------------- A TEST_CASE_METHOD based test run that fails ------------------------------------------------------------------------------- @@ -390,8 +469,7 @@ Message.tests.cpp:<line number>: FAILED: explicitly with message: This is a failure -Message.tests.cpp:<line number>: -warning: +Message.tests.cpp:<line number>: warning: This message appears in the output ------------------------------------------------------------------------------- @@ -400,8 +478,7 @@ INFO and WARN do not abort tests Message.tests.cpp:<line number> ............................................................................... -Message.tests.cpp:<line number>: -warning: +Message.tests.cpp:<line number>: warning: this is a warning ------------------------------------------------------------------------------- @@ -526,8 +603,7 @@ Nice descriptive name Misc.tests.cpp:<line number> ............................................................................... -Misc.tests.cpp:<line number>: -warning: +Misc.tests.cpp:<line number>: warning: This one ran ------------------------------------------------------------------------------- @@ -907,8 +983,7 @@ Where the LHS is not a simple value Tricky.tests.cpp:<line number> ............................................................................... -Tricky.tests.cpp:<line number>: -warning: +Tricky.tests.cpp:<line number>: warning: Uncomment the code in this test to check that it gives a sensible compiler error @@ -918,8 +993,7 @@ Where there is more to the expression after the RHS Tricky.tests.cpp:<line number> ............................................................................... -Tricky.tests.cpp:<line number>: -warning: +Tricky.tests.cpp:<line number>: warning: Uncomment the code in this test to check that it gives a sensible compiler error @@ -1096,6 +1170,6 @@ due to unexpected exception with message: Why would you throw a std::string? =============================================================================== -test cases: 213 | 160 passed | 49 failed | 4 failed as expected -assertions: 1228 | 1099 passed | 108 failed | 21 failed as expected +test cases: 243 | 183 passed | 56 failed | 4 failed as expected +assertions: 1325 | 1189 passed | 115 failed | 21 failed as expected diff --git a/packages/Catch2/projects/SelfTest/Baselines/console.sw.approved.txt b/packages/Catch2/projects/SelfTest/Baselines/console.sw.approved.txt index 27fa5c59db610747d3a9125fc215bf64e1e89d2e..7069d0b12606c221550cb25ba4e58b915bc56191 100644 --- a/packages/Catch2/projects/SelfTest/Baselines/console.sw.approved.txt +++ b/packages/Catch2/projects/SelfTest/Baselines/console.sw.approved.txt @@ -3,14 +3,15 @@ <exe-name> is a <version> host application. Run with -? for options +Randomness seeded to: 1 + ------------------------------------------------------------------------------- # A test name that starts with a # ------------------------------------------------------------------------------- Misc.tests.cpp:<line number> ............................................................................... -Misc.tests.cpp:<line number>: -PASSED: +Misc.tests.cpp:<line number>: PASSED: with message: yay @@ -21,14 +22,12 @@ with message: Decomposition.tests.cpp:<line number> ............................................................................... -Decomposition.tests.cpp:<line number>: -PASSED: +Decomposition.tests.cpp:<line number>: PASSED: REQUIRE( fptr == 0 ) with expansion: 0 == 0 -Decomposition.tests.cpp:<line number>: -PASSED: +Decomposition.tests.cpp:<line number>: PASSED: REQUIRE( fptr == 0l ) with expansion: 0 == 0 @@ -39,14 +38,12 @@ with expansion: Compilation.tests.cpp:<line number> ............................................................................... -Compilation.tests.cpp:<line number>: -PASSED: +Compilation.tests.cpp:<line number>: PASSED: REQUIRE( y.v == 0 ) with expansion: 0 == 0 -Compilation.tests.cpp:<line number>: -PASSED: +Compilation.tests.cpp:<line number>: PASSED: REQUIRE( 0 == y.v ) with expansion: 0 == 0 @@ -57,38 +54,32 @@ with expansion: Compilation.tests.cpp:<line number> ............................................................................... -Compilation.tests.cpp:<line number>: -PASSED: +Compilation.tests.cpp:<line number>: PASSED: REQUIRE( t1 == t2 ) with expansion: {?} == {?} -Compilation.tests.cpp:<line number>: -PASSED: +Compilation.tests.cpp:<line number>: PASSED: REQUIRE( t1 != t2 ) with expansion: {?} != {?} -Compilation.tests.cpp:<line number>: -PASSED: +Compilation.tests.cpp:<line number>: PASSED: REQUIRE( t1 < t2 ) with expansion: {?} < {?} -Compilation.tests.cpp:<line number>: -PASSED: +Compilation.tests.cpp:<line number>: PASSED: REQUIRE( t1 > t2 ) with expansion: {?} > {?} -Compilation.tests.cpp:<line number>: -PASSED: +Compilation.tests.cpp:<line number>: PASSED: REQUIRE( t1 <= t2 ) with expansion: {?} <= {?} -Compilation.tests.cpp:<line number>: -PASSED: +Compilation.tests.cpp:<line number>: PASSED: REQUIRE( t1 >= t2 ) with expansion: {?} >= {?} @@ -99,8 +90,7 @@ with expansion: Misc.tests.cpp:<line number> ............................................................................... -Misc.tests.cpp:<line number>: -PASSED: +Misc.tests.cpp:<line number>: PASSED: ------------------------------------------------------------------------------- #1238 @@ -108,8 +98,7 @@ PASSED: Compilation.tests.cpp:<line number> ............................................................................... -Compilation.tests.cpp:<line number>: -PASSED: +Compilation.tests.cpp:<line number>: PASSED: REQUIRE( std::memcmp(uarr, "123", sizeof(uarr)) == 0 ) with expansion: 0 == 0 @@ -117,8 +106,7 @@ with messages: uarr := "123" sarr := "456" -Compilation.tests.cpp:<line number>: -PASSED: +Compilation.tests.cpp:<line number>: PASSED: REQUIRE( std::memcmp(sarr, "456", sizeof(sarr)) == 0 ) with expansion: 0 == 0 @@ -132,8 +120,18 @@ with messages: Compilation.tests.cpp:<line number> ............................................................................... -Compilation.tests.cpp:<line number>: -PASSED: +Compilation.tests.cpp:<line number>: PASSED: + +------------------------------------------------------------------------------- +#1403 +------------------------------------------------------------------------------- +Compilation.tests.cpp:<line number> +............................................................................... + +Compilation.tests.cpp:<line number>: PASSED: + REQUIRE( h1 == h2 ) +with expansion: + [1403 helper] == [1403 helper] ------------------------------------------------------------------------------- #748 - captures with unexpected exceptions @@ -167,8 +165,7 @@ due to unexpected exception with messages: Exception.tests.cpp:<line number> ............................................................................... -Exception.tests.cpp:<line number>: -PASSED: +Exception.tests.cpp:<line number>: PASSED: REQUIRE_THROWS( thisThrows() ) with message: answer := 42 @@ -179,8 +176,7 @@ with message: Compilation.tests.cpp:<line number> ............................................................................... -Compilation.tests.cpp:<line number>: -PASSED: +Compilation.tests.cpp:<line number>: PASSED: REQUIRE( 42 == f ) with expansion: 42 == {?} @@ -191,38 +187,31 @@ with expansion: Compilation.tests.cpp:<line number> ............................................................................... -Compilation.tests.cpp:<line number>: -PASSED: +Compilation.tests.cpp:<line number>: PASSED: REQUIRE( a == t ) with expansion: 3 == 3 -Compilation.tests.cpp:<line number>: -PASSED: +Compilation.tests.cpp:<line number>: PASSED: CHECK( a == t ) with expansion: 3 == 3 -Compilation.tests.cpp:<line number>: -PASSED: +Compilation.tests.cpp:<line number>: PASSED: REQUIRE_THROWS( throws_int(true) ) -Compilation.tests.cpp:<line number>: -PASSED: +Compilation.tests.cpp:<line number>: PASSED: CHECK_THROWS_AS( throws_int(true), int ) -Compilation.tests.cpp:<line number>: -PASSED: +Compilation.tests.cpp:<line number>: PASSED: REQUIRE_NOTHROW( throws_int(false) ) -Compilation.tests.cpp:<line number>: -PASSED: +Compilation.tests.cpp:<line number>: PASSED: REQUIRE_THAT( "aaa", Catch::EndsWith("aaa") ) with expansion: "aaa" ends with: "aaa" -Compilation.tests.cpp:<line number>: -PASSED: +Compilation.tests.cpp:<line number>: PASSED: REQUIRE( templated_tests<int>(3) ) with expansion: true @@ -238,8 +227,7 @@ Misc.tests.cpp:<line number>: FAILED: with expansion: 1 == 0 -Misc.tests.cpp:<line number>: -PASSED: +Misc.tests.cpp:<line number>: PASSED: REQUIRE( errno == 1 ) with expansion: 1 == 1 @@ -250,8 +238,7 @@ with expansion: Compilation.tests.cpp:<line number> ............................................................................... -Compilation.tests.cpp:<line number>: -PASSED: +Compilation.tests.cpp:<line number>: PASSED: REQUIRE( x == 4 ) with expansion: {?} == 4 @@ -265,8 +252,7 @@ with message: Misc.tests.cpp:<line number> ............................................................................... -Misc.tests.cpp:<line number>: -PASSED: +Misc.tests.cpp:<line number>: PASSED: with message: Everything is OK @@ -277,8 +263,7 @@ with message: Misc.tests.cpp:<line number> ............................................................................... -Misc.tests.cpp:<line number>: -PASSED: +Misc.tests.cpp:<line number>: PASSED: with message: Everything is OK @@ -289,8 +274,7 @@ with message: Misc.tests.cpp:<line number> ............................................................................... -Misc.tests.cpp:<line number>: -PASSED: +Misc.tests.cpp:<line number>: PASSED: with message: Everything is OK @@ -301,8 +285,7 @@ with message: Misc.tests.cpp:<line number> ............................................................................... -Misc.tests.cpp:<line number>: -PASSED: +Misc.tests.cpp:<line number>: PASSED: with message: Everything is OK @@ -313,8 +296,7 @@ with message: Misc.tests.cpp:<line number> ............................................................................... -Misc.tests.cpp:<line number>: -PASSED: +Misc.tests.cpp:<line number>: PASSED: with message: Everything is OK @@ -364,46 +346,38 @@ Condition.tests.cpp:<line number>: FAILED: Condition.tests.cpp:<line number> ............................................................................... -Condition.tests.cpp:<line number>: -PASSED: +Condition.tests.cpp:<line number>: PASSED: REQUIRE( false == false ) -Condition.tests.cpp:<line number>: -PASSED: +Condition.tests.cpp:<line number>: PASSED: REQUIRE( true == true ) -Condition.tests.cpp:<line number>: -PASSED: +Condition.tests.cpp:<line number>: PASSED: REQUIRE( !false ) with expansion: true -Condition.tests.cpp:<line number>: -PASSED: +Condition.tests.cpp:<line number>: PASSED: REQUIRE_FALSE( false ) with expansion: !false -Condition.tests.cpp:<line number>: -PASSED: +Condition.tests.cpp:<line number>: PASSED: REQUIRE( !falseValue ) with expansion: true -Condition.tests.cpp:<line number>: -PASSED: +Condition.tests.cpp:<line number>: PASSED: REQUIRE_FALSE( falseValue ) with expansion: !false -Condition.tests.cpp:<line number>: -PASSED: +Condition.tests.cpp:<line number>: PASSED: REQUIRE( !(1 == 2) ) with expansion: true -Condition.tests.cpp:<line number>: -PASSED: +Condition.tests.cpp:<line number>: PASSED: REQUIRE_FALSE( 1 == 2 ) ------------------------------------------------------------------------------- @@ -413,14 +387,12 @@ PASSED: Tricky.tests.cpp:<line number> ............................................................................... -Tricky.tests.cpp:<line number>: -PASSED: +Tricky.tests.cpp:<line number>: PASSED: REQUIRE( is_true<true>::value == true ) with expansion: true == true -Tricky.tests.cpp:<line number>: -PASSED: +Tricky.tests.cpp:<line number>: PASSED: REQUIRE( true == is_true<true>::value ) with expansion: true == true @@ -432,14 +404,12 @@ with expansion: Tricky.tests.cpp:<line number> ............................................................................... -Tricky.tests.cpp:<line number>: -PASSED: +Tricky.tests.cpp:<line number>: PASSED: REQUIRE( is_true<false>::value == false ) with expansion: false == false -Tricky.tests.cpp:<line number>: -PASSED: +Tricky.tests.cpp:<line number>: PASSED: REQUIRE( false == is_true<false>::value ) with expansion: false == false @@ -451,8 +421,7 @@ with expansion: Tricky.tests.cpp:<line number> ............................................................................... -Tricky.tests.cpp:<line number>: -PASSED: +Tricky.tests.cpp:<line number>: PASSED: REQUIRE( !is_true<false>::value ) with expansion: true @@ -464,8 +433,7 @@ with expansion: Tricky.tests.cpp:<line number> ............................................................................... -Tricky.tests.cpp:<line number>: -PASSED: +Tricky.tests.cpp:<line number>: PASSED: REQUIRE( !!is_true<true>::value ) with expansion: true @@ -477,14 +445,12 @@ with expansion: Tricky.tests.cpp:<line number> ............................................................................... -Tricky.tests.cpp:<line number>: -PASSED: +Tricky.tests.cpp:<line number>: PASSED: REQUIRE( is_true<true>::value ) with expansion: true -Tricky.tests.cpp:<line number>: -PASSED: +Tricky.tests.cpp:<line number>: PASSED: REQUIRE_FALSE( is_true<false>::value ) with expansion: !false @@ -495,8 +461,7 @@ with expansion: Generators.tests.cpp:<line number> ............................................................................... -Generators.tests.cpp:<line number>: -PASSED: +Generators.tests.cpp:<line number>: PASSED: CHECK( x < y ) with expansion: 1 < 101 @@ -507,8 +472,7 @@ with expansion: Generators.tests.cpp:<line number> ............................................................................... -Generators.tests.cpp:<line number>: -PASSED: +Generators.tests.cpp:<line number>: PASSED: CHECK( x < y ) with expansion: 1 < 102 @@ -519,8 +483,7 @@ with expansion: Generators.tests.cpp:<line number> ............................................................................... -Generators.tests.cpp:<line number>: -PASSED: +Generators.tests.cpp:<line number>: PASSED: CHECK( x < y ) with expansion: 1 < 103 @@ -531,8 +494,7 @@ with expansion: Generators.tests.cpp:<line number> ............................................................................... -Generators.tests.cpp:<line number>: -PASSED: +Generators.tests.cpp:<line number>: PASSED: CHECK( x < y ) with expansion: 1 < 104 @@ -543,8 +505,7 @@ with expansion: Generators.tests.cpp:<line number> ............................................................................... -Generators.tests.cpp:<line number>: -PASSED: +Generators.tests.cpp:<line number>: PASSED: CHECK( x < y ) with expansion: 1 < 105 @@ -555,8 +516,7 @@ with expansion: Generators.tests.cpp:<line number> ............................................................................... -Generators.tests.cpp:<line number>: -PASSED: +Generators.tests.cpp:<line number>: PASSED: CHECK( x < y ) with expansion: 1 < 106 @@ -567,8 +527,7 @@ with expansion: Generators.tests.cpp:<line number> ............................................................................... -Generators.tests.cpp:<line number>: -PASSED: +Generators.tests.cpp:<line number>: PASSED: CHECK( x < y ) with expansion: 1 < 107 @@ -579,8 +538,7 @@ with expansion: Generators.tests.cpp:<line number> ............................................................................... -Generators.tests.cpp:<line number>: -PASSED: +Generators.tests.cpp:<line number>: PASSED: CHECK( x < y ) with expansion: 1 < 108 @@ -591,8 +549,7 @@ with expansion: Generators.tests.cpp:<line number> ............................................................................... -Generators.tests.cpp:<line number>: -PASSED: +Generators.tests.cpp:<line number>: PASSED: CHECK( x < y ) with expansion: 1 < 109 @@ -603,8 +560,7 @@ with expansion: Generators.tests.cpp:<line number> ............................................................................... -Generators.tests.cpp:<line number>: -PASSED: +Generators.tests.cpp:<line number>: PASSED: CHECK( x < y ) with expansion: 1 < 110 @@ -615,8 +571,7 @@ with expansion: Generators.tests.cpp:<line number> ............................................................................... -Generators.tests.cpp:<line number>: -PASSED: +Generators.tests.cpp:<line number>: PASSED: CHECK( x < y ) with expansion: 2 < 101 @@ -627,8 +582,7 @@ with expansion: Generators.tests.cpp:<line number> ............................................................................... -Generators.tests.cpp:<line number>: -PASSED: +Generators.tests.cpp:<line number>: PASSED: CHECK( x < y ) with expansion: 2 < 102 @@ -639,8 +593,7 @@ with expansion: Generators.tests.cpp:<line number> ............................................................................... -Generators.tests.cpp:<line number>: -PASSED: +Generators.tests.cpp:<line number>: PASSED: CHECK( x < y ) with expansion: 2 < 103 @@ -651,8 +604,7 @@ with expansion: Generators.tests.cpp:<line number> ............................................................................... -Generators.tests.cpp:<line number>: -PASSED: +Generators.tests.cpp:<line number>: PASSED: CHECK( x < y ) with expansion: 2 < 104 @@ -663,8 +615,7 @@ with expansion: Generators.tests.cpp:<line number> ............................................................................... -Generators.tests.cpp:<line number>: -PASSED: +Generators.tests.cpp:<line number>: PASSED: CHECK( x < y ) with expansion: 2 < 105 @@ -675,8 +626,7 @@ with expansion: Generators.tests.cpp:<line number> ............................................................................... -Generators.tests.cpp:<line number>: -PASSED: +Generators.tests.cpp:<line number>: PASSED: CHECK( x < y ) with expansion: 2 < 106 @@ -687,8 +637,7 @@ with expansion: Generators.tests.cpp:<line number> ............................................................................... -Generators.tests.cpp:<line number>: -PASSED: +Generators.tests.cpp:<line number>: PASSED: CHECK( x < y ) with expansion: 2 < 107 @@ -699,8 +648,7 @@ with expansion: Generators.tests.cpp:<line number> ............................................................................... -Generators.tests.cpp:<line number>: -PASSED: +Generators.tests.cpp:<line number>: PASSED: CHECK( x < y ) with expansion: 2 < 108 @@ -711,8 +659,7 @@ with expansion: Generators.tests.cpp:<line number> ............................................................................... -Generators.tests.cpp:<line number>: -PASSED: +Generators.tests.cpp:<line number>: PASSED: CHECK( x < y ) with expansion: 2 < 109 @@ -723,8 +670,7 @@ with expansion: Generators.tests.cpp:<line number> ............................................................................... -Generators.tests.cpp:<line number>: -PASSED: +Generators.tests.cpp:<line number>: PASSED: CHECK( x < y ) with expansion: 2 < 110 @@ -735,8 +681,7 @@ with expansion: Generators.tests.cpp:<line number> ............................................................................... -Generators.tests.cpp:<line number>: -PASSED: +Generators.tests.cpp:<line number>: PASSED: CHECK( x < y ) with expansion: 3 < 101 @@ -747,8 +692,7 @@ with expansion: Generators.tests.cpp:<line number> ............................................................................... -Generators.tests.cpp:<line number>: -PASSED: +Generators.tests.cpp:<line number>: PASSED: CHECK( x < y ) with expansion: 3 < 102 @@ -759,8 +703,7 @@ with expansion: Generators.tests.cpp:<line number> ............................................................................... -Generators.tests.cpp:<line number>: -PASSED: +Generators.tests.cpp:<line number>: PASSED: CHECK( x < y ) with expansion: 3 < 103 @@ -771,8 +714,7 @@ with expansion: Generators.tests.cpp:<line number> ............................................................................... -Generators.tests.cpp:<line number>: -PASSED: +Generators.tests.cpp:<line number>: PASSED: CHECK( x < y ) with expansion: 3 < 104 @@ -783,8 +725,7 @@ with expansion: Generators.tests.cpp:<line number> ............................................................................... -Generators.tests.cpp:<line number>: -PASSED: +Generators.tests.cpp:<line number>: PASSED: CHECK( x < y ) with expansion: 3 < 105 @@ -795,8 +736,7 @@ with expansion: Generators.tests.cpp:<line number> ............................................................................... -Generators.tests.cpp:<line number>: -PASSED: +Generators.tests.cpp:<line number>: PASSED: CHECK( x < y ) with expansion: 3 < 106 @@ -807,8 +747,7 @@ with expansion: Generators.tests.cpp:<line number> ............................................................................... -Generators.tests.cpp:<line number>: -PASSED: +Generators.tests.cpp:<line number>: PASSED: CHECK( x < y ) with expansion: 3 < 107 @@ -819,8 +758,7 @@ with expansion: Generators.tests.cpp:<line number> ............................................................................... -Generators.tests.cpp:<line number>: -PASSED: +Generators.tests.cpp:<line number>: PASSED: CHECK( x < y ) with expansion: 3 < 108 @@ -831,8 +769,7 @@ with expansion: Generators.tests.cpp:<line number> ............................................................................... -Generators.tests.cpp:<line number>: -PASSED: +Generators.tests.cpp:<line number>: PASSED: CHECK( x < y ) with expansion: 3 < 109 @@ -843,8 +780,7 @@ with expansion: Generators.tests.cpp:<line number> ............................................................................... -Generators.tests.cpp:<line number>: -PASSED: +Generators.tests.cpp:<line number>: PASSED: CHECK( x < y ) with expansion: 3 < 110 @@ -855,8 +791,7 @@ with expansion: Generators.tests.cpp:<line number> ............................................................................... -Generators.tests.cpp:<line number>: -PASSED: +Generators.tests.cpp:<line number>: PASSED: CHECK( x < y ) with expansion: 4 < 101 @@ -867,8 +802,7 @@ with expansion: Generators.tests.cpp:<line number> ............................................................................... -Generators.tests.cpp:<line number>: -PASSED: +Generators.tests.cpp:<line number>: PASSED: CHECK( x < y ) with expansion: 4 < 102 @@ -879,8 +813,7 @@ with expansion: Generators.tests.cpp:<line number> ............................................................................... -Generators.tests.cpp:<line number>: -PASSED: +Generators.tests.cpp:<line number>: PASSED: CHECK( x < y ) with expansion: 4 < 103 @@ -891,8 +824,7 @@ with expansion: Generators.tests.cpp:<line number> ............................................................................... -Generators.tests.cpp:<line number>: -PASSED: +Generators.tests.cpp:<line number>: PASSED: CHECK( x < y ) with expansion: 4 < 104 @@ -903,8 +835,7 @@ with expansion: Generators.tests.cpp:<line number> ............................................................................... -Generators.tests.cpp:<line number>: -PASSED: +Generators.tests.cpp:<line number>: PASSED: CHECK( x < y ) with expansion: 4 < 105 @@ -915,8 +846,7 @@ with expansion: Generators.tests.cpp:<line number> ............................................................................... -Generators.tests.cpp:<line number>: -PASSED: +Generators.tests.cpp:<line number>: PASSED: CHECK( x < y ) with expansion: 4 < 106 @@ -927,8 +857,7 @@ with expansion: Generators.tests.cpp:<line number> ............................................................................... -Generators.tests.cpp:<line number>: -PASSED: +Generators.tests.cpp:<line number>: PASSED: CHECK( x < y ) with expansion: 4 < 107 @@ -939,8 +868,7 @@ with expansion: Generators.tests.cpp:<line number> ............................................................................... -Generators.tests.cpp:<line number>: -PASSED: +Generators.tests.cpp:<line number>: PASSED: CHECK( x < y ) with expansion: 4 < 108 @@ -951,8 +879,7 @@ with expansion: Generators.tests.cpp:<line number> ............................................................................... -Generators.tests.cpp:<line number>: -PASSED: +Generators.tests.cpp:<line number>: PASSED: CHECK( x < y ) with expansion: 4 < 109 @@ -963,8 +890,7 @@ with expansion: Generators.tests.cpp:<line number> ............................................................................... -Generators.tests.cpp:<line number>: -PASSED: +Generators.tests.cpp:<line number>: PASSED: CHECK( x < y ) with expansion: 4 < 110 @@ -975,8 +901,7 @@ with expansion: Generators.tests.cpp:<line number> ............................................................................... -Generators.tests.cpp:<line number>: -PASSED: +Generators.tests.cpp:<line number>: PASSED: CHECK( x < y ) with expansion: 5 < 101 @@ -987,8 +912,7 @@ with expansion: Generators.tests.cpp:<line number> ............................................................................... -Generators.tests.cpp:<line number>: -PASSED: +Generators.tests.cpp:<line number>: PASSED: CHECK( x < y ) with expansion: 5 < 102 @@ -999,8 +923,7 @@ with expansion: Generators.tests.cpp:<line number> ............................................................................... -Generators.tests.cpp:<line number>: -PASSED: +Generators.tests.cpp:<line number>: PASSED: CHECK( x < y ) with expansion: 5 < 103 @@ -1011,8 +934,7 @@ with expansion: Generators.tests.cpp:<line number> ............................................................................... -Generators.tests.cpp:<line number>: -PASSED: +Generators.tests.cpp:<line number>: PASSED: CHECK( x < y ) with expansion: 5 < 104 @@ -1023,8 +945,7 @@ with expansion: Generators.tests.cpp:<line number> ............................................................................... -Generators.tests.cpp:<line number>: -PASSED: +Generators.tests.cpp:<line number>: PASSED: CHECK( x < y ) with expansion: 5 < 105 @@ -1035,8 +956,7 @@ with expansion: Generators.tests.cpp:<line number> ............................................................................... -Generators.tests.cpp:<line number>: -PASSED: +Generators.tests.cpp:<line number>: PASSED: CHECK( x < y ) with expansion: 5 < 106 @@ -1047,8 +967,7 @@ with expansion: Generators.tests.cpp:<line number> ............................................................................... -Generators.tests.cpp:<line number>: -PASSED: +Generators.tests.cpp:<line number>: PASSED: CHECK( x < y ) with expansion: 5 < 107 @@ -1059,8 +978,7 @@ with expansion: Generators.tests.cpp:<line number> ............................................................................... -Generators.tests.cpp:<line number>: -PASSED: +Generators.tests.cpp:<line number>: PASSED: CHECK( x < y ) with expansion: 5 < 108 @@ -1071,8 +989,7 @@ with expansion: Generators.tests.cpp:<line number> ............................................................................... -Generators.tests.cpp:<line number>: -PASSED: +Generators.tests.cpp:<line number>: PASSED: CHECK( x < y ) with expansion: 5 < 109 @@ -1083,8 +1000,7 @@ with expansion: Generators.tests.cpp:<line number> ............................................................................... -Generators.tests.cpp:<line number>: -PASSED: +Generators.tests.cpp:<line number>: PASSED: CHECK( x < y ) with expansion: 5 < 110 @@ -1095,8 +1011,7 @@ with expansion: Generators.tests.cpp:<line number> ............................................................................... -Generators.tests.cpp:<line number>: -PASSED: +Generators.tests.cpp:<line number>: PASSED: CHECK( x < y ) with expansion: 6 < 101 @@ -1107,8 +1022,7 @@ with expansion: Generators.tests.cpp:<line number> ............................................................................... -Generators.tests.cpp:<line number>: -PASSED: +Generators.tests.cpp:<line number>: PASSED: CHECK( x < y ) with expansion: 6 < 102 @@ -1119,8 +1033,7 @@ with expansion: Generators.tests.cpp:<line number> ............................................................................... -Generators.tests.cpp:<line number>: -PASSED: +Generators.tests.cpp:<line number>: PASSED: CHECK( x < y ) with expansion: 6 < 103 @@ -1131,8 +1044,7 @@ with expansion: Generators.tests.cpp:<line number> ............................................................................... -Generators.tests.cpp:<line number>: -PASSED: +Generators.tests.cpp:<line number>: PASSED: CHECK( x < y ) with expansion: 6 < 104 @@ -1143,8 +1055,7 @@ with expansion: Generators.tests.cpp:<line number> ............................................................................... -Generators.tests.cpp:<line number>: -PASSED: +Generators.tests.cpp:<line number>: PASSED: CHECK( x < y ) with expansion: 6 < 105 @@ -1155,8 +1066,7 @@ with expansion: Generators.tests.cpp:<line number> ............................................................................... -Generators.tests.cpp:<line number>: -PASSED: +Generators.tests.cpp:<line number>: PASSED: CHECK( x < y ) with expansion: 6 < 106 @@ -1167,8 +1077,7 @@ with expansion: Generators.tests.cpp:<line number> ............................................................................... -Generators.tests.cpp:<line number>: -PASSED: +Generators.tests.cpp:<line number>: PASSED: CHECK( x < y ) with expansion: 6 < 107 @@ -1179,8 +1088,7 @@ with expansion: Generators.tests.cpp:<line number> ............................................................................... -Generators.tests.cpp:<line number>: -PASSED: +Generators.tests.cpp:<line number>: PASSED: CHECK( x < y ) with expansion: 6 < 108 @@ -1191,8 +1099,7 @@ with expansion: Generators.tests.cpp:<line number> ............................................................................... -Generators.tests.cpp:<line number>: -PASSED: +Generators.tests.cpp:<line number>: PASSED: CHECK( x < y ) with expansion: 6 < 109 @@ -1203,8 +1110,7 @@ with expansion: Generators.tests.cpp:<line number> ............................................................................... -Generators.tests.cpp:<line number>: -PASSED: +Generators.tests.cpp:<line number>: PASSED: CHECK( x < y ) with expansion: 6 < 110 @@ -1215,8 +1121,7 @@ with expansion: Generators.tests.cpp:<line number> ............................................................................... -Generators.tests.cpp:<line number>: -PASSED: +Generators.tests.cpp:<line number>: PASSED: CHECK( x < y ) with expansion: 7 < 101 @@ -1227,8 +1132,7 @@ with expansion: Generators.tests.cpp:<line number> ............................................................................... -Generators.tests.cpp:<line number>: -PASSED: +Generators.tests.cpp:<line number>: PASSED: CHECK( x < y ) with expansion: 7 < 102 @@ -1239,8 +1143,7 @@ with expansion: Generators.tests.cpp:<line number> ............................................................................... -Generators.tests.cpp:<line number>: -PASSED: +Generators.tests.cpp:<line number>: PASSED: CHECK( x < y ) with expansion: 7 < 103 @@ -1251,8 +1154,7 @@ with expansion: Generators.tests.cpp:<line number> ............................................................................... -Generators.tests.cpp:<line number>: -PASSED: +Generators.tests.cpp:<line number>: PASSED: CHECK( x < y ) with expansion: 7 < 104 @@ -1263,8 +1165,7 @@ with expansion: Generators.tests.cpp:<line number> ............................................................................... -Generators.tests.cpp:<line number>: -PASSED: +Generators.tests.cpp:<line number>: PASSED: CHECK( x < y ) with expansion: 7 < 105 @@ -1275,8 +1176,7 @@ with expansion: Generators.tests.cpp:<line number> ............................................................................... -Generators.tests.cpp:<line number>: -PASSED: +Generators.tests.cpp:<line number>: PASSED: CHECK( x < y ) with expansion: 7 < 106 @@ -1287,8 +1187,7 @@ with expansion: Generators.tests.cpp:<line number> ............................................................................... -Generators.tests.cpp:<line number>: -PASSED: +Generators.tests.cpp:<line number>: PASSED: CHECK( x < y ) with expansion: 7 < 107 @@ -1299,8 +1198,7 @@ with expansion: Generators.tests.cpp:<line number> ............................................................................... -Generators.tests.cpp:<line number>: -PASSED: +Generators.tests.cpp:<line number>: PASSED: CHECK( x < y ) with expansion: 7 < 108 @@ -1311,8 +1209,7 @@ with expansion: Generators.tests.cpp:<line number> ............................................................................... -Generators.tests.cpp:<line number>: -PASSED: +Generators.tests.cpp:<line number>: PASSED: CHECK( x < y ) with expansion: 7 < 109 @@ -1323,8 +1220,7 @@ with expansion: Generators.tests.cpp:<line number> ............................................................................... -Generators.tests.cpp:<line number>: -PASSED: +Generators.tests.cpp:<line number>: PASSED: CHECK( x < y ) with expansion: 7 < 110 @@ -1335,8 +1231,7 @@ with expansion: Generators.tests.cpp:<line number> ............................................................................... -Generators.tests.cpp:<line number>: -PASSED: +Generators.tests.cpp:<line number>: PASSED: CHECK( x < y ) with expansion: 8 < 101 @@ -1347,8 +1242,7 @@ with expansion: Generators.tests.cpp:<line number> ............................................................................... -Generators.tests.cpp:<line number>: -PASSED: +Generators.tests.cpp:<line number>: PASSED: CHECK( x < y ) with expansion: 8 < 102 @@ -1359,8 +1253,7 @@ with expansion: Generators.tests.cpp:<line number> ............................................................................... -Generators.tests.cpp:<line number>: -PASSED: +Generators.tests.cpp:<line number>: PASSED: CHECK( x < y ) with expansion: 8 < 103 @@ -1371,8 +1264,7 @@ with expansion: Generators.tests.cpp:<line number> ............................................................................... -Generators.tests.cpp:<line number>: -PASSED: +Generators.tests.cpp:<line number>: PASSED: CHECK( x < y ) with expansion: 8 < 104 @@ -1383,8 +1275,7 @@ with expansion: Generators.tests.cpp:<line number> ............................................................................... -Generators.tests.cpp:<line number>: -PASSED: +Generators.tests.cpp:<line number>: PASSED: CHECK( x < y ) with expansion: 8 < 105 @@ -1395,8 +1286,7 @@ with expansion: Generators.tests.cpp:<line number> ............................................................................... -Generators.tests.cpp:<line number>: -PASSED: +Generators.tests.cpp:<line number>: PASSED: CHECK( x < y ) with expansion: 8 < 106 @@ -1407,8 +1297,7 @@ with expansion: Generators.tests.cpp:<line number> ............................................................................... -Generators.tests.cpp:<line number>: -PASSED: +Generators.tests.cpp:<line number>: PASSED: CHECK( x < y ) with expansion: 8 < 107 @@ -1419,8 +1308,7 @@ with expansion: Generators.tests.cpp:<line number> ............................................................................... -Generators.tests.cpp:<line number>: -PASSED: +Generators.tests.cpp:<line number>: PASSED: CHECK( x < y ) with expansion: 8 < 108 @@ -1431,8 +1319,7 @@ with expansion: Generators.tests.cpp:<line number> ............................................................................... -Generators.tests.cpp:<line number>: -PASSED: +Generators.tests.cpp:<line number>: PASSED: CHECK( x < y ) with expansion: 8 < 109 @@ -1443,8 +1330,7 @@ with expansion: Generators.tests.cpp:<line number> ............................................................................... -Generators.tests.cpp:<line number>: -PASSED: +Generators.tests.cpp:<line number>: PASSED: CHECK( x < y ) with expansion: 8 < 110 @@ -1455,8 +1341,7 @@ with expansion: Generators.tests.cpp:<line number> ............................................................................... -Generators.tests.cpp:<line number>: -PASSED: +Generators.tests.cpp:<line number>: PASSED: CHECK( x < y ) with expansion: 9 < 101 @@ -1467,8 +1352,7 @@ with expansion: Generators.tests.cpp:<line number> ............................................................................... -Generators.tests.cpp:<line number>: -PASSED: +Generators.tests.cpp:<line number>: PASSED: CHECK( x < y ) with expansion: 9 < 102 @@ -1479,8 +1363,7 @@ with expansion: Generators.tests.cpp:<line number> ............................................................................... -Generators.tests.cpp:<line number>: -PASSED: +Generators.tests.cpp:<line number>: PASSED: CHECK( x < y ) with expansion: 9 < 103 @@ -1491,8 +1374,7 @@ with expansion: Generators.tests.cpp:<line number> ............................................................................... -Generators.tests.cpp:<line number>: -PASSED: +Generators.tests.cpp:<line number>: PASSED: CHECK( x < y ) with expansion: 9 < 104 @@ -1503,8 +1385,7 @@ with expansion: Generators.tests.cpp:<line number> ............................................................................... -Generators.tests.cpp:<line number>: -PASSED: +Generators.tests.cpp:<line number>: PASSED: CHECK( x < y ) with expansion: 9 < 105 @@ -1515,8 +1396,7 @@ with expansion: Generators.tests.cpp:<line number> ............................................................................... -Generators.tests.cpp:<line number>: -PASSED: +Generators.tests.cpp:<line number>: PASSED: CHECK( x < y ) with expansion: 9 < 106 @@ -1527,8 +1407,7 @@ with expansion: Generators.tests.cpp:<line number> ............................................................................... -Generators.tests.cpp:<line number>: -PASSED: +Generators.tests.cpp:<line number>: PASSED: CHECK( x < y ) with expansion: 9 < 107 @@ -1539,8 +1418,7 @@ with expansion: Generators.tests.cpp:<line number> ............................................................................... -Generators.tests.cpp:<line number>: -PASSED: +Generators.tests.cpp:<line number>: PASSED: CHECK( x < y ) with expansion: 9 < 108 @@ -1551,8 +1429,7 @@ with expansion: Generators.tests.cpp:<line number> ............................................................................... -Generators.tests.cpp:<line number>: -PASSED: +Generators.tests.cpp:<line number>: PASSED: CHECK( x < y ) with expansion: 9 < 109 @@ -1563,8 +1440,7 @@ with expansion: Generators.tests.cpp:<line number> ............................................................................... -Generators.tests.cpp:<line number>: -PASSED: +Generators.tests.cpp:<line number>: PASSED: CHECK( x < y ) with expansion: 9 < 110 @@ -1575,8 +1451,7 @@ with expansion: Generators.tests.cpp:<line number> ............................................................................... -Generators.tests.cpp:<line number>: -PASSED: +Generators.tests.cpp:<line number>: PASSED: CHECK( x < y ) with expansion: 10 < 101 @@ -1587,8 +1462,7 @@ with expansion: Generators.tests.cpp:<line number> ............................................................................... -Generators.tests.cpp:<line number>: -PASSED: +Generators.tests.cpp:<line number>: PASSED: CHECK( x < y ) with expansion: 10 < 102 @@ -1599,8 +1473,7 @@ with expansion: Generators.tests.cpp:<line number> ............................................................................... -Generators.tests.cpp:<line number>: -PASSED: +Generators.tests.cpp:<line number>: PASSED: CHECK( x < y ) with expansion: 10 < 103 @@ -1611,8 +1484,7 @@ with expansion: Generators.tests.cpp:<line number> ............................................................................... -Generators.tests.cpp:<line number>: -PASSED: +Generators.tests.cpp:<line number>: PASSED: CHECK( x < y ) with expansion: 10 < 104 @@ -1623,8 +1495,7 @@ with expansion: Generators.tests.cpp:<line number> ............................................................................... -Generators.tests.cpp:<line number>: -PASSED: +Generators.tests.cpp:<line number>: PASSED: CHECK( x < y ) with expansion: 10 < 105 @@ -1635,8 +1506,7 @@ with expansion: Generators.tests.cpp:<line number> ............................................................................... -Generators.tests.cpp:<line number>: -PASSED: +Generators.tests.cpp:<line number>: PASSED: CHECK( x < y ) with expansion: 10 < 106 @@ -1647,8 +1517,7 @@ with expansion: Generators.tests.cpp:<line number> ............................................................................... -Generators.tests.cpp:<line number>: -PASSED: +Generators.tests.cpp:<line number>: PASSED: CHECK( x < y ) with expansion: 10 < 107 @@ -1659,8 +1528,7 @@ with expansion: Generators.tests.cpp:<line number> ............................................................................... -Generators.tests.cpp:<line number>: -PASSED: +Generators.tests.cpp:<line number>: PASSED: CHECK( x < y ) with expansion: 10 < 108 @@ -1671,8 +1539,7 @@ with expansion: Generators.tests.cpp:<line number> ............................................................................... -Generators.tests.cpp:<line number>: -PASSED: +Generators.tests.cpp:<line number>: PASSED: CHECK( x < y ) with expansion: 10 < 109 @@ -1683,8 +1550,7 @@ with expansion: Generators.tests.cpp:<line number> ............................................................................... -Generators.tests.cpp:<line number>: -PASSED: +Generators.tests.cpp:<line number>: PASSED: CHECK( x < y ) with expansion: 10 < 110 @@ -1706,12 +1572,165 @@ A METHOD_AS_TEST_CASE based test run that succeeds Class.tests.cpp:<line number> ............................................................................... -Class.tests.cpp:<line number>: -PASSED: +Class.tests.cpp:<line number>: PASSED: REQUIRE( s == "hello" ) with expansion: "hello" == "hello" +------------------------------------------------------------------------------- +A TEMPLATE_PRODUCT_TEST_CASE_METHOD based test run that fails - 0 +------------------------------------------------------------------------------- +Class.tests.cpp:<line number> +............................................................................... + +Class.tests.cpp:<line number>: FAILED: + REQUIRE( Template_Fixture_2<TestType>::m_a.size() == 1 ) +with expansion: + 0 == 1 + +------------------------------------------------------------------------------- +A TEMPLATE_PRODUCT_TEST_CASE_METHOD based test run that fails - 1 +------------------------------------------------------------------------------- +Class.tests.cpp:<line number> +............................................................................... + +Class.tests.cpp:<line number>: FAILED: + REQUIRE( Template_Fixture_2<TestType>::m_a.size() == 1 ) +with expansion: + 0 == 1 + +------------------------------------------------------------------------------- +A TEMPLATE_PRODUCT_TEST_CASE_METHOD based test run that fails - 2 +------------------------------------------------------------------------------- +Class.tests.cpp:<line number> +............................................................................... + +Class.tests.cpp:<line number>: FAILED: + REQUIRE( Template_Fixture_2<TestType>::m_a.size() == 1 ) +with expansion: + 0 == 1 + +------------------------------------------------------------------------------- +A TEMPLATE_PRODUCT_TEST_CASE_METHOD based test run that fails - 3 +------------------------------------------------------------------------------- +Class.tests.cpp:<line number> +............................................................................... + +Class.tests.cpp:<line number>: FAILED: + REQUIRE( Template_Fixture_2<TestType>::m_a.size() == 1 ) +with expansion: + 0 == 1 + +------------------------------------------------------------------------------- +A TEMPLATE_PRODUCT_TEST_CASE_METHOD based test run that succeeds - 0 +------------------------------------------------------------------------------- +Class.tests.cpp:<line number> +............................................................................... + +Class.tests.cpp:<line number>: PASSED: + REQUIRE( Template_Fixture_2<TestType>::m_a.size() == 0 ) +with expansion: + 0 == 0 + +------------------------------------------------------------------------------- +A TEMPLATE_PRODUCT_TEST_CASE_METHOD based test run that succeeds - 1 +------------------------------------------------------------------------------- +Class.tests.cpp:<line number> +............................................................................... + +Class.tests.cpp:<line number>: PASSED: + REQUIRE( Template_Fixture_2<TestType>::m_a.size() == 0 ) +with expansion: + 0 == 0 + +------------------------------------------------------------------------------- +A TEMPLATE_PRODUCT_TEST_CASE_METHOD based test run that succeeds - 2 +------------------------------------------------------------------------------- +Class.tests.cpp:<line number> +............................................................................... + +Class.tests.cpp:<line number>: PASSED: + REQUIRE( Template_Fixture_2<TestType>::m_a.size() == 0 ) +with expansion: + 0 == 0 + +------------------------------------------------------------------------------- +A TEMPLATE_PRODUCT_TEST_CASE_METHOD based test run that succeeds - 3 +------------------------------------------------------------------------------- +Class.tests.cpp:<line number> +............................................................................... + +Class.tests.cpp:<line number>: PASSED: + REQUIRE( Template_Fixture_2<TestType>::m_a.size() == 0 ) +with expansion: + 0 == 0 + +------------------------------------------------------------------------------- +A TEMPLATE_TEST_CASE_METHOD based test run that fails - double +------------------------------------------------------------------------------- +Class.tests.cpp:<line number> +............................................................................... + +Class.tests.cpp:<line number>: FAILED: + REQUIRE( Template_Fixture<TestType>::m_a == 2 ) +with expansion: + 1.0 == 2 + +------------------------------------------------------------------------------- +A TEMPLATE_TEST_CASE_METHOD based test run that fails - float +------------------------------------------------------------------------------- +Class.tests.cpp:<line number> +............................................................................... + +Class.tests.cpp:<line number>: FAILED: + REQUIRE( Template_Fixture<TestType>::m_a == 2 ) +with expansion: + 1.0f == 2 + +------------------------------------------------------------------------------- +A TEMPLATE_TEST_CASE_METHOD based test run that fails - int +------------------------------------------------------------------------------- +Class.tests.cpp:<line number> +............................................................................... + +Class.tests.cpp:<line number>: FAILED: + REQUIRE( Template_Fixture<TestType>::m_a == 2 ) +with expansion: + 1 == 2 + +------------------------------------------------------------------------------- +A TEMPLATE_TEST_CASE_METHOD based test run that succeeds - double +------------------------------------------------------------------------------- +Class.tests.cpp:<line number> +............................................................................... + +Class.tests.cpp:<line number>: PASSED: + REQUIRE( Template_Fixture<TestType>::m_a == 1 ) +with expansion: + 1.0 == 1 + +------------------------------------------------------------------------------- +A TEMPLATE_TEST_CASE_METHOD based test run that succeeds - float +------------------------------------------------------------------------------- +Class.tests.cpp:<line number> +............................................................................... + +Class.tests.cpp:<line number>: PASSED: + REQUIRE( Template_Fixture<TestType>::m_a == 1 ) +with expansion: + 1.0f == 1 + +------------------------------------------------------------------------------- +A TEMPLATE_TEST_CASE_METHOD based test run that succeeds - int +------------------------------------------------------------------------------- +Class.tests.cpp:<line number> +............................................................................... + +Class.tests.cpp:<line number>: PASSED: + REQUIRE( Template_Fixture<TestType>::m_a == 1 ) +with expansion: + 1 == 1 + ------------------------------------------------------------------------------- A TEST_CASE_METHOD based test run that fails ------------------------------------------------------------------------------- @@ -1729,50 +1748,87 @@ A TEST_CASE_METHOD based test run that succeeds Class.tests.cpp:<line number> ............................................................................... -Class.tests.cpp:<line number>: -PASSED: +Class.tests.cpp:<line number>: PASSED: REQUIRE( m_a == 1 ) with expansion: 1 == 1 +------------------------------------------------------------------------------- +A Template product test case - 0 +------------------------------------------------------------------------------- +Misc.tests.cpp:<line number> +............................................................................... + +Misc.tests.cpp:<line number>: PASSED: + REQUIRE( x.size() == 0 ) +with expansion: + 0 == 0 + +------------------------------------------------------------------------------- +A Template product test case - 1 +------------------------------------------------------------------------------- +Misc.tests.cpp:<line number> +............................................................................... + +Misc.tests.cpp:<line number>: PASSED: + REQUIRE( x.size() == 0 ) +with expansion: + 0 == 0 + +------------------------------------------------------------------------------- +A Template product test case - 2 +------------------------------------------------------------------------------- +Misc.tests.cpp:<line number> +............................................................................... + +Misc.tests.cpp:<line number>: PASSED: + REQUIRE( x.size() == 0 ) +with expansion: + 0 == 0 + +------------------------------------------------------------------------------- +A Template product test case - 3 +------------------------------------------------------------------------------- +Misc.tests.cpp:<line number> +............................................................................... + +Misc.tests.cpp:<line number>: PASSED: + REQUIRE( x.size() == 0 ) +with expansion: + 0 == 0 + ------------------------------------------------------------------------------- A comparison that uses literals instead of the normal constructor ------------------------------------------------------------------------------- Approx.tests.cpp:<line number> ............................................................................... -Approx.tests.cpp:<line number>: -PASSED: +Approx.tests.cpp:<line number>: PASSED: REQUIRE( d == 1.23_a ) with expansion: 1.23 == Approx( 1.23 ) -Approx.tests.cpp:<line number>: -PASSED: +Approx.tests.cpp:<line number>: PASSED: REQUIRE( d != 1.22_a ) with expansion: 1.23 != Approx( 1.22 ) -Approx.tests.cpp:<line number>: -PASSED: +Approx.tests.cpp:<line number>: PASSED: REQUIRE( -d == -1.23_a ) with expansion: -1.23 == Approx( -1.23 ) -Approx.tests.cpp:<line number>: -PASSED: +Approx.tests.cpp:<line number>: PASSED: REQUIRE( d == 1.2_a .epsilon(.1) ) with expansion: 1.23 == Approx( 1.2 ) -Approx.tests.cpp:<line number>: -PASSED: +Approx.tests.cpp:<line number>: PASSED: REQUIRE( d != 1.2_a .epsilon(.001) ) with expansion: 1.23 != Approx( 1.2 ) -Approx.tests.cpp:<line number>: -PASSED: +Approx.tests.cpp:<line number>: PASSED: REQUIRE( d == 1_a .epsilon(.3) ) with expansion: 1.23 == Approx( 1.0 ) @@ -1785,8 +1841,7 @@ A couple of nested sections followed by a failure Misc.tests.cpp:<line number> ............................................................................... -Misc.tests.cpp:<line number>: -PASSED: +Misc.tests.cpp:<line number>: PASSED: with message: that's not flying - that's failing in style @@ -1822,38 +1877,32 @@ Absolute margin Approx.tests.cpp:<line number> ............................................................................... -Approx.tests.cpp:<line number>: -PASSED: +Approx.tests.cpp:<line number>: PASSED: REQUIRE( 104.0 != Approx(100.0) ) with expansion: 104.0 != Approx( 100.0 ) -Approx.tests.cpp:<line number>: -PASSED: +Approx.tests.cpp:<line number>: PASSED: REQUIRE( 104.0 == Approx(100.0).margin(5) ) with expansion: 104.0 == Approx( 100.0 ) -Approx.tests.cpp:<line number>: -PASSED: +Approx.tests.cpp:<line number>: PASSED: REQUIRE( 104.0 == Approx(100.0).margin(4) ) with expansion: 104.0 == Approx( 100.0 ) -Approx.tests.cpp:<line number>: -PASSED: +Approx.tests.cpp:<line number>: PASSED: REQUIRE( 104.0 != Approx(100.0).margin(3) ) with expansion: 104.0 != Approx( 100.0 ) -Approx.tests.cpp:<line number>: -PASSED: +Approx.tests.cpp:<line number>: PASSED: REQUIRE( 100.3 != Approx(100.0) ) with expansion: 100.3 != Approx( 100.0 ) -Approx.tests.cpp:<line number>: -PASSED: +Approx.tests.cpp:<line number>: PASSED: REQUIRE( 100.3 == Approx(100.0).margin(0.5) ) with expansion: 100.3 == Approx( 100.0 ) @@ -1873,14 +1922,12 @@ An expression with side-effects should only be evaluated once Tricky.tests.cpp:<line number> ............................................................................... -Tricky.tests.cpp:<line number>: -PASSED: +Tricky.tests.cpp:<line number>: PASSED: REQUIRE( i++ == 7 ) with expansion: 7 == 7 -Tricky.tests.cpp:<line number>: -PASSED: +Tricky.tests.cpp:<line number>: PASSED: REQUIRE( i++ == 8 ) with expansion: 8 == 8 @@ -1891,8 +1938,7 @@ An unchecked exception reports the line of the last assertion Exception.tests.cpp:<line number> ............................................................................... -Exception.tests.cpp:<line number>: -PASSED: +Exception.tests.cpp:<line number>: PASSED: CHECK( 1 == 1 ) Exception.tests.cpp:<line number>: FAILED: @@ -1906,8 +1952,7 @@ Anonymous test case 1 VariadicMacros.tests.cpp:<line number> ............................................................................... -VariadicMacros.tests.cpp:<line number>: -PASSED: +VariadicMacros.tests.cpp:<line number>: PASSED: with message: anonymous test case @@ -1917,32 +1962,25 @@ Approx setters validate their arguments Approx.tests.cpp:<line number> ............................................................................... -Approx.tests.cpp:<line number>: -PASSED: +Approx.tests.cpp:<line number>: PASSED: REQUIRE_NOTHROW( Approx(0).margin(0) ) -Approx.tests.cpp:<line number>: -PASSED: +Approx.tests.cpp:<line number>: PASSED: REQUIRE_NOTHROW( Approx(0).margin(1234656) ) -Approx.tests.cpp:<line number>: -PASSED: +Approx.tests.cpp:<line number>: PASSED: REQUIRE_THROWS_AS( Approx(0).margin(-2), std::domain_error ) -Approx.tests.cpp:<line number>: -PASSED: +Approx.tests.cpp:<line number>: PASSED: REQUIRE_NOTHROW( Approx(0).epsilon(0) ) -Approx.tests.cpp:<line number>: -PASSED: +Approx.tests.cpp:<line number>: PASSED: REQUIRE_NOTHROW( Approx(0).epsilon(1) ) -Approx.tests.cpp:<line number>: -PASSED: +Approx.tests.cpp:<line number>: PASSED: REQUIRE_THROWS_AS( Approx(0).epsilon(-0.001), std::domain_error ) -Approx.tests.cpp:<line number>: -PASSED: +Approx.tests.cpp:<line number>: PASSED: REQUIRE_THROWS_AS( Approx(0).epsilon(1.0001), std::domain_error ) ------------------------------------------------------------------------------- @@ -1951,32 +1989,27 @@ Approx with exactly-representable margin Approx.tests.cpp:<line number> ............................................................................... -Approx.tests.cpp:<line number>: -PASSED: +Approx.tests.cpp:<line number>: PASSED: CHECK( 0.25f == Approx(0.0f).margin(0.25f) ) with expansion: 0.25f == Approx( 0.0 ) -Approx.tests.cpp:<line number>: -PASSED: +Approx.tests.cpp:<line number>: PASSED: CHECK( 0.0f == Approx(0.25f).margin(0.25f) ) with expansion: 0.0f == Approx( 0.25 ) -Approx.tests.cpp:<line number>: -PASSED: +Approx.tests.cpp:<line number>: PASSED: CHECK( 0.5f == Approx(0.25f).margin(0.25f) ) with expansion: 0.5f == Approx( 0.25 ) -Approx.tests.cpp:<line number>: -PASSED: +Approx.tests.cpp:<line number>: PASSED: CHECK( 245.0f == Approx(245.25f).margin(0.25f) ) with expansion: 245.0f == Approx( 245.25 ) -Approx.tests.cpp:<line number>: -PASSED: +Approx.tests.cpp:<line number>: PASSED: CHECK( 245.5f == Approx(245.25f).margin(0.25f) ) with expansion: 245.5f == Approx( 245.25 ) @@ -1987,14 +2020,12 @@ Approximate PI Approx.tests.cpp:<line number> ............................................................................... -Approx.tests.cpp:<line number>: -PASSED: +Approx.tests.cpp:<line number>: PASSED: REQUIRE( divide( 22, 7 ) == Approx( 3.141 ).epsilon( 0.001 ) ) with expansion: 3.1428571429 == Approx( 3.141 ) -Approx.tests.cpp:<line number>: -PASSED: +Approx.tests.cpp:<line number>: PASSED: REQUIRE( divide( 22, 7 ) != Approx( 3.141 ).epsilon( 0.0001 ) ) with expansion: 3.1428571429 != Approx( 3.141 ) @@ -2005,14 +2036,12 @@ Approximate comparisons with different epsilons Approx.tests.cpp:<line number> ............................................................................... -Approx.tests.cpp:<line number>: -PASSED: +Approx.tests.cpp:<line number>: PASSED: REQUIRE( d != Approx( 1.231 ) ) with expansion: 1.23 != Approx( 1.231 ) -Approx.tests.cpp:<line number>: -PASSED: +Approx.tests.cpp:<line number>: PASSED: REQUIRE( d == Approx( 1.231 ).epsilon( 0.1 ) ) with expansion: 1.23 == Approx( 1.231 ) @@ -2023,14 +2052,12 @@ Approximate comparisons with floats Approx.tests.cpp:<line number> ............................................................................... -Approx.tests.cpp:<line number>: -PASSED: +Approx.tests.cpp:<line number>: PASSED: REQUIRE( 1.23f == Approx( 1.23f ) ) with expansion: 1.23f == Approx( 1.2300000191 ) -Approx.tests.cpp:<line number>: -PASSED: +Approx.tests.cpp:<line number>: PASSED: REQUIRE( 0.0f == Approx( 0.0f ) ) with expansion: 0.0f == Approx( 0.0 ) @@ -2041,14 +2068,12 @@ Approximate comparisons with ints Approx.tests.cpp:<line number> ............................................................................... -Approx.tests.cpp:<line number>: -PASSED: +Approx.tests.cpp:<line number>: PASSED: REQUIRE( 1 == Approx( 1 ) ) with expansion: 1 == Approx( 1.0 ) -Approx.tests.cpp:<line number>: -PASSED: +Approx.tests.cpp:<line number>: PASSED: REQUIRE( 0 == Approx( 0 ) ) with expansion: 0 == Approx( 0.0 ) @@ -2059,32 +2084,27 @@ Approximate comparisons with mixed numeric types Approx.tests.cpp:<line number> ............................................................................... -Approx.tests.cpp:<line number>: -PASSED: +Approx.tests.cpp:<line number>: PASSED: REQUIRE( 1.0f == Approx( 1 ) ) with expansion: 1.0f == Approx( 1.0 ) -Approx.tests.cpp:<line number>: -PASSED: +Approx.tests.cpp:<line number>: PASSED: REQUIRE( 0 == Approx( dZero) ) with expansion: 0 == Approx( 0.0 ) -Approx.tests.cpp:<line number>: -PASSED: +Approx.tests.cpp:<line number>: PASSED: REQUIRE( 0 == Approx( dSmall ).margin( 0.001 ) ) with expansion: 0 == Approx( 0.00001 ) -Approx.tests.cpp:<line number>: -PASSED: +Approx.tests.cpp:<line number>: PASSED: REQUIRE( 1.234f == Approx( dMedium ) ) with expansion: 1.234f == Approx( 1.234 ) -Approx.tests.cpp:<line number>: -PASSED: +Approx.tests.cpp:<line number>: PASSED: REQUIRE( dMedium == Approx( 1.234f ) ) with expansion: 1.234 == Approx( 1.2339999676 ) @@ -2096,14 +2116,12 @@ Arbitrary predicate matcher Matchers.tests.cpp:<line number> ............................................................................... -Matchers.tests.cpp:<line number>: -PASSED: +Matchers.tests.cpp:<line number>: PASSED: REQUIRE_THAT( 1, Predicate<int>(alwaysTrue, "always true") ) with expansion: 1 matches predicate: "always true" -Matchers.tests.cpp:<line number>: -PASSED: +Matchers.tests.cpp:<line number>: PASSED: REQUIRE_THAT( 1, !Predicate<int>(alwaysFalse, "always false") ) with expansion: 1 not matches predicate: "always false" @@ -2115,14 +2133,12 @@ Arbitrary predicate matcher Matchers.tests.cpp:<line number> ............................................................................... -Matchers.tests.cpp:<line number>: -PASSED: +Matchers.tests.cpp:<line number>: PASSED: REQUIRE_THAT( "Hello olleH", Predicate<std::string>( [] (std::string const& str) -> bool { return str.front() == str.back(); }, "First and last character should be equal") ) with expansion: "Hello olleH" matches predicate: "First and last character should be equal" -Matchers.tests.cpp:<line number>: -PASSED: +Matchers.tests.cpp:<line number>: PASSED: REQUIRE_THAT( "This wouldn't pass", !Predicate<std::string>( [] (std::string const& str) -> bool { return str.front() == str.back(); } ) ) with expansion: "This wouldn't pass" not matches undescribed predicate @@ -2133,8 +2149,7 @@ Assertions then sections Tricky.tests.cpp:<line number> ............................................................................... -Tricky.tests.cpp:<line number>: -PASSED: +Tricky.tests.cpp:<line number>: PASSED: REQUIRE( true ) ------------------------------------------------------------------------------- @@ -2144,8 +2159,7 @@ Assertions then sections Tricky.tests.cpp:<line number> ............................................................................... -Tricky.tests.cpp:<line number>: -PASSED: +Tricky.tests.cpp:<line number>: PASSED: REQUIRE( true ) ------------------------------------------------------------------------------- @@ -2156,8 +2170,7 @@ Assertions then sections Tricky.tests.cpp:<line number> ............................................................................... -Tricky.tests.cpp:<line number>: -PASSED: +Tricky.tests.cpp:<line number>: PASSED: REQUIRE( true ) ------------------------------------------------------------------------------- @@ -2166,8 +2179,7 @@ Assertions then sections Tricky.tests.cpp:<line number> ............................................................................... -Tricky.tests.cpp:<line number>: -PASSED: +Tricky.tests.cpp:<line number>: PASSED: REQUIRE( true ) ------------------------------------------------------------------------------- @@ -2177,8 +2189,7 @@ Assertions then sections Tricky.tests.cpp:<line number> ............................................................................... -Tricky.tests.cpp:<line number>: -PASSED: +Tricky.tests.cpp:<line number>: PASSED: REQUIRE( true ) ------------------------------------------------------------------------------- @@ -2189,8 +2200,7 @@ Assertions then sections Tricky.tests.cpp:<line number> ............................................................................... -Tricky.tests.cpp:<line number>: -PASSED: +Tricky.tests.cpp:<line number>: PASSED: REQUIRE( true ) ------------------------------------------------------------------------------- @@ -2199,20 +2209,17 @@ Assorted miscellaneous tests Approx.tests.cpp:<line number> ............................................................................... -Approx.tests.cpp:<line number>: -PASSED: +Approx.tests.cpp:<line number>: PASSED: REQUIRE( INFINITY == Approx(INFINITY) ) with expansion: inff == Approx( inf ) -Approx.tests.cpp:<line number>: -PASSED: +Approx.tests.cpp:<line number>: PASSED: REQUIRE( NAN != Approx(NAN) ) with expansion: nanf != Approx( nan ) -Approx.tests.cpp:<line number>: -PASSED: +Approx.tests.cpp:<line number>: PASSED: REQUIRE_FALSE( NAN == Approx(NAN) ) with expansion: !(nanf == Approx( nan )) @@ -2223,18 +2230,48 @@ Bitfields can be captured (#1027) Tricky.tests.cpp:<line number> ............................................................................... -Tricky.tests.cpp:<line number>: -PASSED: +Tricky.tests.cpp:<line number>: PASSED: REQUIRE( y.v == 0 ) with expansion: 0 == 0 -Tricky.tests.cpp:<line number>: -PASSED: +Tricky.tests.cpp:<line number>: PASSED: REQUIRE( 0 == y.v ) with expansion: 0 == 0 +------------------------------------------------------------------------------- +CAPTURE can deal with complex expressions +------------------------------------------------------------------------------- +Message.tests.cpp:<line number> +............................................................................... + +Message.tests.cpp:<line number>: PASSED: +with messages: + a := 1 + b := 2 + c := 3 + a + b := 3 + a+b := 3 + c > b := true + a == 1 := true + +------------------------------------------------------------------------------- +CAPTURE can deal with complex expressions involving commas +------------------------------------------------------------------------------- +Message.tests.cpp:<line number> +............................................................................... + +Message.tests.cpp:<line number>: PASSED: +with messages: + std::vector<int>{1, 2, 3}[0, 1, 2] := 3 + std::vector<int>{1, 2, 3}[(0, 1)] := 2 + std::vector<int>{1, 2, 3}[0] := 1 + (helper_1436<int, int>{12, -12}) := { 12, -12 } + (helper_1436<int, int>(-12, 12)) := { -12, 12 } + (1, 2) := 2 + (2, 3) := 3 + ------------------------------------------------------------------------------- Capture and info messages Capture should stringify like assertions @@ -2242,8 +2279,7 @@ Capture and info messages ToStringGeneral.tests.cpp:<line number> ............................................................................... -ToStringGeneral.tests.cpp:<line number>: -PASSED: +ToStringGeneral.tests.cpp:<line number>: PASSED: REQUIRE( true ) with message: i := 2 @@ -2255,8 +2291,7 @@ Capture and info messages ToStringGeneral.tests.cpp:<line number> ............................................................................... -ToStringGeneral.tests.cpp:<line number>: -PASSED: +ToStringGeneral.tests.cpp:<line number>: PASSED: REQUIRE( true ) with message: 3 @@ -2268,26 +2303,22 @@ Character pretty printing ToStringGeneral.tests.cpp:<line number> ............................................................................... -ToStringGeneral.tests.cpp:<line number>: -PASSED: +ToStringGeneral.tests.cpp:<line number>: PASSED: CHECK( tab == '\t' ) with expansion: '\t' == '\t' -ToStringGeneral.tests.cpp:<line number>: -PASSED: +ToStringGeneral.tests.cpp:<line number>: PASSED: CHECK( newline == '\n' ) with expansion: '\n' == '\n' -ToStringGeneral.tests.cpp:<line number>: -PASSED: +ToStringGeneral.tests.cpp:<line number>: PASSED: CHECK( carr_return == '\r' ) with expansion: '\r' == '\r' -ToStringGeneral.tests.cpp:<line number>: -PASSED: +ToStringGeneral.tests.cpp:<line number>: PASSED: CHECK( form_feed == '\f' ) with expansion: '\f' == '\f' @@ -2299,32 +2330,27 @@ Character pretty printing ToStringGeneral.tests.cpp:<line number> ............................................................................... -ToStringGeneral.tests.cpp:<line number>: -PASSED: +ToStringGeneral.tests.cpp:<line number>: PASSED: CHECK( space == ' ' ) with expansion: ' ' == ' ' -ToStringGeneral.tests.cpp:<line number>: -PASSED: +ToStringGeneral.tests.cpp:<line number>: PASSED: REQUIRE( c == chars[i] ) with expansion: 'a' == 'a' -ToStringGeneral.tests.cpp:<line number>: -PASSED: +ToStringGeneral.tests.cpp:<line number>: PASSED: REQUIRE( c == chars[i] ) with expansion: 'z' == 'z' -ToStringGeneral.tests.cpp:<line number>: -PASSED: +ToStringGeneral.tests.cpp:<line number>: PASSED: REQUIRE( c == chars[i] ) with expansion: 'A' == 'A' -ToStringGeneral.tests.cpp:<line number>: -PASSED: +ToStringGeneral.tests.cpp:<line number>: PASSED: REQUIRE( c == chars[i] ) with expansion: 'Z' == 'Z' @@ -2336,32 +2362,27 @@ Character pretty printing ToStringGeneral.tests.cpp:<line number> ............................................................................... -ToStringGeneral.tests.cpp:<line number>: -PASSED: +ToStringGeneral.tests.cpp:<line number>: PASSED: CHECK( null_terminator == '\0' ) with expansion: 0 == 0 -ToStringGeneral.tests.cpp:<line number>: -PASSED: +ToStringGeneral.tests.cpp:<line number>: PASSED: REQUIRE( c == i ) with expansion: 2 == 2 -ToStringGeneral.tests.cpp:<line number>: -PASSED: +ToStringGeneral.tests.cpp:<line number>: PASSED: REQUIRE( c == i ) with expansion: 3 == 3 -ToStringGeneral.tests.cpp:<line number>: -PASSED: +ToStringGeneral.tests.cpp:<line number>: PASSED: REQUIRE( c == i ) with expansion: 4 == 4 -ToStringGeneral.tests.cpp:<line number>: -PASSED: +ToStringGeneral.tests.cpp:<line number>: PASSED: REQUIRE( c == i ) with expansion: 5 == 5 @@ -2372,64 +2393,52 @@ Commas in various macros are allowed Tricky.tests.cpp:<line number> ............................................................................... -Tricky.tests.cpp:<line number>: -PASSED: +Tricky.tests.cpp:<line number>: PASSED: REQUIRE_THROWS( std::vector<constructor_throws>{constructor_throws{}, constructor_throws{}} ) -Tricky.tests.cpp:<line number>: -PASSED: +Tricky.tests.cpp:<line number>: PASSED: CHECK_THROWS( std::vector<constructor_throws>{constructor_throws{}, constructor_throws{}} ) -Tricky.tests.cpp:<line number>: -PASSED: +Tricky.tests.cpp:<line number>: PASSED: REQUIRE_NOTHROW( std::vector<int>{1, 2, 3} == std::vector<int>{1, 2, 3} ) -Tricky.tests.cpp:<line number>: -PASSED: +Tricky.tests.cpp:<line number>: PASSED: CHECK_NOTHROW( std::vector<int>{1, 2, 3} == std::vector<int>{1, 2, 3} ) -Tricky.tests.cpp:<line number>: -PASSED: +Tricky.tests.cpp:<line number>: PASSED: REQUIRE( std::vector<int>{1, 2} == std::vector<int>{1, 2} ) with expansion: { 1, 2 } == { 1, 2 } -Tricky.tests.cpp:<line number>: -PASSED: +Tricky.tests.cpp:<line number>: PASSED: CHECK( std::vector<int>{1, 2} == std::vector<int>{1, 2} ) with expansion: { 1, 2 } == { 1, 2 } -Tricky.tests.cpp:<line number>: -PASSED: +Tricky.tests.cpp:<line number>: PASSED: REQUIRE_FALSE( std::vector<int>{1, 2} == std::vector<int>{1, 2, 3} ) with expansion: !({ 1, 2 } == { 1, 2, 3 }) -Tricky.tests.cpp:<line number>: -PASSED: +Tricky.tests.cpp:<line number>: PASSED: CHECK_FALSE( std::vector<int>{1, 2} == std::vector<int>{1, 2, 3} ) with expansion: !({ 1, 2 } == { 1, 2, 3 }) -Tricky.tests.cpp:<line number>: -PASSED: +Tricky.tests.cpp:<line number>: PASSED: CHECK_NOFAIL( std::vector<int>{1, 2} == std::vector<int>{1, 2} ) with expansion: { 1, 2 } == { 1, 2 } -Tricky.tests.cpp:<line number>: -PASSED: +Tricky.tests.cpp:<line number>: PASSED: CHECKED_IF( std::vector<int>{1, 2} == std::vector<int>{1, 2} ) with expansion: { 1, 2 } == { 1, 2 } -Tricky.tests.cpp:<line number>: -PASSED: +Tricky.tests.cpp:<line number>: PASSED: REQUIRE( true ) -Tricky.tests.cpp:<line number>: -PASSED: +Tricky.tests.cpp:<line number>: PASSED: CHECKED_ELSE( std::vector<int>{1, 2} == std::vector<int>{1, 2} ) with expansion: { 1, 2 } == { 1, 2 } @@ -2440,14 +2449,12 @@ Comparing function pointers Tricky.tests.cpp:<line number> ............................................................................... -Tricky.tests.cpp:<line number>: -PASSED: +Tricky.tests.cpp:<line number>: PASSED: REQUIRE( a ) with expansion: 0x<hex digits> -Tricky.tests.cpp:<line number>: -PASSED: +Tricky.tests.cpp:<line number>: PASSED: REQUIRE( a == &foo ) with expansion: 0x<hex digits> == 0x<hex digits> @@ -2458,74 +2465,62 @@ Comparison with explicitly convertible types Approx.tests.cpp:<line number> ............................................................................... -Approx.tests.cpp:<line number>: -PASSED: +Approx.tests.cpp:<line number>: PASSED: REQUIRE( td == Approx(10.0) ) with expansion: StrongDoubleTypedef(10) == Approx( 10.0 ) -Approx.tests.cpp:<line number>: -PASSED: +Approx.tests.cpp:<line number>: PASSED: REQUIRE( Approx(10.0) == td ) with expansion: Approx( 10.0 ) == StrongDoubleTypedef(10) -Approx.tests.cpp:<line number>: -PASSED: +Approx.tests.cpp:<line number>: PASSED: REQUIRE( td != Approx(11.0) ) with expansion: StrongDoubleTypedef(10) != Approx( 11.0 ) -Approx.tests.cpp:<line number>: -PASSED: +Approx.tests.cpp:<line number>: PASSED: REQUIRE( Approx(11.0) != td ) with expansion: Approx( 11.0 ) != StrongDoubleTypedef(10) -Approx.tests.cpp:<line number>: -PASSED: +Approx.tests.cpp:<line number>: PASSED: REQUIRE( td <= Approx(10.0) ) with expansion: StrongDoubleTypedef(10) <= Approx( 10.0 ) -Approx.tests.cpp:<line number>: -PASSED: +Approx.tests.cpp:<line number>: PASSED: REQUIRE( td <= Approx(11.0) ) with expansion: StrongDoubleTypedef(10) <= Approx( 11.0 ) -Approx.tests.cpp:<line number>: -PASSED: +Approx.tests.cpp:<line number>: PASSED: REQUIRE( Approx(10.0) <= td ) with expansion: Approx( 10.0 ) <= StrongDoubleTypedef(10) -Approx.tests.cpp:<line number>: -PASSED: +Approx.tests.cpp:<line number>: PASSED: REQUIRE( Approx(9.0) <= td ) with expansion: Approx( 9.0 ) <= StrongDoubleTypedef(10) -Approx.tests.cpp:<line number>: -PASSED: +Approx.tests.cpp:<line number>: PASSED: REQUIRE( td >= Approx(9.0) ) with expansion: StrongDoubleTypedef(10) >= Approx( 9.0 ) -Approx.tests.cpp:<line number>: -PASSED: +Approx.tests.cpp:<line number>: PASSED: REQUIRE( td >= Approx(td) ) with expansion: StrongDoubleTypedef(10) >= Approx( 10.0 ) -Approx.tests.cpp:<line number>: -PASSED: +Approx.tests.cpp:<line number>: PASSED: REQUIRE( Approx(td) >= td ) with expansion: Approx( 10.0 ) >= StrongDoubleTypedef(10) -Approx.tests.cpp:<line number>: -PASSED: +Approx.tests.cpp:<line number>: PASSED: REQUIRE( Approx(11.0) >= td ) with expansion: Approx( 11.0 ) >= StrongDoubleTypedef(10) @@ -2536,8 +2531,7 @@ Comparisons between ints where one side is computed Condition.tests.cpp:<line number> ............................................................................... -Condition.tests.cpp:<line number>: -PASSED: +Condition.tests.cpp:<line number>: PASSED: CHECK( 54 == 6*9 ) with expansion: 54 == 54 @@ -2549,38 +2543,32 @@ behaviour Condition.tests.cpp:<line number> ............................................................................... -Condition.tests.cpp:<line number>: -PASSED: +Condition.tests.cpp:<line number>: PASSED: CHECK( ( -1 > 2u ) ) with expansion: true -Condition.tests.cpp:<line number>: -PASSED: +Condition.tests.cpp:<line number>: PASSED: CHECK( -1 > 2u ) with expansion: -1 > 2 -Condition.tests.cpp:<line number>: -PASSED: +Condition.tests.cpp:<line number>: PASSED: CHECK( ( 2u < -1 ) ) with expansion: true -Condition.tests.cpp:<line number>: -PASSED: +Condition.tests.cpp:<line number>: PASSED: CHECK( 2u < -1 ) with expansion: 2 < -1 -Condition.tests.cpp:<line number>: -PASSED: +Condition.tests.cpp:<line number>: PASSED: CHECK( ( minInt > 2u ) ) with expansion: true -Condition.tests.cpp:<line number>: -PASSED: +Condition.tests.cpp:<line number>: PASSED: CHECK( minInt > 2u ) with expansion: -2147483648 > 2 @@ -2591,80 +2579,67 @@ Comparisons with int literals don't warn when mixing signed/ unsigned Condition.tests.cpp:<line number> ............................................................................... -Condition.tests.cpp:<line number>: -PASSED: +Condition.tests.cpp:<line number>: PASSED: REQUIRE( i == 1 ) with expansion: 1 == 1 -Condition.tests.cpp:<line number>: -PASSED: +Condition.tests.cpp:<line number>: PASSED: REQUIRE( ui == 2 ) with expansion: 2 == 2 -Condition.tests.cpp:<line number>: -PASSED: +Condition.tests.cpp:<line number>: PASSED: REQUIRE( l == 3 ) with expansion: 3 == 3 -Condition.tests.cpp:<line number>: -PASSED: +Condition.tests.cpp:<line number>: PASSED: REQUIRE( ul == 4 ) with expansion: 4 == 4 -Condition.tests.cpp:<line number>: -PASSED: +Condition.tests.cpp:<line number>: PASSED: REQUIRE( c == 5 ) with expansion: 5 == 5 -Condition.tests.cpp:<line number>: -PASSED: +Condition.tests.cpp:<line number>: PASSED: REQUIRE( uc == 6 ) with expansion: 6 == 6 -Condition.tests.cpp:<line number>: -PASSED: +Condition.tests.cpp:<line number>: PASSED: REQUIRE( 1 == i ) with expansion: 1 == 1 -Condition.tests.cpp:<line number>: -PASSED: +Condition.tests.cpp:<line number>: PASSED: REQUIRE( 2 == ui ) with expansion: 2 == 2 -Condition.tests.cpp:<line number>: -PASSED: +Condition.tests.cpp:<line number>: PASSED: REQUIRE( 3 == l ) with expansion: 3 == 3 -Condition.tests.cpp:<line number>: -PASSED: +Condition.tests.cpp:<line number>: PASSED: REQUIRE( 4 == ul ) with expansion: 4 == 4 -Condition.tests.cpp:<line number>: -PASSED: +Condition.tests.cpp:<line number>: PASSED: REQUIRE( 5 == c ) with expansion: 5 == 5 -Condition.tests.cpp:<line number>: -PASSED: +Condition.tests.cpp:<line number>: PASSED: REQUIRE( 6 == uc ) with expansion: 6 == 6 -Condition.tests.cpp:<line number>: -PASSED: +Condition.tests.cpp:<line number>: PASSED: REQUIRE( (std::numeric_limits<uint32_t>::max)() > ul ) with expansion: 4294967295 (0x<hex digits>) > 4 @@ -2724,14 +2699,12 @@ Default scale is invisible to comparison Approx.tests.cpp:<line number> ............................................................................... -Approx.tests.cpp:<line number>: -PASSED: +Approx.tests.cpp:<line number>: PASSED: REQUIRE( 101.000001 != Approx(100).epsilon(0.01) ) with expansion: 101.000001 != Approx( 100.0 ) -Approx.tests.cpp:<line number>: -PASSED: +Approx.tests.cpp:<line number>: PASSED: REQUIRE( std::pow(10, -5) != Approx(std::pow(10, -7)) ) with expansion: 0.00001 != Approx( 0.0000001 ) @@ -2759,8 +2732,7 @@ Epsilon only applies to Approx's value Approx.tests.cpp:<line number> ............................................................................... -Approx.tests.cpp:<line number>: -PASSED: +Approx.tests.cpp:<line number>: PASSED: REQUIRE( 101.01 != Approx(100).epsilon(0.01) ) with expansion: 101.01 != Approx( 100.0 ) @@ -2842,44 +2814,37 @@ Equality checks that should succeed Condition.tests.cpp:<line number> ............................................................................... -Condition.tests.cpp:<line number>: -PASSED: +Condition.tests.cpp:<line number>: PASSED: REQUIRE( data.int_seven == 7 ) with expansion: 7 == 7 -Condition.tests.cpp:<line number>: -PASSED: +Condition.tests.cpp:<line number>: PASSED: REQUIRE( data.float_nine_point_one == Approx( 9.1f ) ) with expansion: 9.1f == Approx( 9.1000003815 ) -Condition.tests.cpp:<line number>: -PASSED: +Condition.tests.cpp:<line number>: PASSED: REQUIRE( data.double_pi == Approx( 3.1415926535 ) ) with expansion: 3.1415926535 == Approx( 3.1415926535 ) -Condition.tests.cpp:<line number>: -PASSED: +Condition.tests.cpp:<line number>: PASSED: REQUIRE( data.str_hello == "hello" ) with expansion: "hello" == "hello" -Condition.tests.cpp:<line number>: -PASSED: +Condition.tests.cpp:<line number>: PASSED: REQUIRE( "hello" == data.str_hello ) with expansion: "hello" == "hello" -Condition.tests.cpp:<line number>: -PASSED: +Condition.tests.cpp:<line number>: PASSED: REQUIRE( data.str_hello.size() == 5 ) with expansion: 5 == 5 -Condition.tests.cpp:<line number>: -PASSED: +Condition.tests.cpp:<line number>: PASSED: REQUIRE( x == Approx( 1.3 ) ) with expansion: 1.3 == Approx( 1.3 ) @@ -2890,15 +2855,13 @@ Equals Matchers.tests.cpp:<line number> ............................................................................... -Matchers.tests.cpp:<line number>: -PASSED: +Matchers.tests.cpp:<line number>: PASSED: CHECK_THAT( testStringForMatching(), Equals("this string contains 'abc' as a substring") ) with expansion: "this string contains 'abc' as a substring" equals: "this string contains 'abc' as a substring" -Matchers.tests.cpp:<line number>: -PASSED: +Matchers.tests.cpp:<line number>: PASSED: CHECK_THAT( testStringForMatching(), Equals("this string contains 'ABC' as a substring", Catch::CaseSensitive::No) ) with expansion: "this string contains 'abc' as a substring" equals: "this string contains @@ -2928,22 +2891,19 @@ Exception as a value (e.g. in REQUIRE_THROWS_MATCHES) can be stringified ToStringGeneral.tests.cpp:<line number> ............................................................................... -ToStringGeneral.tests.cpp:<line number>: -PASSED: +ToStringGeneral.tests.cpp:<line number>: PASSED: REQUIRE( ::Catch::Detail::stringify(WhatException{}) == "This exception has overriden what() method" ) with expansion: "This exception has overriden what() method" == "This exception has overriden what() method" -ToStringGeneral.tests.cpp:<line number>: -PASSED: +ToStringGeneral.tests.cpp:<line number>: PASSED: REQUIRE( ::Catch::Detail::stringify(OperatorException{}) == "OperatorException" ) with expansion: "OperatorException" == "OperatorException" -ToStringGeneral.tests.cpp:<line number>: -PASSED: +ToStringGeneral.tests.cpp:<line number>: PASSED: REQUIRE( ::Catch::Detail::stringify(StringMakerException{}) == "StringMakerException" ) with expansion: "StringMakerException" @@ -3005,14 +2965,12 @@ Exception matchers that succeed Matchers.tests.cpp:<line number> ............................................................................... -Matchers.tests.cpp:<line number>: -PASSED: +Matchers.tests.cpp:<line number>: PASSED: CHECK_THROWS_MATCHES( throws(1), SpecialException, ExceptionMatcher{1} ) with expansion: SpecialException::what special exception has value of 1 -Matchers.tests.cpp:<line number>: -PASSED: +Matchers.tests.cpp:<line number>: PASSED: REQUIRE_THROWS_MATCHES( throws(2), SpecialException, ExceptionMatcher{2} ) with expansion: SpecialException::what special exception has value of 2 @@ -3024,8 +2982,7 @@ Exception messages can be tested for Exception.tests.cpp:<line number> ............................................................................... -Exception.tests.cpp:<line number>: -PASSED: +Exception.tests.cpp:<line number>: PASSED: REQUIRE_THROWS_WITH( thisThrows(), "expected exception" ) with expansion: "expected exception" equals: "expected exception" @@ -3037,8 +2994,7 @@ Exception messages can be tested for Exception.tests.cpp:<line number> ............................................................................... -Exception.tests.cpp:<line number>: -PASSED: +Exception.tests.cpp:<line number>: PASSED: REQUIRE_THROWS_WITH( thisThrows(), Equals( "expecteD Exception", Catch::CaseSensitive::No ) ) with expansion: "expected exception" equals: "expected exception" (case insensitive) @@ -3050,26 +3006,22 @@ Exception messages can be tested for Exception.tests.cpp:<line number> ............................................................................... -Exception.tests.cpp:<line number>: -PASSED: +Exception.tests.cpp:<line number>: PASSED: REQUIRE_THROWS_WITH( thisThrows(), StartsWith( "expected" ) ) with expansion: "expected exception" starts with: "expected" -Exception.tests.cpp:<line number>: -PASSED: +Exception.tests.cpp:<line number>: PASSED: REQUIRE_THROWS_WITH( thisThrows(), EndsWith( "exception" ) ) with expansion: "expected exception" ends with: "exception" -Exception.tests.cpp:<line number>: -PASSED: +Exception.tests.cpp:<line number>: PASSED: REQUIRE_THROWS_WITH( thisThrows(), Contains( "except" ) ) with expansion: "expected exception" contains: "except" -Exception.tests.cpp:<line number>: -PASSED: +Exception.tests.cpp:<line number>: PASSED: REQUIRE_THROWS_WITH( thisThrows(), Contains( "exCept", Catch::CaseSensitive::No ) ) with expansion: "expected exception" contains: "except" (case insensitive) @@ -3122,8 +3074,7 @@ Message.tests.cpp:<line number>: FAILED: explicitly with message: This is a failure -Message.tests.cpp:<line number>: -warning: +Message.tests.cpp:<line number>: warning: This message appears in the output ------------------------------------------------------------------------------- @@ -3132,32 +3083,27 @@ Factorials are computed Misc.tests.cpp:<line number> ............................................................................... -Misc.tests.cpp:<line number>: -PASSED: +Misc.tests.cpp:<line number>: PASSED: REQUIRE( Factorial(0) == 1 ) with expansion: 1 == 1 -Misc.tests.cpp:<line number>: -PASSED: +Misc.tests.cpp:<line number>: PASSED: REQUIRE( Factorial(1) == 1 ) with expansion: 1 == 1 -Misc.tests.cpp:<line number>: -PASSED: +Misc.tests.cpp:<line number>: PASSED: REQUIRE( Factorial(2) == 2 ) with expansion: 2 == 2 -Misc.tests.cpp:<line number>: -PASSED: +Misc.tests.cpp:<line number>: PASSED: REQUIRE( Factorial(3) == 6 ) with expansion: 6 == 6 -Misc.tests.cpp:<line number>: -PASSED: +Misc.tests.cpp:<line number>: PASSED: REQUIRE( Factorial(10) == 3628800 ) with expansion: 3628800 (0x<hex digits>) == 3628800 (0x<hex digits>) @@ -3169,56 +3115,47 @@ Floating point matchers: double Matchers.tests.cpp:<line number> ............................................................................... -Matchers.tests.cpp:<line number>: -PASSED: +Matchers.tests.cpp:<line number>: PASSED: REQUIRE_THAT( 1., WithinAbs(1., 0) ) with expansion: 1.0 is within 0.0 of 1.0 -Matchers.tests.cpp:<line number>: -PASSED: +Matchers.tests.cpp:<line number>: PASSED: REQUIRE_THAT( 0., WithinAbs(1., 1) ) with expansion: 0.0 is within 1.0 of 1.0 -Matchers.tests.cpp:<line number>: -PASSED: +Matchers.tests.cpp:<line number>: PASSED: REQUIRE_THAT( 0., !WithinAbs(1., 0.99) ) with expansion: 0.0 not is within 0.99 of 1.0 -Matchers.tests.cpp:<line number>: -PASSED: +Matchers.tests.cpp:<line number>: PASSED: REQUIRE_THAT( 0., !WithinAbs(1., 0.99) ) with expansion: 0.0 not is within 0.99 of 1.0 -Matchers.tests.cpp:<line number>: -PASSED: +Matchers.tests.cpp:<line number>: PASSED: REQUIRE_THAT( NAN, !WithinAbs(NAN, 0) ) with expansion: nanf not is within 0.0 of nan -Matchers.tests.cpp:<line number>: -PASSED: +Matchers.tests.cpp:<line number>: PASSED: REQUIRE_THAT( 11., !WithinAbs(10., 0.5) ) with expansion: 11.0 not is within 0.5 of 10.0 -Matchers.tests.cpp:<line number>: -PASSED: +Matchers.tests.cpp:<line number>: PASSED: REQUIRE_THAT( 10., !WithinAbs(11., 0.5) ) with expansion: 10.0 not is within 0.5 of 11.0 -Matchers.tests.cpp:<line number>: -PASSED: +Matchers.tests.cpp:<line number>: PASSED: REQUIRE_THAT( -10., WithinAbs(-10., 0.5) ) with expansion: -10.0 is within 0.5 of -10.0 -Matchers.tests.cpp:<line number>: -PASSED: +Matchers.tests.cpp:<line number>: PASSED: REQUIRE_THAT( -10., WithinAbs(-9.6, 0.5) ) with expansion: -10.0 is within 0.5 of -9.6 @@ -3230,44 +3167,37 @@ Floating point matchers: double Matchers.tests.cpp:<line number> ............................................................................... -Matchers.tests.cpp:<line number>: -PASSED: +Matchers.tests.cpp:<line number>: PASSED: REQUIRE_THAT( 1., WithinULP(1., 0) ) with expansion: 1.0 is within 0 ULPs of 1.0 -Matchers.tests.cpp:<line number>: -PASSED: +Matchers.tests.cpp:<line number>: PASSED: REQUIRE_THAT( nextafter(1., 2.), WithinULP(1., 1) ) with expansion: 1.0 is within 1 ULPs of 1.0 -Matchers.tests.cpp:<line number>: -PASSED: +Matchers.tests.cpp:<line number>: PASSED: REQUIRE_THAT( nextafter(1., 0.), WithinULP(1., 1) ) with expansion: 1.0 is within 1 ULPs of 1.0 -Matchers.tests.cpp:<line number>: -PASSED: +Matchers.tests.cpp:<line number>: PASSED: REQUIRE_THAT( nextafter(1., 2.), !WithinULP(1., 0) ) with expansion: 1.0 not is within 0 ULPs of 1.0 -Matchers.tests.cpp:<line number>: -PASSED: +Matchers.tests.cpp:<line number>: PASSED: REQUIRE_THAT( 1., WithinULP(1., 0) ) with expansion: 1.0 is within 0 ULPs of 1.0 -Matchers.tests.cpp:<line number>: -PASSED: +Matchers.tests.cpp:<line number>: PASSED: REQUIRE_THAT( -0., WithinULP(0., 0) ) with expansion: -0.0 is within 0 ULPs of 0.0 -Matchers.tests.cpp:<line number>: -PASSED: +Matchers.tests.cpp:<line number>: PASSED: REQUIRE_THAT( NAN, !WithinULP(NAN, 123) ) with expansion: nanf not is within 123 ULPs of nanf @@ -3279,20 +3209,17 @@ Floating point matchers: double Matchers.tests.cpp:<line number> ............................................................................... -Matchers.tests.cpp:<line number>: -PASSED: +Matchers.tests.cpp:<line number>: PASSED: REQUIRE_THAT( 1., WithinAbs(1., 0.5) || WithinULP(2., 1) ) with expansion: 1.0 ( is within 0.5 of 1.0 or is within 1 ULPs of 2.0 ) -Matchers.tests.cpp:<line number>: -PASSED: +Matchers.tests.cpp:<line number>: PASSED: REQUIRE_THAT( 1., WithinAbs(2., 0.5) || WithinULP(1., 0) ) with expansion: 1.0 ( is within 0.5 of 2.0 or is within 0 ULPs of 1.0 ) -Matchers.tests.cpp:<line number>: -PASSED: +Matchers.tests.cpp:<line number>: PASSED: REQUIRE_THAT( NAN, !(WithinAbs(NAN, 100) || WithinULP(NAN, 123)) ) with expansion: nanf not ( is within 100.0 of nan or is within 123 ULPs of nanf ) @@ -3304,20 +3231,16 @@ Floating point matchers: double Matchers.tests.cpp:<line number> ............................................................................... -Matchers.tests.cpp:<line number>: -PASSED: +Matchers.tests.cpp:<line number>: PASSED: REQUIRE_NOTHROW( WithinAbs(1., 0.) ) -Matchers.tests.cpp:<line number>: -PASSED: +Matchers.tests.cpp:<line number>: PASSED: REQUIRE_THROWS_AS( WithinAbs(1., -1.), std::domain_error ) -Matchers.tests.cpp:<line number>: -PASSED: +Matchers.tests.cpp:<line number>: PASSED: REQUIRE_NOTHROW( WithinULP(1., 0) ) -Matchers.tests.cpp:<line number>: -PASSED: +Matchers.tests.cpp:<line number>: PASSED: REQUIRE_THROWS_AS( WithinULP(1., -1), std::domain_error ) ------------------------------------------------------------------------------- @@ -3327,62 +3250,52 @@ Floating point matchers: float Matchers.tests.cpp:<line number> ............................................................................... -Matchers.tests.cpp:<line number>: -PASSED: +Matchers.tests.cpp:<line number>: PASSED: REQUIRE_THAT( 1.f, WithinAbs(1.f, 0) ) with expansion: 1.0f is within 0.0 of 1.0 -Matchers.tests.cpp:<line number>: -PASSED: +Matchers.tests.cpp:<line number>: PASSED: REQUIRE_THAT( 0.f, WithinAbs(1.f, 1) ) with expansion: 0.0f is within 1.0 of 1.0 -Matchers.tests.cpp:<line number>: -PASSED: +Matchers.tests.cpp:<line number>: PASSED: REQUIRE_THAT( 0.f, !WithinAbs(1.f, 0.99f) ) with expansion: 0.0f not is within 0.9900000095 of 1.0 -Matchers.tests.cpp:<line number>: -PASSED: +Matchers.tests.cpp:<line number>: PASSED: REQUIRE_THAT( 0.f, !WithinAbs(1.f, 0.99f) ) with expansion: 0.0f not is within 0.9900000095 of 1.0 -Matchers.tests.cpp:<line number>: -PASSED: +Matchers.tests.cpp:<line number>: PASSED: REQUIRE_THAT( 0.f, WithinAbs(-0.f, 0) ) with expansion: 0.0f is within 0.0 of -0.0 -Matchers.tests.cpp:<line number>: -PASSED: +Matchers.tests.cpp:<line number>: PASSED: REQUIRE_THAT( NAN, !WithinAbs(NAN, 0) ) with expansion: nanf not is within 0.0 of nan -Matchers.tests.cpp:<line number>: -PASSED: +Matchers.tests.cpp:<line number>: PASSED: REQUIRE_THAT( 11.f, !WithinAbs(10.f, 0.5f) ) with expansion: 11.0f not is within 0.5 of 10.0 -Matchers.tests.cpp:<line number>: -PASSED: +Matchers.tests.cpp:<line number>: PASSED: REQUIRE_THAT( 10.f, !WithinAbs(11.f, 0.5f) ) with expansion: 10.0f not is within 0.5 of 11.0 -Matchers.tests.cpp:<line number>: -PASSED: +Matchers.tests.cpp:<line number>: PASSED: REQUIRE_THAT( -10.f, WithinAbs(-10.f, 0.5f) ) with expansion: -10.0f is within 0.5 of -10.0 -Matchers.tests.cpp:<line number>: -PASSED: +Matchers.tests.cpp:<line number>: PASSED: REQUIRE_THAT( -10.f, WithinAbs(-9.6f, 0.5f) ) with expansion: -10.0f is within 0.5 of -9.6000003815 @@ -3394,44 +3307,37 @@ Floating point matchers: float Matchers.tests.cpp:<line number> ............................................................................... -Matchers.tests.cpp:<line number>: -PASSED: +Matchers.tests.cpp:<line number>: PASSED: REQUIRE_THAT( 1.f, WithinULP(1.f, 0) ) with expansion: 1.0f is within 0 ULPs of 1.0f -Matchers.tests.cpp:<line number>: -PASSED: +Matchers.tests.cpp:<line number>: PASSED: REQUIRE_THAT( nextafter(1.f, 2.f), WithinULP(1.f, 1) ) with expansion: 1.0f is within 1 ULPs of 1.0f -Matchers.tests.cpp:<line number>: -PASSED: +Matchers.tests.cpp:<line number>: PASSED: REQUIRE_THAT( nextafter(1.f, 0.f), WithinULP(1.f, 1) ) with expansion: 1.0f is within 1 ULPs of 1.0f -Matchers.tests.cpp:<line number>: -PASSED: +Matchers.tests.cpp:<line number>: PASSED: REQUIRE_THAT( nextafter(1.f, 2.f), !WithinULP(1.f, 0) ) with expansion: 1.0f not is within 0 ULPs of 1.0f -Matchers.tests.cpp:<line number>: -PASSED: +Matchers.tests.cpp:<line number>: PASSED: REQUIRE_THAT( 1.f, WithinULP(1.f, 0) ) with expansion: 1.0f is within 0 ULPs of 1.0f -Matchers.tests.cpp:<line number>: -PASSED: +Matchers.tests.cpp:<line number>: PASSED: REQUIRE_THAT( -0.f, WithinULP(0.f, 0) ) with expansion: -0.0f is within 0 ULPs of 0.0f -Matchers.tests.cpp:<line number>: -PASSED: +Matchers.tests.cpp:<line number>: PASSED: REQUIRE_THAT( NAN, !WithinULP(NAN, 123) ) with expansion: nanf not is within 123 ULPs of nanf @@ -3443,20 +3349,17 @@ Floating point matchers: float Matchers.tests.cpp:<line number> ............................................................................... -Matchers.tests.cpp:<line number>: -PASSED: +Matchers.tests.cpp:<line number>: PASSED: REQUIRE_THAT( 1.f, WithinAbs(1.f, 0.5) || WithinULP(1.f, 1) ) with expansion: 1.0f ( is within 0.5 of 1.0 or is within 1 ULPs of 1.0f ) -Matchers.tests.cpp:<line number>: -PASSED: +Matchers.tests.cpp:<line number>: PASSED: REQUIRE_THAT( 1.f, WithinAbs(2.f, 0.5) || WithinULP(1.f, 0) ) with expansion: 1.0f ( is within 0.5 of 2.0 or is within 0 ULPs of 1.0f ) -Matchers.tests.cpp:<line number>: -PASSED: +Matchers.tests.cpp:<line number>: PASSED: REQUIRE_THAT( NAN, !(WithinAbs(NAN, 100) || WithinULP(NAN, 123)) ) with expansion: nanf not ( is within 100.0 of nan or is within 123 ULPs of nanf ) @@ -3468,20 +3371,16 @@ Floating point matchers: float Matchers.tests.cpp:<line number> ............................................................................... -Matchers.tests.cpp:<line number>: -PASSED: +Matchers.tests.cpp:<line number>: PASSED: REQUIRE_NOTHROW( WithinAbs(1.f, 0.f) ) -Matchers.tests.cpp:<line number>: -PASSED: +Matchers.tests.cpp:<line number>: PASSED: REQUIRE_THROWS_AS( WithinAbs(1.f, -1.f), std::domain_error ) -Matchers.tests.cpp:<line number>: -PASSED: +Matchers.tests.cpp:<line number>: PASSED: REQUIRE_NOTHROW( WithinULP(1.f, 0) ) -Matchers.tests.cpp:<line number>: -PASSED: +Matchers.tests.cpp:<line number>: PASSED: REQUIRE_THROWS_AS( WithinULP(1.f, -1), std::domain_error ) ------------------------------------------------------------------------------- @@ -3491,8 +3390,7 @@ Generators Generators.tests.cpp:<line number> ............................................................................... -Generators.tests.cpp:<line number>: -PASSED: +Generators.tests.cpp:<line number>: PASSED: with messages: i := "a" j := 8 @@ -3504,8 +3402,7 @@ Generators Generators.tests.cpp:<line number> ............................................................................... -Generators.tests.cpp:<line number>: -PASSED: +Generators.tests.cpp:<line number>: PASSED: with messages: i := "a" j := 9 @@ -3517,8 +3414,7 @@ Generators Generators.tests.cpp:<line number> ............................................................................... -Generators.tests.cpp:<line number>: -PASSED: +Generators.tests.cpp:<line number>: PASSED: with messages: i := "a" j := 10 @@ -3530,8 +3426,7 @@ Generators Generators.tests.cpp:<line number> ............................................................................... -Generators.tests.cpp:<line number>: -PASSED: +Generators.tests.cpp:<line number>: PASSED: with messages: i := "a" j := 2 @@ -3543,8 +3438,7 @@ Generators Generators.tests.cpp:<line number> ............................................................................... -Generators.tests.cpp:<line number>: -PASSED: +Generators.tests.cpp:<line number>: PASSED: with messages: i := "a" j := 3.141 @@ -3556,8 +3450,7 @@ Generators Generators.tests.cpp:<line number> ............................................................................... -Generators.tests.cpp:<line number>: -PASSED: +Generators.tests.cpp:<line number>: PASSED: with messages: i := "a" j := 1.379 @@ -3569,8 +3462,7 @@ Generators Generators.tests.cpp:<line number> ............................................................................... -Generators.tests.cpp:<line number>: -PASSED: +Generators.tests.cpp:<line number>: PASSED: with messages: i := "b" j := 8 @@ -3582,8 +3474,7 @@ Generators Generators.tests.cpp:<line number> ............................................................................... -Generators.tests.cpp:<line number>: -PASSED: +Generators.tests.cpp:<line number>: PASSED: with messages: i := "b" j := 9 @@ -3595,8 +3486,7 @@ Generators Generators.tests.cpp:<line number> ............................................................................... -Generators.tests.cpp:<line number>: -PASSED: +Generators.tests.cpp:<line number>: PASSED: with messages: i := "b" j := 10 @@ -3608,8 +3498,7 @@ Generators Generators.tests.cpp:<line number> ............................................................................... -Generators.tests.cpp:<line number>: -PASSED: +Generators.tests.cpp:<line number>: PASSED: with messages: i := "b" j := 2 @@ -3621,8 +3510,7 @@ Generators Generators.tests.cpp:<line number> ............................................................................... -Generators.tests.cpp:<line number>: -PASSED: +Generators.tests.cpp:<line number>: PASSED: with messages: i := "b" j := 3.141 @@ -3634,8 +3522,7 @@ Generators Generators.tests.cpp:<line number> ............................................................................... -Generators.tests.cpp:<line number>: -PASSED: +Generators.tests.cpp:<line number>: PASSED: with messages: i := "b" j := 1.379 @@ -3647,8 +3534,7 @@ Generators Generators.tests.cpp:<line number> ............................................................................... -Generators.tests.cpp:<line number>: -PASSED: +Generators.tests.cpp:<line number>: PASSED: with messages: i := "c" j := 8 @@ -3660,8 +3546,7 @@ Generators Generators.tests.cpp:<line number> ............................................................................... -Generators.tests.cpp:<line number>: -PASSED: +Generators.tests.cpp:<line number>: PASSED: with messages: i := "c" j := 9 @@ -3673,8 +3558,7 @@ Generators Generators.tests.cpp:<line number> ............................................................................... -Generators.tests.cpp:<line number>: -PASSED: +Generators.tests.cpp:<line number>: PASSED: with messages: i := "c" j := 10 @@ -3686,8 +3570,7 @@ Generators Generators.tests.cpp:<line number> ............................................................................... -Generators.tests.cpp:<line number>: -PASSED: +Generators.tests.cpp:<line number>: PASSED: with messages: i := "c" j := 2 @@ -3699,8 +3582,7 @@ Generators Generators.tests.cpp:<line number> ............................................................................... -Generators.tests.cpp:<line number>: -PASSED: +Generators.tests.cpp:<line number>: PASSED: with messages: i := "c" j := 3.141 @@ -3712,8 +3594,7 @@ Generators Generators.tests.cpp:<line number> ............................................................................... -Generators.tests.cpp:<line number>: -PASSED: +Generators.tests.cpp:<line number>: PASSED: with messages: i := "c" j := 1.379 @@ -3725,20 +3606,17 @@ Generators impl GeneratorsImpl.tests.cpp:<line number> ............................................................................... -GeneratorsImpl.tests.cpp:<line number>: -PASSED: +GeneratorsImpl.tests.cpp:<line number>: PASSED: CHECK( gen.size() == 2 ) with expansion: 2 == 2 -GeneratorsImpl.tests.cpp:<line number>: -PASSED: +GeneratorsImpl.tests.cpp:<line number>: PASSED: CHECK( gen[0] == 1 ) with expansion: 1 == 1 -GeneratorsImpl.tests.cpp:<line number>: -PASSED: +GeneratorsImpl.tests.cpp:<line number>: PASSED: CHECK( gen[1] == 2 ) with expansion: 2 == 2 @@ -3750,32 +3628,27 @@ Generators impl GeneratorsImpl.tests.cpp:<line number> ............................................................................... -GeneratorsImpl.tests.cpp:<line number>: -PASSED: +GeneratorsImpl.tests.cpp:<line number>: PASSED: CHECK( gen.size() == 4 ) with expansion: 4 == 4 -GeneratorsImpl.tests.cpp:<line number>: -PASSED: +GeneratorsImpl.tests.cpp:<line number>: PASSED: CHECK( gen[0] == 3 ) with expansion: 3 == 3 -GeneratorsImpl.tests.cpp:<line number>: -PASSED: +GeneratorsImpl.tests.cpp:<line number>: PASSED: CHECK( gen[1] == 1 ) with expansion: 1 == 1 -GeneratorsImpl.tests.cpp:<line number>: -PASSED: +GeneratorsImpl.tests.cpp:<line number>: PASSED: CHECK( gen[2] == 4 ) with expansion: 4 == 4 -GeneratorsImpl.tests.cpp:<line number>: -PASSED: +GeneratorsImpl.tests.cpp:<line number>: PASSED: CHECK( gen[3] == 1 ) with expansion: 1 == 1 @@ -3787,32 +3660,27 @@ Generators impl GeneratorsImpl.tests.cpp:<line number> ............................................................................... -GeneratorsImpl.tests.cpp:<line number>: -PASSED: +GeneratorsImpl.tests.cpp:<line number>: PASSED: CHECK( gen.size() == 4 ) with expansion: 4 == 4 -GeneratorsImpl.tests.cpp:<line number>: -PASSED: +GeneratorsImpl.tests.cpp:<line number>: PASSED: CHECK( gen[0] == 1 ) with expansion: 1 == 1 -GeneratorsImpl.tests.cpp:<line number>: -PASSED: +GeneratorsImpl.tests.cpp:<line number>: PASSED: CHECK( gen[1] == 2 ) with expansion: 2 == 2 -GeneratorsImpl.tests.cpp:<line number>: -PASSED: +GeneratorsImpl.tests.cpp:<line number>: PASSED: CHECK( gen[2] == 9 ) with expansion: 9 == 9 -GeneratorsImpl.tests.cpp:<line number>: -PASSED: +GeneratorsImpl.tests.cpp:<line number>: PASSED: CHECK( gen[3] == 7 ) with expansion: 7 == 7 @@ -3824,20 +3692,17 @@ Generators impl GeneratorsImpl.tests.cpp:<line number> ............................................................................... -GeneratorsImpl.tests.cpp:<line number>: -PASSED: +GeneratorsImpl.tests.cpp:<line number>: PASSED: CHECK( gen.size() == 2 ) with expansion: 2 == 2 -GeneratorsImpl.tests.cpp:<line number>: -PASSED: +GeneratorsImpl.tests.cpp:<line number>: PASSED: CHECK( gen[0] == 3 ) with expansion: 3 == 3 -GeneratorsImpl.tests.cpp:<line number>: -PASSED: +GeneratorsImpl.tests.cpp:<line number>: PASSED: CHECK( gen[1] == 1 ) with expansion: 1 == 1 @@ -3849,20 +3714,17 @@ Generators impl GeneratorsImpl.tests.cpp:<line number> ............................................................................... -GeneratorsImpl.tests.cpp:<line number>: -PASSED: +GeneratorsImpl.tests.cpp:<line number>: PASSED: CHECK( gen.size() == 2 ) with expansion: 2 == 2 -GeneratorsImpl.tests.cpp:<line number>: -PASSED: +GeneratorsImpl.tests.cpp:<line number>: PASSED: CHECK( gen[0] == 3 ) with expansion: 3 == 3 -GeneratorsImpl.tests.cpp:<line number>: -PASSED: +GeneratorsImpl.tests.cpp:<line number>: PASSED: CHECK( gen[1] == 1 ) with expansion: 1 == 1 @@ -3874,32 +3736,27 @@ Generators impl GeneratorsImpl.tests.cpp:<line number> ............................................................................... -GeneratorsImpl.tests.cpp:<line number>: -PASSED: +GeneratorsImpl.tests.cpp:<line number>: PASSED: CHECK( base->size() == 4 ) with expansion: 4 == 4 -GeneratorsImpl.tests.cpp:<line number>: -PASSED: +GeneratorsImpl.tests.cpp:<line number>: PASSED: REQUIRE( typed ) with expansion: 0x<hex digits> -GeneratorsImpl.tests.cpp:<line number>: -PASSED: +GeneratorsImpl.tests.cpp:<line number>: PASSED: CHECK( typed->size() == 4 ) with expansion: 4 == 4 -GeneratorsImpl.tests.cpp:<line number>: -PASSED: +GeneratorsImpl.tests.cpp:<line number>: PASSED: CHECK( (*typed)[0] == 7 ) with expansion: 7 == 7 -GeneratorsImpl.tests.cpp:<line number>: -PASSED: +GeneratorsImpl.tests.cpp:<line number>: PASSED: CHECK( (*typed)[3] == 11 ) with expansion: 11 == 11 @@ -3910,26 +3767,22 @@ Greater-than inequalities with different epsilons Approx.tests.cpp:<line number> ............................................................................... -Approx.tests.cpp:<line number>: -PASSED: +Approx.tests.cpp:<line number>: PASSED: REQUIRE( d >= Approx( 1.22 ) ) with expansion: 1.23 >= Approx( 1.22 ) -Approx.tests.cpp:<line number>: -PASSED: +Approx.tests.cpp:<line number>: PASSED: REQUIRE( d >= Approx( 1.23 ) ) with expansion: 1.23 >= Approx( 1.23 ) -Approx.tests.cpp:<line number>: -PASSED: +Approx.tests.cpp:<line number>: PASSED: REQUIRE_FALSE( d >= Approx( 1.24 ) ) with expansion: !(1.23 >= Approx( 1.24 )) -Approx.tests.cpp:<line number>: -PASSED: +Approx.tests.cpp:<line number>: PASSED: REQUIRE( d >= Approx( 1.24 ).epsilon(0.1) ) with expansion: 1.23 >= Approx( 1.24 ) @@ -3940,8 +3793,7 @@ INFO and WARN do not abort tests Message.tests.cpp:<line number> ............................................................................... -Message.tests.cpp:<line number>: -warning: +Message.tests.cpp:<line number>: warning: this is a message this is a warning @@ -3968,8 +3820,7 @@ INFO gets logged on failure, even if captured before successful assertions Message.tests.cpp:<line number> ............................................................................... -Message.tests.cpp:<line number>: -PASSED: +Message.tests.cpp:<line number>: PASSED: CHECK( a == 2 ) with expansion: 2 == 2 @@ -3993,8 +3844,7 @@ with messages: this message should be logged and this, but later -Message.tests.cpp:<line number>: -PASSED: +Message.tests.cpp:<line number>: PASSED: CHECK( a == 2 ) with expansion: 2 == 2 @@ -4010,8 +3860,7 @@ INFO is reset for each loop Message.tests.cpp:<line number> ............................................................................... -Message.tests.cpp:<line number>: -PASSED: +Message.tests.cpp:<line number>: PASSED: REQUIRE( i < 10 ) with expansion: 0 < 10 @@ -4019,8 +3868,7 @@ with messages: current counter 0 i := 0 -Message.tests.cpp:<line number>: -PASSED: +Message.tests.cpp:<line number>: PASSED: REQUIRE( i < 10 ) with expansion: 1 < 10 @@ -4028,8 +3876,7 @@ with messages: current counter 1 i := 1 -Message.tests.cpp:<line number>: -PASSED: +Message.tests.cpp:<line number>: PASSED: REQUIRE( i < 10 ) with expansion: 2 < 10 @@ -4037,8 +3884,7 @@ with messages: current counter 2 i := 2 -Message.tests.cpp:<line number>: -PASSED: +Message.tests.cpp:<line number>: PASSED: REQUIRE( i < 10 ) with expansion: 3 < 10 @@ -4046,8 +3892,7 @@ with messages: current counter 3 i := 3 -Message.tests.cpp:<line number>: -PASSED: +Message.tests.cpp:<line number>: PASSED: REQUIRE( i < 10 ) with expansion: 4 < 10 @@ -4055,8 +3900,7 @@ with messages: current counter 4 i := 4 -Message.tests.cpp:<line number>: -PASSED: +Message.tests.cpp:<line number>: PASSED: REQUIRE( i < 10 ) with expansion: 5 < 10 @@ -4064,8 +3908,7 @@ with messages: current counter 5 i := 5 -Message.tests.cpp:<line number>: -PASSED: +Message.tests.cpp:<line number>: PASSED: REQUIRE( i < 10 ) with expansion: 6 < 10 @@ -4073,8 +3916,7 @@ with messages: current counter 6 i := 6 -Message.tests.cpp:<line number>: -PASSED: +Message.tests.cpp:<line number>: PASSED: REQUIRE( i < 10 ) with expansion: 7 < 10 @@ -4082,8 +3924,7 @@ with messages: current counter 7 i := 7 -Message.tests.cpp:<line number>: -PASSED: +Message.tests.cpp:<line number>: PASSED: REQUIRE( i < 10 ) with expansion: 8 < 10 @@ -4091,8 +3932,7 @@ with messages: current counter 8 i := 8 -Message.tests.cpp:<line number>: -PASSED: +Message.tests.cpp:<line number>: PASSED: REQUIRE( i < 10 ) with expansion: 9 < 10 @@ -4145,68 +3985,57 @@ Inequality checks that should succeed Condition.tests.cpp:<line number> ............................................................................... -Condition.tests.cpp:<line number>: -PASSED: +Condition.tests.cpp:<line number>: PASSED: REQUIRE( data.int_seven != 6 ) with expansion: 7 != 6 -Condition.tests.cpp:<line number>: -PASSED: +Condition.tests.cpp:<line number>: PASSED: REQUIRE( data.int_seven != 8 ) with expansion: 7 != 8 -Condition.tests.cpp:<line number>: -PASSED: +Condition.tests.cpp:<line number>: PASSED: REQUIRE( data.float_nine_point_one != Approx( 9.11f ) ) with expansion: 9.1f != Approx( 9.1099996567 ) -Condition.tests.cpp:<line number>: -PASSED: +Condition.tests.cpp:<line number>: PASSED: REQUIRE( data.float_nine_point_one != Approx( 9.0f ) ) with expansion: 9.1f != Approx( 9.0 ) -Condition.tests.cpp:<line number>: -PASSED: +Condition.tests.cpp:<line number>: PASSED: REQUIRE( data.float_nine_point_one != Approx( 1 ) ) with expansion: 9.1f != Approx( 1.0 ) -Condition.tests.cpp:<line number>: -PASSED: +Condition.tests.cpp:<line number>: PASSED: REQUIRE( data.float_nine_point_one != Approx( 0 ) ) with expansion: 9.1f != Approx( 0.0 ) -Condition.tests.cpp:<line number>: -PASSED: +Condition.tests.cpp:<line number>: PASSED: REQUIRE( data.double_pi != Approx( 3.1415 ) ) with expansion: 3.1415926535 != Approx( 3.1415 ) -Condition.tests.cpp:<line number>: -PASSED: +Condition.tests.cpp:<line number>: PASSED: REQUIRE( data.str_hello != "goodbye" ) with expansion: "hello" != "goodbye" -Condition.tests.cpp:<line number>: -PASSED: +Condition.tests.cpp:<line number>: PASSED: REQUIRE( data.str_hello != "hell" ) with expansion: "hello" != "hell" -Condition.tests.cpp:<line number>: -PASSED: +Condition.tests.cpp:<line number>: PASSED: REQUIRE( data.str_hello != "hello1" ) with expansion: "hello" != "hello1" -Condition.tests.cpp:<line number>: -PASSED: +Condition.tests.cpp:<line number>: PASSED: REQUIRE( data.str_hello.size() != 6 ) with expansion: 5 != 6 @@ -4217,26 +4046,22 @@ Less-than inequalities with different epsilons Approx.tests.cpp:<line number> ............................................................................... -Approx.tests.cpp:<line number>: -PASSED: +Approx.tests.cpp:<line number>: PASSED: REQUIRE( d <= Approx( 1.24 ) ) with expansion: 1.23 <= Approx( 1.24 ) -Approx.tests.cpp:<line number>: -PASSED: +Approx.tests.cpp:<line number>: PASSED: REQUIRE( d <= Approx( 1.23 ) ) with expansion: 1.23 <= Approx( 1.23 ) -Approx.tests.cpp:<line number>: -PASSED: +Approx.tests.cpp:<line number>: PASSED: REQUIRE_FALSE( d <= Approx( 1.22 ) ) with expansion: !(1.23 <= Approx( 1.22 )) -Approx.tests.cpp:<line number>: -PASSED: +Approx.tests.cpp:<line number>: PASSED: REQUIRE( d <= Approx( 1.22 ).epsilon(0.1) ) with expansion: 1.23 <= Approx( 1.22 ) @@ -4247,8 +4072,7 @@ ManuallyRegistered Misc.tests.cpp:<line number> ............................................................................... -Misc.tests.cpp:<line number>: -PASSED: +Misc.tests.cpp:<line number>: PASSED: with message: was called @@ -4258,8 +4082,7 @@ Matchers can be (AllOf) composed with the && operator Matchers.tests.cpp:<line number> ............................................................................... -Matchers.tests.cpp:<line number>: -PASSED: +Matchers.tests.cpp:<line number>: PASSED: CHECK_THAT( testStringForMatching(), Contains("string") && Contains("abc") && Contains("substring") && Contains("contains") ) with expansion: "this string contains 'abc' as a substring" ( contains: "string" and @@ -4271,15 +4094,13 @@ Matchers can be (AnyOf) composed with the || operator Matchers.tests.cpp:<line number> ............................................................................... -Matchers.tests.cpp:<line number>: -PASSED: +Matchers.tests.cpp:<line number>: PASSED: CHECK_THAT( testStringForMatching(), Contains("string") || Contains("different") || Contains("random") ) with expansion: "this string contains 'abc' as a substring" ( contains: "string" or contains: "different" or contains: "random" ) -Matchers.tests.cpp:<line number>: -PASSED: +Matchers.tests.cpp:<line number>: PASSED: CHECK_THAT( testStringForMatching2(), Contains("string") || Contains("different") || Contains("random") ) with expansion: "some completely different text that contains one common word" ( contains: @@ -4291,8 +4112,7 @@ Matchers can be composed with both && and || Matchers.tests.cpp:<line number> ............................................................................... -Matchers.tests.cpp:<line number>: -PASSED: +Matchers.tests.cpp:<line number>: PASSED: CHECK_THAT( testStringForMatching(), (Contains("string") || Contains("different")) && Contains("substring") ) with expansion: "this string contains 'abc' as a substring" ( ( contains: "string" or @@ -4316,8 +4136,7 @@ Matchers can be negated (Not) with the ! operator Matchers.tests.cpp:<line number> ............................................................................... -Matchers.tests.cpp:<line number>: -PASSED: +Matchers.tests.cpp:<line number>: PASSED: CHECK_THAT( testStringForMatching(), !Contains("different") ) with expansion: "this string contains 'abc' as a substring" not contains: "different" @@ -4339,8 +4158,7 @@ Mismatching exception messages failing the test Exception.tests.cpp:<line number> ............................................................................... -Exception.tests.cpp:<line number>: -PASSED: +Exception.tests.cpp:<line number>: PASSED: REQUIRE_THROWS_WITH( thisThrows(), "expected exception" ) with expansion: "expected exception" equals: "expected exception" @@ -4356,8 +4174,7 @@ Nice descriptive name Misc.tests.cpp:<line number> ............................................................................... -Misc.tests.cpp:<line number>: -warning: +Misc.tests.cpp:<line number>: warning: This one ran @@ -4379,24 +4196,35 @@ Objects that evaluated in boolean contexts can be checked Tricky.tests.cpp:<line number> ............................................................................... -Tricky.tests.cpp:<line number>: -PASSED: +Tricky.tests.cpp:<line number>: PASSED: CHECK( True ) with expansion: {?} -Tricky.tests.cpp:<line number>: -PASSED: +Tricky.tests.cpp:<line number>: PASSED: CHECK( !False ) with expansion: true -Tricky.tests.cpp:<line number>: -PASSED: +Tricky.tests.cpp:<line number>: PASSED: CHECK_FALSE( False ) with expansion: !{?} +------------------------------------------------------------------------------- +Optionally static assertions +------------------------------------------------------------------------------- +Compilation.tests.cpp:<line number> +............................................................................... + +Compilation.tests.cpp:<line number>: PASSED: +with message: + std::is_void<void>::value + +Compilation.tests.cpp:<line number>: PASSED: +with message: + !(std::is_void<int>::value) + ------------------------------------------------------------------------------- Ordering comparison checks that should fail ------------------------------------------------------------------------------- @@ -4504,104 +4332,87 @@ Ordering comparison checks that should succeed Condition.tests.cpp:<line number> ............................................................................... -Condition.tests.cpp:<line number>: -PASSED: +Condition.tests.cpp:<line number>: PASSED: REQUIRE( data.int_seven < 8 ) with expansion: 7 < 8 -Condition.tests.cpp:<line number>: -PASSED: +Condition.tests.cpp:<line number>: PASSED: REQUIRE( data.int_seven > 6 ) with expansion: 7 > 6 -Condition.tests.cpp:<line number>: -PASSED: +Condition.tests.cpp:<line number>: PASSED: REQUIRE( data.int_seven > 0 ) with expansion: 7 > 0 -Condition.tests.cpp:<line number>: -PASSED: +Condition.tests.cpp:<line number>: PASSED: REQUIRE( data.int_seven > -1 ) with expansion: 7 > -1 -Condition.tests.cpp:<line number>: -PASSED: +Condition.tests.cpp:<line number>: PASSED: REQUIRE( data.int_seven >= 7 ) with expansion: 7 >= 7 -Condition.tests.cpp:<line number>: -PASSED: +Condition.tests.cpp:<line number>: PASSED: REQUIRE( data.int_seven >= 6 ) with expansion: 7 >= 6 -Condition.tests.cpp:<line number>: -PASSED: +Condition.tests.cpp:<line number>: PASSED: REQUIRE( data.int_seven <= 7 ) with expansion: 7 <= 7 -Condition.tests.cpp:<line number>: -PASSED: +Condition.tests.cpp:<line number>: PASSED: REQUIRE( data.int_seven <= 8 ) with expansion: 7 <= 8 -Condition.tests.cpp:<line number>: -PASSED: +Condition.tests.cpp:<line number>: PASSED: REQUIRE( data.float_nine_point_one > 9 ) with expansion: 9.1f > 9 -Condition.tests.cpp:<line number>: -PASSED: +Condition.tests.cpp:<line number>: PASSED: REQUIRE( data.float_nine_point_one < 10 ) with expansion: 9.1f < 10 -Condition.tests.cpp:<line number>: -PASSED: +Condition.tests.cpp:<line number>: PASSED: REQUIRE( data.float_nine_point_one < 9.2 ) with expansion: 9.1f < 9.2 -Condition.tests.cpp:<line number>: -PASSED: +Condition.tests.cpp:<line number>: PASSED: REQUIRE( data.str_hello <= "hello" ) with expansion: "hello" <= "hello" -Condition.tests.cpp:<line number>: -PASSED: +Condition.tests.cpp:<line number>: PASSED: REQUIRE( data.str_hello >= "hello" ) with expansion: "hello" >= "hello" -Condition.tests.cpp:<line number>: -PASSED: +Condition.tests.cpp:<line number>: PASSED: REQUIRE( data.str_hello < "hellp" ) with expansion: "hello" < "hellp" -Condition.tests.cpp:<line number>: -PASSED: +Condition.tests.cpp:<line number>: PASSED: REQUIRE( data.str_hello < "zebra" ) with expansion: "hello" < "zebra" -Condition.tests.cpp:<line number>: -PASSED: +Condition.tests.cpp:<line number>: PASSED: REQUIRE( data.str_hello > "hellm" ) with expansion: "hello" > "hellm" -Condition.tests.cpp:<line number>: -PASSED: +Condition.tests.cpp:<line number>: PASSED: REQUIRE( data.str_hello > "a" ) with expansion: "hello" > "a" @@ -4635,20 +4446,17 @@ Parse test names and tags CmdLine.tests.cpp:<line number> ............................................................................... -CmdLine.tests.cpp:<line number>: -PASSED: +CmdLine.tests.cpp:<line number>: PASSED: CHECK( spec.hasFilters() == false ) with expansion: false == false -CmdLine.tests.cpp:<line number>: -PASSED: +CmdLine.tests.cpp:<line number>: PASSED: CHECK( spec.matches( tcA ) == false ) with expansion: false == false -CmdLine.tests.cpp:<line number>: -PASSED: +CmdLine.tests.cpp:<line number>: PASSED: CHECK( spec.matches( tcB ) == false ) with expansion: false == false @@ -4660,20 +4468,17 @@ Parse test names and tags CmdLine.tests.cpp:<line number> ............................................................................... -CmdLine.tests.cpp:<line number>: -PASSED: +CmdLine.tests.cpp:<line number>: PASSED: CHECK( spec.hasFilters() == false ) with expansion: false == false -CmdLine.tests.cpp:<line number>: -PASSED: +CmdLine.tests.cpp:<line number>: PASSED: CHECK( spec.matches(tcA ) == false ) with expansion: false == false -CmdLine.tests.cpp:<line number>: -PASSED: +CmdLine.tests.cpp:<line number>: PASSED: CHECK( spec.matches( tcB ) == false ) with expansion: false == false @@ -4685,20 +4490,17 @@ Parse test names and tags CmdLine.tests.cpp:<line number> ............................................................................... -CmdLine.tests.cpp:<line number>: -PASSED: +CmdLine.tests.cpp:<line number>: PASSED: CHECK( spec.hasFilters() == false ) with expansion: false == false -CmdLine.tests.cpp:<line number>: -PASSED: +CmdLine.tests.cpp:<line number>: PASSED: CHECK( spec.matches( tcA ) == false ) with expansion: false == false -CmdLine.tests.cpp:<line number>: -PASSED: +CmdLine.tests.cpp:<line number>: PASSED: CHECK( spec.matches( tcB ) == false ) with expansion: false == false @@ -4710,20 +4512,17 @@ Parse test names and tags CmdLine.tests.cpp:<line number> ............................................................................... -CmdLine.tests.cpp:<line number>: -PASSED: +CmdLine.tests.cpp:<line number>: PASSED: CHECK( spec.hasFilters() == true ) with expansion: true == true -CmdLine.tests.cpp:<line number>: -PASSED: +CmdLine.tests.cpp:<line number>: PASSED: CHECK( spec.matches( tcA ) == false ) with expansion: false == false -CmdLine.tests.cpp:<line number>: -PASSED: +CmdLine.tests.cpp:<line number>: PASSED: CHECK( spec.matches( tcB ) == true ) with expansion: true == true @@ -4735,20 +4534,17 @@ Parse test names and tags CmdLine.tests.cpp:<line number> ............................................................................... -CmdLine.tests.cpp:<line number>: -PASSED: +CmdLine.tests.cpp:<line number>: PASSED: CHECK( spec.hasFilters() == true ) with expansion: true == true -CmdLine.tests.cpp:<line number>: -PASSED: +CmdLine.tests.cpp:<line number>: PASSED: CHECK( spec.matches( tcA ) == false ) with expansion: false == false -CmdLine.tests.cpp:<line number>: -PASSED: +CmdLine.tests.cpp:<line number>: PASSED: CHECK( spec.matches( tcB ) == true ) with expansion: true == true @@ -4760,26 +4556,22 @@ Parse test names and tags CmdLine.tests.cpp:<line number> ............................................................................... -CmdLine.tests.cpp:<line number>: -PASSED: +CmdLine.tests.cpp:<line number>: PASSED: CHECK( spec.hasFilters() == true ) with expansion: true == true -CmdLine.tests.cpp:<line number>: -PASSED: +CmdLine.tests.cpp:<line number>: PASSED: CHECK( spec.matches( tcA ) == false ) with expansion: false == false -CmdLine.tests.cpp:<line number>: -PASSED: +CmdLine.tests.cpp:<line number>: PASSED: CHECK( spec.matches( tcB ) == true ) with expansion: true == true -CmdLine.tests.cpp:<line number>: -PASSED: +CmdLine.tests.cpp:<line number>: PASSED: CHECK( spec.matches( tcC ) == false ) with expansion: false == false @@ -4791,38 +4583,32 @@ Parse test names and tags CmdLine.tests.cpp:<line number> ............................................................................... -CmdLine.tests.cpp:<line number>: -PASSED: +CmdLine.tests.cpp:<line number>: PASSED: CHECK( spec.hasFilters() == true ) with expansion: true == true -CmdLine.tests.cpp:<line number>: -PASSED: +CmdLine.tests.cpp:<line number>: PASSED: CHECK( spec.matches( tcA ) == false ) with expansion: false == false -CmdLine.tests.cpp:<line number>: -PASSED: +CmdLine.tests.cpp:<line number>: PASSED: CHECK( spec.matches( tcB ) == false ) with expansion: false == false -CmdLine.tests.cpp:<line number>: -PASSED: +CmdLine.tests.cpp:<line number>: PASSED: CHECK( spec.matches( tcC ) == true ) with expansion: true == true -CmdLine.tests.cpp:<line number>: -PASSED: +CmdLine.tests.cpp:<line number>: PASSED: CHECK( spec.matches( tcD ) == false ) with expansion: false == false -CmdLine.tests.cpp:<line number>: -PASSED: +CmdLine.tests.cpp:<line number>: PASSED: CHECK( parseTestSpec( "*a" ).matches( tcA ) == true ) with expansion: true == true @@ -4834,38 +4620,32 @@ Parse test names and tags CmdLine.tests.cpp:<line number> ............................................................................... -CmdLine.tests.cpp:<line number>: -PASSED: +CmdLine.tests.cpp:<line number>: PASSED: CHECK( spec.hasFilters() == true ) with expansion: true == true -CmdLine.tests.cpp:<line number>: -PASSED: +CmdLine.tests.cpp:<line number>: PASSED: CHECK( spec.matches( tcA ) == false ) with expansion: false == false -CmdLine.tests.cpp:<line number>: -PASSED: +CmdLine.tests.cpp:<line number>: PASSED: CHECK( spec.matches( tcB ) == false ) with expansion: false == false -CmdLine.tests.cpp:<line number>: -PASSED: +CmdLine.tests.cpp:<line number>: PASSED: CHECK( spec.matches( tcC ) == true ) with expansion: true == true -CmdLine.tests.cpp:<line number>: -PASSED: +CmdLine.tests.cpp:<line number>: PASSED: CHECK( spec.matches( tcD ) == false ) with expansion: false == false -CmdLine.tests.cpp:<line number>: -PASSED: +CmdLine.tests.cpp:<line number>: PASSED: CHECK( parseTestSpec( "a*" ).matches( tcA ) == true ) with expansion: true == true @@ -4877,38 +4657,32 @@ Parse test names and tags CmdLine.tests.cpp:<line number> ............................................................................... -CmdLine.tests.cpp:<line number>: -PASSED: +CmdLine.tests.cpp:<line number>: PASSED: CHECK( spec.hasFilters() == true ) with expansion: true == true -CmdLine.tests.cpp:<line number>: -PASSED: +CmdLine.tests.cpp:<line number>: PASSED: CHECK( spec.matches( tcA ) == false ) with expansion: false == false -CmdLine.tests.cpp:<line number>: -PASSED: +CmdLine.tests.cpp:<line number>: PASSED: CHECK( spec.matches( tcB ) == false ) with expansion: false == false -CmdLine.tests.cpp:<line number>: -PASSED: +CmdLine.tests.cpp:<line number>: PASSED: CHECK( spec.matches( tcC ) == true ) with expansion: true == true -CmdLine.tests.cpp:<line number>: -PASSED: +CmdLine.tests.cpp:<line number>: PASSED: CHECK( spec.matches( tcD ) == true ) with expansion: true == true -CmdLine.tests.cpp:<line number>: -PASSED: +CmdLine.tests.cpp:<line number>: PASSED: CHECK( parseTestSpec( "*a*" ).matches( tcA ) == true ) with expansion: true == true @@ -4920,20 +4694,17 @@ Parse test names and tags CmdLine.tests.cpp:<line number> ............................................................................... -CmdLine.tests.cpp:<line number>: -PASSED: +CmdLine.tests.cpp:<line number>: PASSED: CHECK( spec.hasFilters() == true ) with expansion: true == true -CmdLine.tests.cpp:<line number>: -PASSED: +CmdLine.tests.cpp:<line number>: PASSED: CHECK( spec.matches( tcA ) == true ) with expansion: true == true -CmdLine.tests.cpp:<line number>: -PASSED: +CmdLine.tests.cpp:<line number>: PASSED: CHECK( spec.matches( tcB ) == false ) with expansion: false == false @@ -4945,20 +4716,17 @@ Parse test names and tags CmdLine.tests.cpp:<line number> ............................................................................... -CmdLine.tests.cpp:<line number>: -PASSED: +CmdLine.tests.cpp:<line number>: PASSED: CHECK( spec.hasFilters() == true ) with expansion: true == true -CmdLine.tests.cpp:<line number>: -PASSED: +CmdLine.tests.cpp:<line number>: PASSED: CHECK( spec.matches( tcA ) == true ) with expansion: true == true -CmdLine.tests.cpp:<line number>: -PASSED: +CmdLine.tests.cpp:<line number>: PASSED: CHECK( spec.matches( tcB ) == false ) with expansion: false == false @@ -4970,20 +4738,17 @@ Parse test names and tags CmdLine.tests.cpp:<line number> ............................................................................... -CmdLine.tests.cpp:<line number>: -PASSED: +CmdLine.tests.cpp:<line number>: PASSED: CHECK( spec.hasFilters() == true ) with expansion: true == true -CmdLine.tests.cpp:<line number>: -PASSED: +CmdLine.tests.cpp:<line number>: PASSED: CHECK( spec.matches( tcA ) == true ) with expansion: true == true -CmdLine.tests.cpp:<line number>: -PASSED: +CmdLine.tests.cpp:<line number>: PASSED: CHECK( spec.matches( tcB ) == false ) with expansion: false == false @@ -4995,32 +4760,27 @@ Parse test names and tags CmdLine.tests.cpp:<line number> ............................................................................... -CmdLine.tests.cpp:<line number>: -PASSED: +CmdLine.tests.cpp:<line number>: PASSED: CHECK( spec.hasFilters() == true ) with expansion: true == true -CmdLine.tests.cpp:<line number>: -PASSED: +CmdLine.tests.cpp:<line number>: PASSED: CHECK( spec.matches( tcA ) == false ) with expansion: false == false -CmdLine.tests.cpp:<line number>: -PASSED: +CmdLine.tests.cpp:<line number>: PASSED: CHECK( spec.matches( tcB ) == false ) with expansion: false == false -CmdLine.tests.cpp:<line number>: -PASSED: +CmdLine.tests.cpp:<line number>: PASSED: CHECK( spec.matches( tcC ) == true ) with expansion: true == true -CmdLine.tests.cpp:<line number>: -PASSED: +CmdLine.tests.cpp:<line number>: PASSED: CHECK( spec.matches( tcD ) == true ) with expansion: true == true @@ -5032,32 +4792,27 @@ Parse test names and tags CmdLine.tests.cpp:<line number> ............................................................................... -CmdLine.tests.cpp:<line number>: -PASSED: +CmdLine.tests.cpp:<line number>: PASSED: CHECK( spec.hasFilters() == true ) with expansion: true == true -CmdLine.tests.cpp:<line number>: -PASSED: +CmdLine.tests.cpp:<line number>: PASSED: CHECK( spec.matches( tcA ) == true ) with expansion: true == true -CmdLine.tests.cpp:<line number>: -PASSED: +CmdLine.tests.cpp:<line number>: PASSED: CHECK( spec.matches( tcB ) == true ) with expansion: true == true -CmdLine.tests.cpp:<line number>: -PASSED: +CmdLine.tests.cpp:<line number>: PASSED: CHECK( spec.matches( tcC ) == true ) with expansion: true == true -CmdLine.tests.cpp:<line number>: -PASSED: +CmdLine.tests.cpp:<line number>: PASSED: CHECK( spec.matches( tcD ) == true ) with expansion: true == true @@ -5069,26 +4824,22 @@ Parse test names and tags CmdLine.tests.cpp:<line number> ............................................................................... -CmdLine.tests.cpp:<line number>: -PASSED: +CmdLine.tests.cpp:<line number>: PASSED: CHECK( spec.hasFilters() == true ) with expansion: true == true -CmdLine.tests.cpp:<line number>: -PASSED: +CmdLine.tests.cpp:<line number>: PASSED: CHECK( spec.matches( tcA ) == false ) with expansion: false == false -CmdLine.tests.cpp:<line number>: -PASSED: +CmdLine.tests.cpp:<line number>: PASSED: CHECK( spec.matches( tcB ) == true ) with expansion: true == true -CmdLine.tests.cpp:<line number>: -PASSED: +CmdLine.tests.cpp:<line number>: PASSED: CHECK( spec.matches( tcC ) == false ) with expansion: false == false @@ -5100,26 +4851,22 @@ Parse test names and tags CmdLine.tests.cpp:<line number> ............................................................................... -CmdLine.tests.cpp:<line number>: -PASSED: +CmdLine.tests.cpp:<line number>: PASSED: CHECK( spec.hasFilters() == true ) with expansion: true == true -CmdLine.tests.cpp:<line number>: -PASSED: +CmdLine.tests.cpp:<line number>: PASSED: CHECK( spec.matches( tcA ) == false ) with expansion: false == false -CmdLine.tests.cpp:<line number>: -PASSED: +CmdLine.tests.cpp:<line number>: PASSED: CHECK( spec.matches( tcB ) == true ) with expansion: true == true -CmdLine.tests.cpp:<line number>: -PASSED: +CmdLine.tests.cpp:<line number>: PASSED: CHECK( spec.matches( tcC ) == true ) with expansion: true == true @@ -5131,26 +4878,22 @@ Parse test names and tags CmdLine.tests.cpp:<line number> ............................................................................... -CmdLine.tests.cpp:<line number>: -PASSED: +CmdLine.tests.cpp:<line number>: PASSED: CHECK( spec.hasFilters() == true ) with expansion: true == true -CmdLine.tests.cpp:<line number>: -PASSED: +CmdLine.tests.cpp:<line number>: PASSED: CHECK( spec.matches( tcA ) == false ) with expansion: false == false -CmdLine.tests.cpp:<line number>: -PASSED: +CmdLine.tests.cpp:<line number>: PASSED: CHECK( spec.matches( tcB ) == false ) with expansion: false == false -CmdLine.tests.cpp:<line number>: -PASSED: +CmdLine.tests.cpp:<line number>: PASSED: CHECK( spec.matches( tcC ) == true ) with expansion: true == true @@ -5162,26 +4905,22 @@ Parse test names and tags CmdLine.tests.cpp:<line number> ............................................................................... -CmdLine.tests.cpp:<line number>: -PASSED: +CmdLine.tests.cpp:<line number>: PASSED: CHECK( spec.hasFilters() == true ) with expansion: true == true -CmdLine.tests.cpp:<line number>: -PASSED: +CmdLine.tests.cpp:<line number>: PASSED: CHECK( spec.matches( tcA ) == false ) with expansion: false == false -CmdLine.tests.cpp:<line number>: -PASSED: +CmdLine.tests.cpp:<line number>: PASSED: CHECK( spec.matches( tcB ) == false ) with expansion: false == false -CmdLine.tests.cpp:<line number>: -PASSED: +CmdLine.tests.cpp:<line number>: PASSED: CHECK( spec.matches( tcC ) == true ) with expansion: true == true @@ -5193,32 +4932,27 @@ Parse test names and tags CmdLine.tests.cpp:<line number> ............................................................................... -CmdLine.tests.cpp:<line number>: -PASSED: +CmdLine.tests.cpp:<line number>: PASSED: CHECK( spec.hasFilters() == true ) with expansion: true == true -CmdLine.tests.cpp:<line number>: -PASSED: +CmdLine.tests.cpp:<line number>: PASSED: CHECK( spec.matches( tcA ) == false ) with expansion: false == false -CmdLine.tests.cpp:<line number>: -PASSED: +CmdLine.tests.cpp:<line number>: PASSED: CHECK( spec.matches( tcB ) == false ) with expansion: false == false -CmdLine.tests.cpp:<line number>: -PASSED: +CmdLine.tests.cpp:<line number>: PASSED: CHECK( spec.matches( tcC ) == true ) with expansion: true == true -CmdLine.tests.cpp:<line number>: -PASSED: +CmdLine.tests.cpp:<line number>: PASSED: CHECK( spec.matches( tcD ) == false ) with expansion: false == false @@ -5230,26 +4964,22 @@ Parse test names and tags CmdLine.tests.cpp:<line number> ............................................................................... -CmdLine.tests.cpp:<line number>: -PASSED: +CmdLine.tests.cpp:<line number>: PASSED: CHECK( spec.hasFilters() == true ) with expansion: true == true -CmdLine.tests.cpp:<line number>: -PASSED: +CmdLine.tests.cpp:<line number>: PASSED: CHECK( spec.matches( tcA ) == true ) with expansion: true == true -CmdLine.tests.cpp:<line number>: -PASSED: +CmdLine.tests.cpp:<line number>: PASSED: CHECK( spec.matches( tcB ) == false ) with expansion: false == false -CmdLine.tests.cpp:<line number>: -PASSED: +CmdLine.tests.cpp:<line number>: PASSED: CHECK( spec.matches( tcC ) == true ) with expansion: true == true @@ -5261,26 +4991,22 @@ Parse test names and tags CmdLine.tests.cpp:<line number> ............................................................................... -CmdLine.tests.cpp:<line number>: -PASSED: +CmdLine.tests.cpp:<line number>: PASSED: CHECK( spec.hasFilters() == true ) with expansion: true == true -CmdLine.tests.cpp:<line number>: -PASSED: +CmdLine.tests.cpp:<line number>: PASSED: CHECK( spec.matches( tcA ) == false ) with expansion: false == false -CmdLine.tests.cpp:<line number>: -PASSED: +CmdLine.tests.cpp:<line number>: PASSED: CHECK( spec.matches( tcB ) == true ) with expansion: true == true -CmdLine.tests.cpp:<line number>: -PASSED: +CmdLine.tests.cpp:<line number>: PASSED: CHECK( spec.matches( tcC ) == false ) with expansion: false == false @@ -5292,32 +5018,27 @@ Parse test names and tags CmdLine.tests.cpp:<line number> ............................................................................... -CmdLine.tests.cpp:<line number>: -PASSED: +CmdLine.tests.cpp:<line number>: PASSED: CHECK( spec.hasFilters() == true ) with expansion: true == true -CmdLine.tests.cpp:<line number>: -PASSED: +CmdLine.tests.cpp:<line number>: PASSED: CHECK( spec.matches( tcA ) == false ) with expansion: false == false -CmdLine.tests.cpp:<line number>: -PASSED: +CmdLine.tests.cpp:<line number>: PASSED: CHECK( spec.matches( tcB ) == false ) with expansion: false == false -CmdLine.tests.cpp:<line number>: -PASSED: +CmdLine.tests.cpp:<line number>: PASSED: CHECK( spec.matches( tcC ) == false ) with expansion: false == false -CmdLine.tests.cpp:<line number>: -PASSED: +CmdLine.tests.cpp:<line number>: PASSED: CHECK( spec.matches( tcD ) == true ) with expansion: true == true @@ -5329,32 +5050,27 @@ Parse test names and tags CmdLine.tests.cpp:<line number> ............................................................................... -CmdLine.tests.cpp:<line number>: -PASSED: +CmdLine.tests.cpp:<line number>: PASSED: CHECK( spec.hasFilters() == true ) with expansion: true == true -CmdLine.tests.cpp:<line number>: -PASSED: +CmdLine.tests.cpp:<line number>: PASSED: CHECK( spec.matches( tcA ) == false ) with expansion: false == false -CmdLine.tests.cpp:<line number>: -PASSED: +CmdLine.tests.cpp:<line number>: PASSED: CHECK( spec.matches( tcB ) == false ) with expansion: false == false -CmdLine.tests.cpp:<line number>: -PASSED: +CmdLine.tests.cpp:<line number>: PASSED: CHECK( spec.matches( tcC ) == false ) with expansion: false == false -CmdLine.tests.cpp:<line number>: -PASSED: +CmdLine.tests.cpp:<line number>: PASSED: CHECK( spec.matches( tcD ) == true ) with expansion: true == true @@ -5366,32 +5082,27 @@ Parse test names and tags CmdLine.tests.cpp:<line number> ............................................................................... -CmdLine.tests.cpp:<line number>: -PASSED: +CmdLine.tests.cpp:<line number>: PASSED: CHECK( spec.hasFilters() == true ) with expansion: true == true -CmdLine.tests.cpp:<line number>: -PASSED: +CmdLine.tests.cpp:<line number>: PASSED: CHECK( spec.matches( tcA ) == true ) with expansion: true == true -CmdLine.tests.cpp:<line number>: -PASSED: +CmdLine.tests.cpp:<line number>: PASSED: CHECK( spec.matches( tcB ) == false ) with expansion: false == false -CmdLine.tests.cpp:<line number>: -PASSED: +CmdLine.tests.cpp:<line number>: PASSED: CHECK( spec.matches( tcC ) == true ) with expansion: true == true -CmdLine.tests.cpp:<line number>: -PASSED: +CmdLine.tests.cpp:<line number>: PASSED: CHECK( spec.matches( tcD ) == true ) with expansion: true == true @@ -5403,32 +5114,27 @@ Parse test names and tags CmdLine.tests.cpp:<line number> ............................................................................... -CmdLine.tests.cpp:<line number>: -PASSED: +CmdLine.tests.cpp:<line number>: PASSED: CHECK( spec.hasFilters() == true ) with expansion: true == true -CmdLine.tests.cpp:<line number>: -PASSED: +CmdLine.tests.cpp:<line number>: PASSED: CHECK( spec.matches( tcA ) == true ) with expansion: true == true -CmdLine.tests.cpp:<line number>: -PASSED: +CmdLine.tests.cpp:<line number>: PASSED: CHECK( spec.matches( tcB ) == true ) with expansion: true == true -CmdLine.tests.cpp:<line number>: -PASSED: +CmdLine.tests.cpp:<line number>: PASSED: CHECK( spec.matches( tcC ) == false ) with expansion: false == false -CmdLine.tests.cpp:<line number>: -PASSED: +CmdLine.tests.cpp:<line number>: PASSED: CHECK( spec.matches( tcD ) == false ) with expansion: false == false @@ -5440,32 +5146,27 @@ Parse test names and tags CmdLine.tests.cpp:<line number> ............................................................................... -CmdLine.tests.cpp:<line number>: -PASSED: +CmdLine.tests.cpp:<line number>: PASSED: CHECK( spec.hasFilters() == true ) with expansion: true == true -CmdLine.tests.cpp:<line number>: -PASSED: +CmdLine.tests.cpp:<line number>: PASSED: CHECK( spec.matches( tcA ) == true ) with expansion: true == true -CmdLine.tests.cpp:<line number>: -PASSED: +CmdLine.tests.cpp:<line number>: PASSED: CHECK( spec.matches( tcB ) == true ) with expansion: true == true -CmdLine.tests.cpp:<line number>: -PASSED: +CmdLine.tests.cpp:<line number>: PASSED: CHECK( spec.matches( tcC ) == true ) with expansion: true == true -CmdLine.tests.cpp:<line number>: -PASSED: +CmdLine.tests.cpp:<line number>: PASSED: CHECK( spec.matches( tcD ) == false ) with expansion: false == false @@ -5477,32 +5178,27 @@ Parse test names and tags CmdLine.tests.cpp:<line number> ............................................................................... -CmdLine.tests.cpp:<line number>: -PASSED: +CmdLine.tests.cpp:<line number>: PASSED: CHECK( spec.hasFilters() == true ) with expansion: true == true -CmdLine.tests.cpp:<line number>: -PASSED: +CmdLine.tests.cpp:<line number>: PASSED: CHECK( spec.matches( tcA ) == true ) with expansion: true == true -CmdLine.tests.cpp:<line number>: -PASSED: +CmdLine.tests.cpp:<line number>: PASSED: CHECK( spec.matches( tcB ) == true ) with expansion: true == true -CmdLine.tests.cpp:<line number>: -PASSED: +CmdLine.tests.cpp:<line number>: PASSED: CHECK( spec.matches( tcC ) == true ) with expansion: true == true -CmdLine.tests.cpp:<line number>: -PASSED: +CmdLine.tests.cpp:<line number>: PASSED: CHECK( spec.matches( tcD ) == false ) with expansion: false == false @@ -5514,32 +5210,27 @@ Parse test names and tags CmdLine.tests.cpp:<line number> ............................................................................... -CmdLine.tests.cpp:<line number>: -PASSED: +CmdLine.tests.cpp:<line number>: PASSED: CHECK( spec.hasFilters() == true ) with expansion: true == true -CmdLine.tests.cpp:<line number>: -PASSED: +CmdLine.tests.cpp:<line number>: PASSED: CHECK( spec.matches( tcA ) == false ) with expansion: false == false -CmdLine.tests.cpp:<line number>: -PASSED: +CmdLine.tests.cpp:<line number>: PASSED: CHECK( spec.matches( tcB ) == false ) with expansion: false == false -CmdLine.tests.cpp:<line number>: -PASSED: +CmdLine.tests.cpp:<line number>: PASSED: CHECK( spec.matches( tcC ) == true ) with expansion: true == true -CmdLine.tests.cpp:<line number>: -PASSED: +CmdLine.tests.cpp:<line number>: PASSED: CHECK( spec.matches( tcD ) == false ) with expansion: false == false @@ -5551,32 +5242,27 @@ Parse test names and tags CmdLine.tests.cpp:<line number> ............................................................................... -CmdLine.tests.cpp:<line number>: -PASSED: +CmdLine.tests.cpp:<line number>: PASSED: CHECK( spec.hasFilters() == false ) with expansion: false == false -CmdLine.tests.cpp:<line number>: -PASSED: +CmdLine.tests.cpp:<line number>: PASSED: CHECK( spec.matches( tcA ) == false ) with expansion: false == false -CmdLine.tests.cpp:<line number>: -PASSED: +CmdLine.tests.cpp:<line number>: PASSED: CHECK( spec.matches( tcB ) == false ) with expansion: false == false -CmdLine.tests.cpp:<line number>: -PASSED: +CmdLine.tests.cpp:<line number>: PASSED: CHECK( spec.matches( tcC ) == false ) with expansion: false == false -CmdLine.tests.cpp:<line number>: -PASSED: +CmdLine.tests.cpp:<line number>: PASSED: CHECK( spec.matches( tcD ) == false ) with expansion: false == false @@ -5588,32 +5274,27 @@ Parse test names and tags CmdLine.tests.cpp:<line number> ............................................................................... -CmdLine.tests.cpp:<line number>: -PASSED: +CmdLine.tests.cpp:<line number>: PASSED: CHECK( spec.hasFilters() == false ) with expansion: false == false -CmdLine.tests.cpp:<line number>: -PASSED: +CmdLine.tests.cpp:<line number>: PASSED: CHECK( spec.matches( tcA ) == false ) with expansion: false == false -CmdLine.tests.cpp:<line number>: -PASSED: +CmdLine.tests.cpp:<line number>: PASSED: CHECK( spec.matches( tcB ) == false ) with expansion: false == false -CmdLine.tests.cpp:<line number>: -PASSED: +CmdLine.tests.cpp:<line number>: PASSED: CHECK( spec.matches( tcC ) == false ) with expansion: false == false -CmdLine.tests.cpp:<line number>: -PASSED: +CmdLine.tests.cpp:<line number>: PASSED: CHECK( spec.matches( tcD ) == false ) with expansion: false == false @@ -5625,32 +5306,27 @@ Parse test names and tags CmdLine.tests.cpp:<line number> ............................................................................... -CmdLine.tests.cpp:<line number>: -PASSED: +CmdLine.tests.cpp:<line number>: PASSED: CHECK( spec.hasFilters() == true ) with expansion: true == true -CmdLine.tests.cpp:<line number>: -PASSED: +CmdLine.tests.cpp:<line number>: PASSED: CHECK( spec.matches( tcA ) == false ) with expansion: false == false -CmdLine.tests.cpp:<line number>: -PASSED: +CmdLine.tests.cpp:<line number>: PASSED: CHECK( spec.matches( tcB ) == false ) with expansion: false == false -CmdLine.tests.cpp:<line number>: -PASSED: +CmdLine.tests.cpp:<line number>: PASSED: CHECK( spec.matches( tcC ) == false ) with expansion: false == false -CmdLine.tests.cpp:<line number>: -PASSED: +CmdLine.tests.cpp:<line number>: PASSED: CHECK( spec.matches( tcD ) == true ) with expansion: true == true @@ -5661,54 +5337,57 @@ Pointers can be compared to null Condition.tests.cpp:<line number> ............................................................................... -Condition.tests.cpp:<line number>: -PASSED: +Condition.tests.cpp:<line number>: PASSED: REQUIRE( p == 0 ) with expansion: 0 == 0 -Condition.tests.cpp:<line number>: -PASSED: +Condition.tests.cpp:<line number>: PASSED: REQUIRE( p == pNULL ) with expansion: 0 == 0 -Condition.tests.cpp:<line number>: -PASSED: +Condition.tests.cpp:<line number>: PASSED: REQUIRE( p != 0 ) with expansion: 0x<hex digits> != 0 -Condition.tests.cpp:<line number>: -PASSED: +Condition.tests.cpp:<line number>: PASSED: REQUIRE( cp != 0 ) with expansion: 0x<hex digits> != 0 -Condition.tests.cpp:<line number>: -PASSED: +Condition.tests.cpp:<line number>: PASSED: REQUIRE( cpc != 0 ) with expansion: 0x<hex digits> != 0 -Condition.tests.cpp:<line number>: -PASSED: +Condition.tests.cpp:<line number>: PASSED: REQUIRE( returnsNull() == 0 ) with expansion: {null string} == 0 -Condition.tests.cpp:<line number>: -PASSED: +Condition.tests.cpp:<line number>: PASSED: REQUIRE( returnsConstNull() == 0 ) with expansion: {null string} == 0 -Condition.tests.cpp:<line number>: -PASSED: +Condition.tests.cpp:<line number>: PASSED: REQUIRE( 0 != p ) with expansion: 0 != 0x<hex digits> +------------------------------------------------------------------------------- +Predicate matcher can accept const char* +------------------------------------------------------------------------------- +Matchers.tests.cpp:<line number> +............................................................................... + +Matchers.tests.cpp:<line number>: PASSED: + REQUIRE_THAT( "foo", Predicate<const char*>([] (const char* const&) { return true; }) ) +with expansion: + "foo" matches undescribed predicate + ------------------------------------------------------------------------------- Process can be configured on command line empty args don't cause a crash @@ -5716,14 +5395,12 @@ Process can be configured on command line CmdLine.tests.cpp:<line number> ............................................................................... -CmdLine.tests.cpp:<line number>: -PASSED: +CmdLine.tests.cpp:<line number>: PASSED: CHECK( result ) with expansion: {?} -CmdLine.tests.cpp:<line number>: -PASSED: +CmdLine.tests.cpp:<line number>: PASSED: CHECK( config.processName == "" ) with expansion: "" == "" @@ -5735,44 +5412,37 @@ Process can be configured on command line CmdLine.tests.cpp:<line number> ............................................................................... -CmdLine.tests.cpp:<line number>: -PASSED: +CmdLine.tests.cpp:<line number>: PASSED: CHECK( result ) with expansion: {?} -CmdLine.tests.cpp:<line number>: -PASSED: +CmdLine.tests.cpp:<line number>: PASSED: CHECK( config.processName == "test" ) with expansion: "test" == "test" -CmdLine.tests.cpp:<line number>: -PASSED: +CmdLine.tests.cpp:<line number>: PASSED: CHECK( config.shouldDebugBreak == false ) with expansion: false == false -CmdLine.tests.cpp:<line number>: -PASSED: +CmdLine.tests.cpp:<line number>: PASSED: CHECK( config.abortAfter == -1 ) with expansion: -1 == -1 -CmdLine.tests.cpp:<line number>: -PASSED: +CmdLine.tests.cpp:<line number>: PASSED: CHECK( config.noThrow == false ) with expansion: false == false -CmdLine.tests.cpp:<line number>: -PASSED: +CmdLine.tests.cpp:<line number>: PASSED: CHECK( config.reporterName == "console" ) with expansion: "console" == "console" -CmdLine.tests.cpp:<line number>: -PASSED: +CmdLine.tests.cpp:<line number>: PASSED: CHECK_FALSE( cfg.hasTestFilters() ) with expansion: !false @@ -5785,26 +5455,22 @@ Process can be configured on command line CmdLine.tests.cpp:<line number> ............................................................................... -CmdLine.tests.cpp:<line number>: -PASSED: +CmdLine.tests.cpp:<line number>: PASSED: CHECK( result ) with expansion: {?} -CmdLine.tests.cpp:<line number>: -PASSED: +CmdLine.tests.cpp:<line number>: PASSED: REQUIRE( cfg.hasTestFilters() ) with expansion: true -CmdLine.tests.cpp:<line number>: -PASSED: +CmdLine.tests.cpp:<line number>: PASSED: REQUIRE( cfg.testSpec().matches(fakeTestCase("notIncluded")) == false ) with expansion: false == false -CmdLine.tests.cpp:<line number>: -PASSED: +CmdLine.tests.cpp:<line number>: PASSED: REQUIRE( cfg.testSpec().matches(fakeTestCase("test1")) ) with expansion: true @@ -5817,26 +5483,22 @@ Process can be configured on command line CmdLine.tests.cpp:<line number> ............................................................................... -CmdLine.tests.cpp:<line number>: -PASSED: +CmdLine.tests.cpp:<line number>: PASSED: CHECK( result ) with expansion: {?} -CmdLine.tests.cpp:<line number>: -PASSED: +CmdLine.tests.cpp:<line number>: PASSED: REQUIRE( cfg.hasTestFilters() ) with expansion: true -CmdLine.tests.cpp:<line number>: -PASSED: +CmdLine.tests.cpp:<line number>: PASSED: REQUIRE( cfg.testSpec().matches(fakeTestCase("test1")) == false ) with expansion: false == false -CmdLine.tests.cpp:<line number>: -PASSED: +CmdLine.tests.cpp:<line number>: PASSED: REQUIRE( cfg.testSpec().matches(fakeTestCase("alwaysIncluded")) ) with expansion: true @@ -5849,26 +5511,22 @@ Process can be configured on command line CmdLine.tests.cpp:<line number> ............................................................................... -CmdLine.tests.cpp:<line number>: -PASSED: +CmdLine.tests.cpp:<line number>: PASSED: CHECK( result ) with expansion: {?} -CmdLine.tests.cpp:<line number>: -PASSED: +CmdLine.tests.cpp:<line number>: PASSED: REQUIRE( cfg.hasTestFilters() ) with expansion: true -CmdLine.tests.cpp:<line number>: -PASSED: +CmdLine.tests.cpp:<line number>: PASSED: REQUIRE( cfg.testSpec().matches(fakeTestCase("test1")) == false ) with expansion: false == false -CmdLine.tests.cpp:<line number>: -PASSED: +CmdLine.tests.cpp:<line number>: PASSED: REQUIRE( cfg.testSpec().matches(fakeTestCase("alwaysIncluded")) ) with expansion: true @@ -5881,14 +5539,12 @@ Process can be configured on command line CmdLine.tests.cpp:<line number> ............................................................................... -CmdLine.tests.cpp:<line number>: -PASSED: +CmdLine.tests.cpp:<line number>: PASSED: CHECK( cli.parse({"test", "-r", "console"}) ) with expansion: {?} -CmdLine.tests.cpp:<line number>: -PASSED: +CmdLine.tests.cpp:<line number>: PASSED: REQUIRE( config.reporterName == "console" ) with expansion: "console" == "console" @@ -5901,14 +5557,12 @@ Process can be configured on command line CmdLine.tests.cpp:<line number> ............................................................................... -CmdLine.tests.cpp:<line number>: -PASSED: +CmdLine.tests.cpp:<line number>: PASSED: CHECK( cli.parse({"test", "-r", "xml"}) ) with expansion: {?} -CmdLine.tests.cpp:<line number>: -PASSED: +CmdLine.tests.cpp:<line number>: PASSED: REQUIRE( config.reporterName == "xml" ) with expansion: "xml" == "xml" @@ -5921,14 +5575,12 @@ Process can be configured on command line CmdLine.tests.cpp:<line number> ............................................................................... -CmdLine.tests.cpp:<line number>: -PASSED: +CmdLine.tests.cpp:<line number>: PASSED: CHECK( cli.parse({"test", "--reporter", "junit"}) ) with expansion: {?} -CmdLine.tests.cpp:<line number>: -PASSED: +CmdLine.tests.cpp:<line number>: PASSED: REQUIRE( config.reporterName == "junit" ) with expansion: "junit" == "junit" @@ -5941,12 +5593,30 @@ Process can be configured on command line CmdLine.tests.cpp:<line number> ............................................................................... -CmdLine.tests.cpp:<line number>: -PASSED: +CmdLine.tests.cpp:<line number>: PASSED: REQUIRE_FALSE( cli.parse({ "test", "-r", "xml", "-r", "junit" }) ) with expansion: !{?} +------------------------------------------------------------------------------- +Process can be configured on command line + reporter + must match one of the available ones +------------------------------------------------------------------------------- +CmdLine.tests.cpp:<line number> +............................................................................... + +CmdLine.tests.cpp:<line number>: PASSED: + CHECK( !result ) +with expansion: + true + +CmdLine.tests.cpp:<line number>: PASSED: + REQUIRE_THAT( result.errorMessage(), Contains("Unrecognized reporter") ) +with expansion: + "Unrecognized reporter, 'unsupported'. Check available with --list-reporters" + contains: "Unrecognized reporter" + ------------------------------------------------------------------------------- Process can be configured on command line debugger @@ -5955,14 +5625,12 @@ Process can be configured on command line CmdLine.tests.cpp:<line number> ............................................................................... -CmdLine.tests.cpp:<line number>: -PASSED: +CmdLine.tests.cpp:<line number>: PASSED: CHECK( cli.parse({"test", "-b"}) ) with expansion: {?} -CmdLine.tests.cpp:<line number>: -PASSED: +CmdLine.tests.cpp:<line number>: PASSED: REQUIRE( config.shouldDebugBreak == true ) with expansion: true == true @@ -5975,14 +5643,12 @@ Process can be configured on command line CmdLine.tests.cpp:<line number> ............................................................................... -CmdLine.tests.cpp:<line number>: -PASSED: +CmdLine.tests.cpp:<line number>: PASSED: CHECK( cli.parse({"test", "--break"}) ) with expansion: {?} -CmdLine.tests.cpp:<line number>: -PASSED: +CmdLine.tests.cpp:<line number>: PASSED: REQUIRE( config.shouldDebugBreak ) with expansion: true @@ -5995,14 +5661,12 @@ Process can be configured on command line CmdLine.tests.cpp:<line number> ............................................................................... -CmdLine.tests.cpp:<line number>: -PASSED: +CmdLine.tests.cpp:<line number>: PASSED: CHECK( cli.parse({"test", "-a"}) ) with expansion: {?} -CmdLine.tests.cpp:<line number>: -PASSED: +CmdLine.tests.cpp:<line number>: PASSED: REQUIRE( config.abortAfter == 1 ) with expansion: 1 == 1 @@ -6015,14 +5679,12 @@ Process can be configured on command line CmdLine.tests.cpp:<line number> ............................................................................... -CmdLine.tests.cpp:<line number>: -PASSED: +CmdLine.tests.cpp:<line number>: PASSED: CHECK( cli.parse({"test", "-x", "2"}) ) with expansion: {?} -CmdLine.tests.cpp:<line number>: -PASSED: +CmdLine.tests.cpp:<line number>: PASSED: REQUIRE( config.abortAfter == 2 ) with expansion: 2 == 2 @@ -6035,14 +5697,12 @@ Process can be configured on command line CmdLine.tests.cpp:<line number> ............................................................................... -CmdLine.tests.cpp:<line number>: -PASSED: +CmdLine.tests.cpp:<line number>: PASSED: CHECK( !result ) with expansion: true -CmdLine.tests.cpp:<line number>: -PASSED: +CmdLine.tests.cpp:<line number>: PASSED: REQUIRE_THAT( result.errorMessage(), Contains("convert") && Contains("oops") ) with expansion: "Unable to convert 'oops' to destination type" ( contains: "convert" and @@ -6056,14 +5716,12 @@ Process can be configured on command line CmdLine.tests.cpp:<line number> ............................................................................... -CmdLine.tests.cpp:<line number>: -PASSED: +CmdLine.tests.cpp:<line number>: PASSED: CHECK( cli.parse({"test", "-e"}) ) with expansion: {?} -CmdLine.tests.cpp:<line number>: -PASSED: +CmdLine.tests.cpp:<line number>: PASSED: REQUIRE( config.noThrow ) with expansion: true @@ -6076,14 +5734,12 @@ Process can be configured on command line CmdLine.tests.cpp:<line number> ............................................................................... -CmdLine.tests.cpp:<line number>: -PASSED: +CmdLine.tests.cpp:<line number>: PASSED: CHECK( cli.parse({"test", "--nothrow"}) ) with expansion: {?} -CmdLine.tests.cpp:<line number>: -PASSED: +CmdLine.tests.cpp:<line number>: PASSED: REQUIRE( config.noThrow ) with expansion: true @@ -6096,14 +5752,12 @@ Process can be configured on command line CmdLine.tests.cpp:<line number> ............................................................................... -CmdLine.tests.cpp:<line number>: -PASSED: +CmdLine.tests.cpp:<line number>: PASSED: CHECK( cli.parse({"test", "-o", "filename.ext"}) ) with expansion: {?} -CmdLine.tests.cpp:<line number>: -PASSED: +CmdLine.tests.cpp:<line number>: PASSED: REQUIRE( config.outputFilename == "filename.ext" ) with expansion: "filename.ext" == "filename.ext" @@ -6116,14 +5770,12 @@ Process can be configured on command line CmdLine.tests.cpp:<line number> ............................................................................... -CmdLine.tests.cpp:<line number>: -PASSED: +CmdLine.tests.cpp:<line number>: PASSED: CHECK( cli.parse({"test", "--out", "filename.ext"}) ) with expansion: {?} -CmdLine.tests.cpp:<line number>: -PASSED: +CmdLine.tests.cpp:<line number>: PASSED: REQUIRE( config.outputFilename == "filename.ext" ) with expansion: "filename.ext" == "filename.ext" @@ -6136,26 +5788,22 @@ Process can be configured on command line CmdLine.tests.cpp:<line number> ............................................................................... -CmdLine.tests.cpp:<line number>: -PASSED: +CmdLine.tests.cpp:<line number>: PASSED: CHECK( cli.parse({"test", "-abe"}) ) with expansion: {?} -CmdLine.tests.cpp:<line number>: -PASSED: +CmdLine.tests.cpp:<line number>: PASSED: CHECK( config.abortAfter == 1 ) with expansion: 1 == 1 -CmdLine.tests.cpp:<line number>: -PASSED: +CmdLine.tests.cpp:<line number>: PASSED: CHECK( config.shouldDebugBreak ) with expansion: true -CmdLine.tests.cpp:<line number>: -PASSED: +CmdLine.tests.cpp:<line number>: PASSED: CHECK( config.noThrow == true ) with expansion: true == true @@ -6168,14 +5816,12 @@ Process can be configured on command line CmdLine.tests.cpp:<line number> ............................................................................... -CmdLine.tests.cpp:<line number>: -PASSED: +CmdLine.tests.cpp:<line number>: PASSED: CHECK( cli.parse({"test"}) ) with expansion: {?} -CmdLine.tests.cpp:<line number>: -PASSED: +CmdLine.tests.cpp:<line number>: PASSED: REQUIRE( config.useColour == UseColour::Auto ) with expansion: 0 == 0 @@ -6188,14 +5834,12 @@ Process can be configured on command line CmdLine.tests.cpp:<line number> ............................................................................... -CmdLine.tests.cpp:<line number>: -PASSED: +CmdLine.tests.cpp:<line number>: PASSED: CHECK( cli.parse({"test", "--use-colour", "auto"}) ) with expansion: {?} -CmdLine.tests.cpp:<line number>: -PASSED: +CmdLine.tests.cpp:<line number>: PASSED: REQUIRE( config.useColour == UseColour::Auto ) with expansion: 0 == 0 @@ -6208,14 +5852,12 @@ Process can be configured on command line CmdLine.tests.cpp:<line number> ............................................................................... -CmdLine.tests.cpp:<line number>: -PASSED: +CmdLine.tests.cpp:<line number>: PASSED: CHECK( cli.parse({"test", "--use-colour", "yes"}) ) with expansion: {?} -CmdLine.tests.cpp:<line number>: -PASSED: +CmdLine.tests.cpp:<line number>: PASSED: REQUIRE( config.useColour == UseColour::Yes ) with expansion: 1 == 1 @@ -6228,14 +5870,12 @@ Process can be configured on command line CmdLine.tests.cpp:<line number> ............................................................................... -CmdLine.tests.cpp:<line number>: -PASSED: +CmdLine.tests.cpp:<line number>: PASSED: CHECK( cli.parse({"test", "--use-colour", "no"}) ) with expansion: {?} -CmdLine.tests.cpp:<line number>: -PASSED: +CmdLine.tests.cpp:<line number>: PASSED: REQUIRE( config.useColour == UseColour::No ) with expansion: 2 == 2 @@ -6248,19 +5888,50 @@ Process can be configured on command line CmdLine.tests.cpp:<line number> ............................................................................... -CmdLine.tests.cpp:<line number>: -PASSED: +CmdLine.tests.cpp:<line number>: PASSED: CHECK( !result ) with expansion: true -CmdLine.tests.cpp:<line number>: -PASSED: +CmdLine.tests.cpp:<line number>: PASSED: CHECK_THAT( result.errorMessage(), Contains( "colour mode must be one of" ) ) with expansion: "colour mode must be one of: auto, yes or no. 'wrong' not recognised" contains: "colour mode must be one of" +------------------------------------------------------------------------------- +Product with differing arities - 0 +------------------------------------------------------------------------------- +Misc.tests.cpp:<line number> +............................................................................... + +Misc.tests.cpp:<line number>: PASSED: + REQUIRE( std::tuple_size<TestType>::value >= 1 ) +with expansion: + 1 >= 1 + +------------------------------------------------------------------------------- +Product with differing arities - 1 +------------------------------------------------------------------------------- +Misc.tests.cpp:<line number> +............................................................................... + +Misc.tests.cpp:<line number>: PASSED: + REQUIRE( std::tuple_size<TestType>::value >= 1 ) +with expansion: + 2 >= 1 + +------------------------------------------------------------------------------- +Product with differing arities - 2 +------------------------------------------------------------------------------- +Misc.tests.cpp:<line number> +............................................................................... + +Misc.tests.cpp:<line number>: PASSED: + REQUIRE( std::tuple_size<TestType>::value >= 1 ) +with expansion: + 3 >= 1 + ------------------------------------------------------------------------------- Reconstruction should be based on stringification: #914 ------------------------------------------------------------------------------- @@ -6302,8 +5973,7 @@ Regression test #1 Matchers.tests.cpp:<line number> ............................................................................... -Matchers.tests.cpp:<line number>: -PASSED: +Matchers.tests.cpp:<line number>: PASSED: CHECK_THAT( actual, !UnorderedEquals(expected) ) with expansion: { 'a', 'b' } not UnorderedEquals: { 'c', 'b' } @@ -6314,8 +5984,7 @@ SUCCEED counts as a test pass Message.tests.cpp:<line number> ............................................................................... -Message.tests.cpp:<line number>: -PASSED: +Message.tests.cpp:<line number>: PASSED: with message: this is a success @@ -6325,8 +5994,7 @@ SUCCEED does not require an argument Message.tests.cpp:<line number> ............................................................................... -Message.tests.cpp:<line number>: -PASSED: +Message.tests.cpp:<line number>: PASSED: ------------------------------------------------------------------------------- Scenario: BDD tests requiring Fixtures to provide commonly-accessed data or @@ -6336,8 +6004,7 @@ Scenario: BDD tests requiring Fixtures to provide commonly-accessed data or BDD.tests.cpp:<line number> ............................................................................... -BDD.tests.cpp:<line number>: -PASSED: +BDD.tests.cpp:<line number>: PASSED: REQUIRE( before == 0 ) with expansion: 0 == 0 @@ -6352,8 +6019,7 @@ Scenario: BDD tests requiring Fixtures to provide commonly-accessed data or BDD.tests.cpp:<line number> ............................................................................... -BDD.tests.cpp:<line number>: -PASSED: +BDD.tests.cpp:<line number>: PASSED: REQUIRE( after > before ) with expansion: 1 > 0 @@ -6368,8 +6034,7 @@ Scenario: Do that thing with the thing BDD.tests.cpp:<line number> ............................................................................... -BDD.tests.cpp:<line number>: -PASSED: +BDD.tests.cpp:<line number>: PASSED: REQUIRE( itDoesThis() ) with expansion: true @@ -6385,8 +6050,7 @@ Scenario: Do that thing with the thing BDD.tests.cpp:<line number> ............................................................................... -BDD.tests.cpp:<line number>: -PASSED: +BDD.tests.cpp:<line number>: PASSED: REQUIRE( itDoesThat() ) with expansion: true @@ -6404,8 +6068,7 @@ Scenario: This is a really long scenario name to see how the list command deals BDD.tests.cpp:<line number> ............................................................................... -BDD.tests.cpp:<line number>: -PASSED: +BDD.tests.cpp:<line number>: PASSED: with message: boo! @@ -6416,8 +6079,7 @@ Scenario: Vector resizing affects size and capacity BDD.tests.cpp:<line number> ............................................................................... -BDD.tests.cpp:<line number>: -PASSED: +BDD.tests.cpp:<line number>: PASSED: REQUIRE( v.size() == 0 ) with expansion: 0 == 0 @@ -6431,14 +6093,12 @@ Scenario: Vector resizing affects size and capacity BDD.tests.cpp:<line number> ............................................................................... -BDD.tests.cpp:<line number>: -PASSED: +BDD.tests.cpp:<line number>: PASSED: REQUIRE( v.size() == 10 ) with expansion: 10 == 10 -BDD.tests.cpp:<line number>: -PASSED: +BDD.tests.cpp:<line number>: PASSED: REQUIRE( v.capacity() >= 10 ) with expansion: 10 >= 10 @@ -6454,14 +6114,12 @@ Scenario: Vector resizing affects size and capacity BDD.tests.cpp:<line number> ............................................................................... -BDD.tests.cpp:<line number>: -PASSED: +BDD.tests.cpp:<line number>: PASSED: REQUIRE( v.size() == 5 ) with expansion: 5 == 5 -BDD.tests.cpp:<line number>: -PASSED: +BDD.tests.cpp:<line number>: PASSED: REQUIRE( v.capacity() >= 10 ) with expansion: 10 >= 10 @@ -6473,8 +6131,7 @@ Scenario: Vector resizing affects size and capacity BDD.tests.cpp:<line number> ............................................................................... -BDD.tests.cpp:<line number>: -PASSED: +BDD.tests.cpp:<line number>: PASSED: REQUIRE( v.size() == 0 ) with expansion: 0 == 0 @@ -6488,14 +6145,12 @@ Scenario: Vector resizing affects size and capacity BDD.tests.cpp:<line number> ............................................................................... -BDD.tests.cpp:<line number>: -PASSED: +BDD.tests.cpp:<line number>: PASSED: REQUIRE( v.capacity() >= 10 ) with expansion: 10 >= 10 -BDD.tests.cpp:<line number>: -PASSED: +BDD.tests.cpp:<line number>: PASSED: REQUIRE( v.size() == 0 ) with expansion: 0 == 0 @@ -6518,56 +6173,47 @@ Some simple comparisons between doubles Approx.tests.cpp:<line number> ............................................................................... -Approx.tests.cpp:<line number>: -PASSED: +Approx.tests.cpp:<line number>: PASSED: REQUIRE( d == Approx( 1.23 ) ) with expansion: 1.23 == Approx( 1.23 ) -Approx.tests.cpp:<line number>: -PASSED: +Approx.tests.cpp:<line number>: PASSED: REQUIRE( d != Approx( 1.22 ) ) with expansion: 1.23 != Approx( 1.22 ) -Approx.tests.cpp:<line number>: -PASSED: +Approx.tests.cpp:<line number>: PASSED: REQUIRE( d != Approx( 1.24 ) ) with expansion: 1.23 != Approx( 1.24 ) -Approx.tests.cpp:<line number>: -PASSED: +Approx.tests.cpp:<line number>: PASSED: REQUIRE( d == 1.23_a ) with expansion: 1.23 == Approx( 1.23 ) -Approx.tests.cpp:<line number>: -PASSED: +Approx.tests.cpp:<line number>: PASSED: REQUIRE( d != 1.22_a ) with expansion: 1.23 != Approx( 1.22 ) -Approx.tests.cpp:<line number>: -PASSED: +Approx.tests.cpp:<line number>: PASSED: REQUIRE( Approx( d ) == 1.23 ) with expansion: Approx( 1.23 ) == 1.23 -Approx.tests.cpp:<line number>: -PASSED: +Approx.tests.cpp:<line number>: PASSED: REQUIRE( Approx( d ) != 1.22 ) with expansion: Approx( 1.23 ) != 1.22 -Approx.tests.cpp:<line number>: -PASSED: +Approx.tests.cpp:<line number>: PASSED: REQUIRE( Approx( d ) != 1.24 ) with expansion: Approx( 1.23 ) != 1.24 -Approx.tests.cpp:<line number>: -PASSED: +Approx.tests.cpp:<line number>: PASSED: REQUIRE( INFINITY == Approx(INFINITY) ) with expansion: inff == Approx( inf ) @@ -6618,8 +6264,7 @@ Static arrays are convertible to string ToStringGeneral.tests.cpp:<line number> ............................................................................... -ToStringGeneral.tests.cpp:<line number>: -PASSED: +ToStringGeneral.tests.cpp:<line number>: PASSED: REQUIRE( Catch::Detail::stringify(singular) == "{ 1 }" ) with expansion: "{ 1 }" == "{ 1 }" @@ -6631,8 +6276,7 @@ Static arrays are convertible to string ToStringGeneral.tests.cpp:<line number> ............................................................................... -ToStringGeneral.tests.cpp:<line number>: -PASSED: +ToStringGeneral.tests.cpp:<line number>: PASSED: REQUIRE( Catch::Detail::stringify(arr) == "{ 3, 2, 1 }" ) with expansion: "{ 3, 2, 1 }" == "{ 3, 2, 1 }" @@ -6644,8 +6288,7 @@ Static arrays are convertible to string ToStringGeneral.tests.cpp:<line number> ............................................................................... -ToStringGeneral.tests.cpp:<line number>: -PASSED: +ToStringGeneral.tests.cpp:<line number>: PASSED: REQUIRE( Catch::Detail::stringify(arr) == R"({ { "1:1", "1:2", "1:3" }, { "2:1", "2:2" } })" ) with expansion: "{ { "1:1", "1:2", "1:3" }, { "2:1", "2:2" } }" @@ -6658,53 +6301,45 @@ String matchers Matchers.tests.cpp:<line number> ............................................................................... -Matchers.tests.cpp:<line number>: -PASSED: +Matchers.tests.cpp:<line number>: PASSED: REQUIRE_THAT( testStringForMatching(), Contains("string") ) with expansion: "this string contains 'abc' as a substring" contains: "string" -Matchers.tests.cpp:<line number>: -PASSED: +Matchers.tests.cpp:<line number>: PASSED: REQUIRE_THAT( testStringForMatching(), Contains("string", Catch::CaseSensitive::No) ) with expansion: "this string contains 'abc' as a substring" contains: "string" (case insensitive) -Matchers.tests.cpp:<line number>: -PASSED: +Matchers.tests.cpp:<line number>: PASSED: CHECK_THAT( testStringForMatching(), Contains("abc") ) with expansion: "this string contains 'abc' as a substring" contains: "abc" -Matchers.tests.cpp:<line number>: -PASSED: +Matchers.tests.cpp:<line number>: PASSED: CHECK_THAT( testStringForMatching(), Contains("aBC", Catch::CaseSensitive::No) ) with expansion: - "this string contains 'abc' as a substring" contains: "abc" (case insensitive) + "this string contains 'abc' as a substring" contains: "abc" (case insensitive) -Matchers.tests.cpp:<line number>: -PASSED: +Matchers.tests.cpp:<line number>: PASSED: CHECK_THAT( testStringForMatching(), StartsWith("this") ) with expansion: "this string contains 'abc' as a substring" starts with: "this" -Matchers.tests.cpp:<line number>: -PASSED: +Matchers.tests.cpp:<line number>: PASSED: CHECK_THAT( testStringForMatching(), StartsWith("THIS", Catch::CaseSensitive::No) ) with expansion: "this string contains 'abc' as a substring" starts with: "this" (case insensitive) -Matchers.tests.cpp:<line number>: -PASSED: +Matchers.tests.cpp:<line number>: PASSED: CHECK_THAT( testStringForMatching(), EndsWith("substring") ) with expansion: "this string contains 'abc' as a substring" ends with: "substring" -Matchers.tests.cpp:<line number>: -PASSED: +Matchers.tests.cpp:<line number>: PASSED: CHECK_THAT( testStringForMatching(), EndsWith(" SuBsTrInG", Catch::CaseSensitive::No) ) with expansion: "this string contains 'abc' as a substring" ends with: " substring" (case @@ -6717,20 +6352,17 @@ StringRef String.tests.cpp:<line number> ............................................................................... -String.tests.cpp:<line number>: -PASSED: +String.tests.cpp:<line number>: PASSED: REQUIRE( empty.empty() ) with expansion: true -String.tests.cpp:<line number>: -PASSED: +String.tests.cpp:<line number>: PASSED: REQUIRE( empty.size() == 0 ) with expansion: 0 == 0 -String.tests.cpp:<line number>: -PASSED: +String.tests.cpp:<line number>: PASSED: REQUIRE( std::strcmp( empty.c_str(), "" ) == 0 ) with expansion: 0 == 0 @@ -6742,26 +6374,22 @@ StringRef String.tests.cpp:<line number> ............................................................................... -String.tests.cpp:<line number>: -PASSED: +String.tests.cpp:<line number>: PASSED: REQUIRE( s.empty() == false ) with expansion: false == false -String.tests.cpp:<line number>: -PASSED: +String.tests.cpp:<line number>: PASSED: REQUIRE( s.size() == 5 ) with expansion: 5 == 5 -String.tests.cpp:<line number>: -PASSED: +String.tests.cpp:<line number>: PASSED: REQUIRE( isSubstring( s ) == false ) with expansion: false == false -String.tests.cpp:<line number>: -PASSED: +String.tests.cpp:<line number>: PASSED: REQUIRE( std::strcmp( rawChars, "hello" ) == 0 ) with expansion: 0 == 0 @@ -6774,20 +6402,17 @@ StringRef String.tests.cpp:<line number> ............................................................................... -String.tests.cpp:<line number>: -PASSED: +String.tests.cpp:<line number>: PASSED: REQUIRE( isOwned( s ) == false ) with expansion: false == false -String.tests.cpp:<line number>: -PASSED: +String.tests.cpp:<line number>: PASSED: REQUIRE( s.c_str() == rawChars ) with expansion: "hello" == "hello" -String.tests.cpp:<line number>: -PASSED: +String.tests.cpp:<line number>: PASSED: REQUIRE( isOwned( s ) == false ) with expansion: false == false @@ -6799,30 +6424,25 @@ StringRef String.tests.cpp:<line number> ............................................................................... -String.tests.cpp:<line number>: -PASSED: +String.tests.cpp:<line number>: PASSED: REQUIRE( original == "original" ) -String.tests.cpp:<line number>: -PASSED: +String.tests.cpp:<line number>: PASSED: REQUIRE( isSubstring( original ) ) with expansion: true -String.tests.cpp:<line number>: -PASSED: +String.tests.cpp:<line number>: PASSED: REQUIRE( isOwned( original ) == false ) with expansion: false == false -String.tests.cpp:<line number>: -PASSED: +String.tests.cpp:<line number>: PASSED: REQUIRE( isSubstring( original ) == false ) with expansion: false == false -String.tests.cpp:<line number>: -PASSED: +String.tests.cpp:<line number>: PASSED: REQUIRE( isOwned( original ) ) with expansion: true @@ -6835,26 +6455,22 @@ StringRef String.tests.cpp:<line number> ............................................................................... -String.tests.cpp:<line number>: -PASSED: +String.tests.cpp:<line number>: PASSED: REQUIRE( ss.empty() == false ) with expansion: false == false -String.tests.cpp:<line number>: -PASSED: +String.tests.cpp:<line number>: PASSED: REQUIRE( ss.size() == 5 ) with expansion: 5 == 5 -String.tests.cpp:<line number>: -PASSED: +String.tests.cpp:<line number>: PASSED: REQUIRE( std::strcmp( ss.c_str(), "hello" ) == 0 ) with expansion: 0 == 0 -String.tests.cpp:<line number>: -PASSED: +String.tests.cpp:<line number>: PASSED: REQUIRE( ss == "hello" ) with expansion: hello == "hello" @@ -6867,44 +6483,37 @@ StringRef String.tests.cpp:<line number> ............................................................................... -String.tests.cpp:<line number>: -PASSED: +String.tests.cpp:<line number>: PASSED: REQUIRE( isSubstring( ss ) ) with expansion: true -String.tests.cpp:<line number>: -PASSED: +String.tests.cpp:<line number>: PASSED: REQUIRE( isOwned( ss ) == false ) with expansion: false == false -String.tests.cpp:<line number>: -PASSED: +String.tests.cpp:<line number>: PASSED: REQUIRE( rawChars == s.currentData() ) with expansion: "hello world!" == "hello world!" -String.tests.cpp:<line number>: -PASSED: +String.tests.cpp:<line number>: PASSED: REQUIRE( ss.c_str() != rawChars ) with expansion: "hello" != "hello world!" -String.tests.cpp:<line number>: -PASSED: +String.tests.cpp:<line number>: PASSED: REQUIRE( isSubstring( ss ) == false ) with expansion: false == false -String.tests.cpp:<line number>: -PASSED: +String.tests.cpp:<line number>: PASSED: REQUIRE( isOwned( ss ) ) with expansion: true -String.tests.cpp:<line number>: -PASSED: +String.tests.cpp:<line number>: PASSED: REQUIRE( ss.currentData() != s.currentData() ) with expansion: "hello" != "hello world!" @@ -6917,14 +6526,12 @@ StringRef String.tests.cpp:<line number> ............................................................................... -String.tests.cpp:<line number>: -PASSED: +String.tests.cpp:<line number>: PASSED: REQUIRE( ss.size() == 6 ) with expansion: 6 == 6 -String.tests.cpp:<line number>: -PASSED: +String.tests.cpp:<line number>: PASSED: REQUIRE( std::strcmp( ss.c_str(), "world!" ) == 0 ) with expansion: 0 == 0 @@ -6937,8 +6544,7 @@ StringRef String.tests.cpp:<line number> ............................................................................... -String.tests.cpp:<line number>: -PASSED: +String.tests.cpp:<line number>: PASSED: REQUIRE( s.c_str() == s2.c_str() ) with expansion: "hello world!" == "hello world!" @@ -6951,8 +6557,7 @@ StringRef String.tests.cpp:<line number> ............................................................................... -String.tests.cpp:<line number>: -PASSED: +String.tests.cpp:<line number>: PASSED: REQUIRE( s.c_str() != ss.c_str() ) with expansion: "hello world!" != "hello" @@ -6964,14 +6569,12 @@ StringRef String.tests.cpp:<line number> ............................................................................... -String.tests.cpp:<line number>: -PASSED: +String.tests.cpp:<line number>: PASSED: REQUIRE( StringRef("hello") == StringRef("hello") ) with expansion: hello == hello -String.tests.cpp:<line number>: -PASSED: +String.tests.cpp:<line number>: PASSED: REQUIRE( StringRef("hello") != StringRef("cello") ) with expansion: hello != cello @@ -6984,14 +6587,12 @@ StringRef String.tests.cpp:<line number> ............................................................................... -String.tests.cpp:<line number>: -PASSED: +String.tests.cpp:<line number>: PASSED: REQUIRE( sr == "a standard string" ) with expansion: a standard string == "a standard string" -String.tests.cpp:<line number>: -PASSED: +String.tests.cpp:<line number>: PASSED: REQUIRE( sr.size() == stdStr.size() ) with expansion: 17 == 17 @@ -7004,14 +6605,12 @@ StringRef String.tests.cpp:<line number> ............................................................................... -String.tests.cpp:<line number>: -PASSED: +String.tests.cpp:<line number>: PASSED: REQUIRE( sr == "a standard string" ) with expansion: a standard string == "a standard string" -String.tests.cpp:<line number>: -PASSED: +String.tests.cpp:<line number>: PASSED: REQUIRE( sr.size() == stdStr.size() ) with expansion: 17 == 17 @@ -7024,14 +6623,12 @@ StringRef String.tests.cpp:<line number> ............................................................................... -String.tests.cpp:<line number>: -PASSED: +String.tests.cpp:<line number>: PASSED: REQUIRE( sr == "a standard string" ) with expansion: a standard string == "a standard string" -String.tests.cpp:<line number>: -PASSED: +String.tests.cpp:<line number>: PASSED: REQUIRE( sr.size() == stdStr.size() ) with expansion: 17 == 17 @@ -7044,14 +6641,12 @@ StringRef String.tests.cpp:<line number> ............................................................................... -String.tests.cpp:<line number>: -PASSED: +String.tests.cpp:<line number>: PASSED: REQUIRE( stdStr == "a stringref" ) with expansion: "a stringref" == "a stringref" -String.tests.cpp:<line number>: -PASSED: +String.tests.cpp:<line number>: PASSED: REQUIRE( stdStr.size() == sr.size() ) with expansion: 11 == 11 @@ -7064,14 +6659,12 @@ StringRef String.tests.cpp:<line number> ............................................................................... -String.tests.cpp:<line number>: -PASSED: +String.tests.cpp:<line number>: PASSED: REQUIRE( stdStr == "a stringref" ) with expansion: "a stringref" == "a stringref" -String.tests.cpp:<line number>: -PASSED: +String.tests.cpp:<line number>: PASSED: REQUIRE( stdStr.size() == sr.size() ) with expansion: 11 == 11 @@ -7084,14 +6677,12 @@ StringRef String.tests.cpp:<line number> ............................................................................... -String.tests.cpp:<line number>: -PASSED: +String.tests.cpp:<line number>: PASSED: REQUIRE( stdStr == "a stringref" ) with expansion: "a stringref" == "a stringref" -String.tests.cpp:<line number>: -PASSED: +String.tests.cpp:<line number>: PASSED: REQUIRE( stdStr.size() == sr.size() ) with expansion: 11 == 11 @@ -7103,20 +6694,17 @@ StringRef String.tests.cpp:<line number> ............................................................................... -String.tests.cpp:<line number>: -PASSED: +String.tests.cpp:<line number>: PASSED: REQUIRE( ascii.numberOfCharacters() == ascii.size() ) with expansion: 39 == 39 -String.tests.cpp:<line number>: -PASSED: +String.tests.cpp:<line number>: PASSED: REQUIRE( simpleu8.numberOfCharacters() == 30 ) with expansion: 30 == 30 -String.tests.cpp:<line number>: -PASSED: +String.tests.cpp:<line number>: PASSED: REQUIRE( emojis.numberOfCharacters() == 9 ) with expansion: 9 == 9 @@ -7127,26 +6715,22 @@ Stringifying std::chrono::duration helpers ToStringChrono.tests.cpp:<line number> ............................................................................... -ToStringChrono.tests.cpp:<line number>: -PASSED: +ToStringChrono.tests.cpp:<line number>: PASSED: REQUIRE( minute == seconds ) with expansion: 1 m == 60 s -ToStringChrono.tests.cpp:<line number>: -PASSED: +ToStringChrono.tests.cpp:<line number>: PASSED: REQUIRE( hour != seconds ) with expansion: 1 h != 60 s -ToStringChrono.tests.cpp:<line number>: -PASSED: +ToStringChrono.tests.cpp:<line number>: PASSED: REQUIRE( micro != milli ) with expansion: 1 us != 1 ms -ToStringChrono.tests.cpp:<line number>: -PASSED: +ToStringChrono.tests.cpp:<line number>: PASSED: REQUIRE( nano != micro ) with expansion: 1 ns != 1 us @@ -7157,14 +6741,12 @@ Stringifying std::chrono::duration with weird ratios ToStringChrono.tests.cpp:<line number> ............................................................................... -ToStringChrono.tests.cpp:<line number>: -PASSED: +ToStringChrono.tests.cpp:<line number>: PASSED: REQUIRE( half_minute != femto_second ) with expansion: 1 [30/1]s != 1 fs -ToStringChrono.tests.cpp:<line number>: -PASSED: +ToStringChrono.tests.cpp:<line number>: PASSED: REQUIRE( pico_second != atto_second ) with expansion: 1 ps != 1 as @@ -7175,8 +6757,7 @@ Stringifying std::chrono::time_point<system_clock> ToStringChrono.tests.cpp:<line number> ............................................................................... -ToStringChrono.tests.cpp:<line number>: -PASSED: +ToStringChrono.tests.cpp:<line number>: PASSED: REQUIRE( now != later ) with expansion: {iso8601-timestamp} @@ -7208,32 +6789,28 @@ Tag alias can be registered against tag patterns TagAlias.tests.cpp:<line number> ............................................................................... -TagAlias.tests.cpp:<line number>: -PASSED: +TagAlias.tests.cpp:<line number>: PASSED: CHECK_THAT( what, Contains( "[@zzz]" ) ) with expansion: "error: tag alias, '[@zzz]' already registered. First seen at: file:2 Redefined at: file:10" contains: "[@zzz]" -TagAlias.tests.cpp:<line number>: -PASSED: +TagAlias.tests.cpp:<line number>: PASSED: CHECK_THAT( what, Contains( "file" ) ) with expansion: "error: tag alias, '[@zzz]' already registered. First seen at: file:2 Redefined at: file:10" contains: "file" -TagAlias.tests.cpp:<line number>: -PASSED: +TagAlias.tests.cpp:<line number>: PASSED: CHECK_THAT( what, Contains( "2" ) ) with expansion: "error: tag alias, '[@zzz]' already registered. First seen at: file:2 Redefined at: file:10" contains: "2" -TagAlias.tests.cpp:<line number>: -PASSED: +TagAlias.tests.cpp:<line number>: PASSED: CHECK_THAT( what, Contains( "10" ) ) with expansion: "error: tag alias, '[@zzz]' already registered. @@ -7247,30 +6824,605 @@ Tag alias can be registered against tag patterns TagAlias.tests.cpp:<line number> ............................................................................... -TagAlias.tests.cpp:<line number>: -PASSED: +TagAlias.tests.cpp:<line number>: PASSED: CHECK_THROWS( registry.add( "[no ampersat]", "", Catch::SourceLineInfo( "file", 3 ) ) ) -TagAlias.tests.cpp:<line number>: -PASSED: +TagAlias.tests.cpp:<line number>: PASSED: CHECK_THROWS( registry.add( "[the @ is not at the start]", "", Catch::SourceLineInfo( "file", 3 ) ) ) -TagAlias.tests.cpp:<line number>: -PASSED: +TagAlias.tests.cpp:<line number>: PASSED: CHECK_THROWS( registry.add( "@no square bracket at start]", "", Catch::SourceLineInfo( "file", 3 ) ) ) -TagAlias.tests.cpp:<line number>: -PASSED: +TagAlias.tests.cpp:<line number>: PASSED: CHECK_THROWS( registry.add( "[@no square bracket at end", "", Catch::SourceLineInfo( "file", 3 ) ) ) +------------------------------------------------------------------------------- +TemplateTest: vectors can be sized and resized - float +------------------------------------------------------------------------------- +Misc.tests.cpp:<line number> +............................................................................... + +Misc.tests.cpp:<line number>: PASSED: + REQUIRE( v.size() == 5 ) +with expansion: + 5 == 5 + +Misc.tests.cpp:<line number>: PASSED: + REQUIRE( v.capacity() >= 5 ) +with expansion: + 5 >= 5 + +------------------------------------------------------------------------------- +TemplateTest: vectors can be sized and resized - float + resizing bigger changes size and capacity +------------------------------------------------------------------------------- +Misc.tests.cpp:<line number> +............................................................................... + +Misc.tests.cpp:<line number>: PASSED: + REQUIRE( v.size() == 10 ) +with expansion: + 10 == 10 + +Misc.tests.cpp:<line number>: PASSED: + REQUIRE( v.capacity() >= 10 ) +with expansion: + 10 >= 10 + +------------------------------------------------------------------------------- +TemplateTest: vectors can be sized and resized - float +------------------------------------------------------------------------------- +Misc.tests.cpp:<line number> +............................................................................... + +Misc.tests.cpp:<line number>: PASSED: + REQUIRE( v.size() == 5 ) +with expansion: + 5 == 5 + +Misc.tests.cpp:<line number>: PASSED: + REQUIRE( v.capacity() >= 5 ) +with expansion: + 5 >= 5 + +------------------------------------------------------------------------------- +TemplateTest: vectors can be sized and resized - float + resizing smaller changes size but not capacity +------------------------------------------------------------------------------- +Misc.tests.cpp:<line number> +............................................................................... + +Misc.tests.cpp:<line number>: PASSED: + REQUIRE( v.size() == 0 ) +with expansion: + 0 == 0 + +Misc.tests.cpp:<line number>: PASSED: + REQUIRE( v.capacity() >= 5 ) +with expansion: + 5 >= 5 + +------------------------------------------------------------------------------- +TemplateTest: vectors can be sized and resized - float + resizing smaller changes size but not capacity + We can use the 'swap trick' to reset the capacity +------------------------------------------------------------------------------- +Misc.tests.cpp:<line number> +............................................................................... + +Misc.tests.cpp:<line number>: PASSED: + REQUIRE( v.capacity() == 0 ) +with expansion: + 0 == 0 + +------------------------------------------------------------------------------- +TemplateTest: vectors can be sized and resized - float +------------------------------------------------------------------------------- +Misc.tests.cpp:<line number> +............................................................................... + +Misc.tests.cpp:<line number>: PASSED: + REQUIRE( v.size() == 5 ) +with expansion: + 5 == 5 + +Misc.tests.cpp:<line number>: PASSED: + REQUIRE( v.capacity() >= 5 ) +with expansion: + 5 >= 5 + +------------------------------------------------------------------------------- +TemplateTest: vectors can be sized and resized - float + reserving bigger changes capacity but not size +------------------------------------------------------------------------------- +Misc.tests.cpp:<line number> +............................................................................... + +Misc.tests.cpp:<line number>: PASSED: + REQUIRE( v.size() == 5 ) +with expansion: + 5 == 5 + +Misc.tests.cpp:<line number>: PASSED: + REQUIRE( v.capacity() >= 10 ) +with expansion: + 10 >= 10 + +------------------------------------------------------------------------------- +TemplateTest: vectors can be sized and resized - float +------------------------------------------------------------------------------- +Misc.tests.cpp:<line number> +............................................................................... + +Misc.tests.cpp:<line number>: PASSED: + REQUIRE( v.size() == 5 ) +with expansion: + 5 == 5 + +Misc.tests.cpp:<line number>: PASSED: + REQUIRE( v.capacity() >= 5 ) +with expansion: + 5 >= 5 + +------------------------------------------------------------------------------- +TemplateTest: vectors can be sized and resized - float + reserving smaller does not change size or capacity +------------------------------------------------------------------------------- +Misc.tests.cpp:<line number> +............................................................................... + +Misc.tests.cpp:<line number>: PASSED: + REQUIRE( v.size() == 5 ) +with expansion: + 5 == 5 + +Misc.tests.cpp:<line number>: PASSED: + REQUIRE( v.capacity() >= 5 ) +with expansion: + 5 >= 5 + +------------------------------------------------------------------------------- +TemplateTest: vectors can be sized and resized - int +------------------------------------------------------------------------------- +Misc.tests.cpp:<line number> +............................................................................... + +Misc.tests.cpp:<line number>: PASSED: + REQUIRE( v.size() == 5 ) +with expansion: + 5 == 5 + +Misc.tests.cpp:<line number>: PASSED: + REQUIRE( v.capacity() >= 5 ) +with expansion: + 5 >= 5 + +------------------------------------------------------------------------------- +TemplateTest: vectors can be sized and resized - int + resizing bigger changes size and capacity +------------------------------------------------------------------------------- +Misc.tests.cpp:<line number> +............................................................................... + +Misc.tests.cpp:<line number>: PASSED: + REQUIRE( v.size() == 10 ) +with expansion: + 10 == 10 + +Misc.tests.cpp:<line number>: PASSED: + REQUIRE( v.capacity() >= 10 ) +with expansion: + 10 >= 10 + +------------------------------------------------------------------------------- +TemplateTest: vectors can be sized and resized - int +------------------------------------------------------------------------------- +Misc.tests.cpp:<line number> +............................................................................... + +Misc.tests.cpp:<line number>: PASSED: + REQUIRE( v.size() == 5 ) +with expansion: + 5 == 5 + +Misc.tests.cpp:<line number>: PASSED: + REQUIRE( v.capacity() >= 5 ) +with expansion: + 5 >= 5 + +------------------------------------------------------------------------------- +TemplateTest: vectors can be sized and resized - int + resizing smaller changes size but not capacity +------------------------------------------------------------------------------- +Misc.tests.cpp:<line number> +............................................................................... + +Misc.tests.cpp:<line number>: PASSED: + REQUIRE( v.size() == 0 ) +with expansion: + 0 == 0 + +Misc.tests.cpp:<line number>: PASSED: + REQUIRE( v.capacity() >= 5 ) +with expansion: + 5 >= 5 + +------------------------------------------------------------------------------- +TemplateTest: vectors can be sized and resized - int + resizing smaller changes size but not capacity + We can use the 'swap trick' to reset the capacity +------------------------------------------------------------------------------- +Misc.tests.cpp:<line number> +............................................................................... + +Misc.tests.cpp:<line number>: PASSED: + REQUIRE( v.capacity() == 0 ) +with expansion: + 0 == 0 + +------------------------------------------------------------------------------- +TemplateTest: vectors can be sized and resized - int +------------------------------------------------------------------------------- +Misc.tests.cpp:<line number> +............................................................................... + +Misc.tests.cpp:<line number>: PASSED: + REQUIRE( v.size() == 5 ) +with expansion: + 5 == 5 + +Misc.tests.cpp:<line number>: PASSED: + REQUIRE( v.capacity() >= 5 ) +with expansion: + 5 >= 5 + +------------------------------------------------------------------------------- +TemplateTest: vectors can be sized and resized - int + reserving bigger changes capacity but not size +------------------------------------------------------------------------------- +Misc.tests.cpp:<line number> +............................................................................... + +Misc.tests.cpp:<line number>: PASSED: + REQUIRE( v.size() == 5 ) +with expansion: + 5 == 5 + +Misc.tests.cpp:<line number>: PASSED: + REQUIRE( v.capacity() >= 10 ) +with expansion: + 10 >= 10 + +------------------------------------------------------------------------------- +TemplateTest: vectors can be sized and resized - int +------------------------------------------------------------------------------- +Misc.tests.cpp:<line number> +............................................................................... + +Misc.tests.cpp:<line number>: PASSED: + REQUIRE( v.size() == 5 ) +with expansion: + 5 == 5 + +Misc.tests.cpp:<line number>: PASSED: + REQUIRE( v.capacity() >= 5 ) +with expansion: + 5 >= 5 + +------------------------------------------------------------------------------- +TemplateTest: vectors can be sized and resized - int + reserving smaller does not change size or capacity +------------------------------------------------------------------------------- +Misc.tests.cpp:<line number> +............................................................................... + +Misc.tests.cpp:<line number>: PASSED: + REQUIRE( v.size() == 5 ) +with expansion: + 5 == 5 + +Misc.tests.cpp:<line number>: PASSED: + REQUIRE( v.capacity() >= 5 ) +with expansion: + 5 >= 5 + +------------------------------------------------------------------------------- +TemplateTest: vectors can be sized and resized - std::string +------------------------------------------------------------------------------- +Misc.tests.cpp:<line number> +............................................................................... + +Misc.tests.cpp:<line number>: PASSED: + REQUIRE( v.size() == 5 ) +with expansion: + 5 == 5 + +Misc.tests.cpp:<line number>: PASSED: + REQUIRE( v.capacity() >= 5 ) +with expansion: + 5 >= 5 + +------------------------------------------------------------------------------- +TemplateTest: vectors can be sized and resized - std::string + resizing bigger changes size and capacity +------------------------------------------------------------------------------- +Misc.tests.cpp:<line number> +............................................................................... + +Misc.tests.cpp:<line number>: PASSED: + REQUIRE( v.size() == 10 ) +with expansion: + 10 == 10 + +Misc.tests.cpp:<line number>: PASSED: + REQUIRE( v.capacity() >= 10 ) +with expansion: + 10 >= 10 + +------------------------------------------------------------------------------- +TemplateTest: vectors can be sized and resized - std::string +------------------------------------------------------------------------------- +Misc.tests.cpp:<line number> +............................................................................... + +Misc.tests.cpp:<line number>: PASSED: + REQUIRE( v.size() == 5 ) +with expansion: + 5 == 5 + +Misc.tests.cpp:<line number>: PASSED: + REQUIRE( v.capacity() >= 5 ) +with expansion: + 5 >= 5 + +------------------------------------------------------------------------------- +TemplateTest: vectors can be sized and resized - std::string + resizing smaller changes size but not capacity +------------------------------------------------------------------------------- +Misc.tests.cpp:<line number> +............................................................................... + +Misc.tests.cpp:<line number>: PASSED: + REQUIRE( v.size() == 0 ) +with expansion: + 0 == 0 + +Misc.tests.cpp:<line number>: PASSED: + REQUIRE( v.capacity() >= 5 ) +with expansion: + 5 >= 5 + +------------------------------------------------------------------------------- +TemplateTest: vectors can be sized and resized - std::string + resizing smaller changes size but not capacity + We can use the 'swap trick' to reset the capacity +------------------------------------------------------------------------------- +Misc.tests.cpp:<line number> +............................................................................... + +Misc.tests.cpp:<line number>: PASSED: + REQUIRE( v.capacity() == 0 ) +with expansion: + 0 == 0 + +------------------------------------------------------------------------------- +TemplateTest: vectors can be sized and resized - std::string +------------------------------------------------------------------------------- +Misc.tests.cpp:<line number> +............................................................................... + +Misc.tests.cpp:<line number>: PASSED: + REQUIRE( v.size() == 5 ) +with expansion: + 5 == 5 + +Misc.tests.cpp:<line number>: PASSED: + REQUIRE( v.capacity() >= 5 ) +with expansion: + 5 >= 5 + +------------------------------------------------------------------------------- +TemplateTest: vectors can be sized and resized - std::string + reserving bigger changes capacity but not size +------------------------------------------------------------------------------- +Misc.tests.cpp:<line number> +............................................................................... + +Misc.tests.cpp:<line number>: PASSED: + REQUIRE( v.size() == 5 ) +with expansion: + 5 == 5 + +Misc.tests.cpp:<line number>: PASSED: + REQUIRE( v.capacity() >= 10 ) +with expansion: + 10 >= 10 + +------------------------------------------------------------------------------- +TemplateTest: vectors can be sized and resized - std::string +------------------------------------------------------------------------------- +Misc.tests.cpp:<line number> +............................................................................... + +Misc.tests.cpp:<line number>: PASSED: + REQUIRE( v.size() == 5 ) +with expansion: + 5 == 5 + +Misc.tests.cpp:<line number>: PASSED: + REQUIRE( v.capacity() >= 5 ) +with expansion: + 5 >= 5 + +------------------------------------------------------------------------------- +TemplateTest: vectors can be sized and resized - std::string + reserving smaller does not change size or capacity +------------------------------------------------------------------------------- +Misc.tests.cpp:<line number> +............................................................................... + +Misc.tests.cpp:<line number>: PASSED: + REQUIRE( v.size() == 5 ) +with expansion: + 5 == 5 + +Misc.tests.cpp:<line number>: PASSED: + REQUIRE( v.capacity() >= 5 ) +with expansion: + 5 >= 5 + +------------------------------------------------------------------------------- +TemplateTest: vectors can be sized and resized - std::tuple<int,float> +------------------------------------------------------------------------------- +Misc.tests.cpp:<line number> +............................................................................... + +Misc.tests.cpp:<line number>: PASSED: + REQUIRE( v.size() == 5 ) +with expansion: + 5 == 5 + +Misc.tests.cpp:<line number>: PASSED: + REQUIRE( v.capacity() >= 5 ) +with expansion: + 5 >= 5 + +------------------------------------------------------------------------------- +TemplateTest: vectors can be sized and resized - std::tuple<int,float> + resizing bigger changes size and capacity +------------------------------------------------------------------------------- +Misc.tests.cpp:<line number> +............................................................................... + +Misc.tests.cpp:<line number>: PASSED: + REQUIRE( v.size() == 10 ) +with expansion: + 10 == 10 + +Misc.tests.cpp:<line number>: PASSED: + REQUIRE( v.capacity() >= 10 ) +with expansion: + 10 >= 10 + +------------------------------------------------------------------------------- +TemplateTest: vectors can be sized and resized - std::tuple<int,float> +------------------------------------------------------------------------------- +Misc.tests.cpp:<line number> +............................................................................... + +Misc.tests.cpp:<line number>: PASSED: + REQUIRE( v.size() == 5 ) +with expansion: + 5 == 5 + +Misc.tests.cpp:<line number>: PASSED: + REQUIRE( v.capacity() >= 5 ) +with expansion: + 5 >= 5 + +------------------------------------------------------------------------------- +TemplateTest: vectors can be sized and resized - std::tuple<int,float> + resizing smaller changes size but not capacity +------------------------------------------------------------------------------- +Misc.tests.cpp:<line number> +............................................................................... + +Misc.tests.cpp:<line number>: PASSED: + REQUIRE( v.size() == 0 ) +with expansion: + 0 == 0 + +Misc.tests.cpp:<line number>: PASSED: + REQUIRE( v.capacity() >= 5 ) +with expansion: + 5 >= 5 + +------------------------------------------------------------------------------- +TemplateTest: vectors can be sized and resized - std::tuple<int,float> + resizing smaller changes size but not capacity + We can use the 'swap trick' to reset the capacity +------------------------------------------------------------------------------- +Misc.tests.cpp:<line number> +............................................................................... + +Misc.tests.cpp:<line number>: PASSED: + REQUIRE( v.capacity() == 0 ) +with expansion: + 0 == 0 + +------------------------------------------------------------------------------- +TemplateTest: vectors can be sized and resized - std::tuple<int,float> +------------------------------------------------------------------------------- +Misc.tests.cpp:<line number> +............................................................................... + +Misc.tests.cpp:<line number>: PASSED: + REQUIRE( v.size() == 5 ) +with expansion: + 5 == 5 + +Misc.tests.cpp:<line number>: PASSED: + REQUIRE( v.capacity() >= 5 ) +with expansion: + 5 >= 5 + +------------------------------------------------------------------------------- +TemplateTest: vectors can be sized and resized - std::tuple<int,float> + reserving bigger changes capacity but not size +------------------------------------------------------------------------------- +Misc.tests.cpp:<line number> +............................................................................... + +Misc.tests.cpp:<line number>: PASSED: + REQUIRE( v.size() == 5 ) +with expansion: + 5 == 5 + +Misc.tests.cpp:<line number>: PASSED: + REQUIRE( v.capacity() >= 10 ) +with expansion: + 10 >= 10 + +------------------------------------------------------------------------------- +TemplateTest: vectors can be sized and resized - std::tuple<int,float> +------------------------------------------------------------------------------- +Misc.tests.cpp:<line number> +............................................................................... + +Misc.tests.cpp:<line number>: PASSED: + REQUIRE( v.size() == 5 ) +with expansion: + 5 == 5 + +Misc.tests.cpp:<line number>: PASSED: + REQUIRE( v.capacity() >= 5 ) +with expansion: + 5 >= 5 + +------------------------------------------------------------------------------- +TemplateTest: vectors can be sized and resized - std::tuple<int,float> + reserving smaller does not change size or capacity +------------------------------------------------------------------------------- +Misc.tests.cpp:<line number> +............................................................................... + +Misc.tests.cpp:<line number>: PASSED: + REQUIRE( v.size() == 5 ) +with expansion: + 5 == 5 + +Misc.tests.cpp:<line number>: PASSED: + REQUIRE( v.capacity() >= 5 ) +with expansion: + 5 >= 5 + ------------------------------------------------------------------------------- Test case with one argument ------------------------------------------------------------------------------- VariadicMacros.tests.cpp:<line number> ............................................................................... -VariadicMacros.tests.cpp:<line number>: -PASSED: +VariadicMacros.tests.cpp:<line number>: PASSED: with message: no assertions @@ -7280,8 +7432,7 @@ Test enum bit values Tricky.tests.cpp:<line number> ............................................................................... -Tricky.tests.cpp:<line number>: -PASSED: +Tricky.tests.cpp:<line number>: PASSED: REQUIRE( 0x<hex digits> == bit30and31 ) with expansion: 3221225472 (0x<hex digits>) == 3221225472 @@ -7292,8 +7443,7 @@ The NO_FAIL macro reports a failure but does not fail the test Message.tests.cpp:<line number> ............................................................................... -Message.tests.cpp:<line number>: -FAILED - but was ok: +Message.tests.cpp:<line number>: FAILED - but was ok: CHECK_NOFAIL( 1 == 2 ) @@ -7305,8 +7455,7 @@ This test 'should' fail but doesn't Misc.tests.cpp:<line number> ............................................................................... -Misc.tests.cpp:<line number>: -PASSED: +Misc.tests.cpp:<line number>: PASSED: with message: oops! @@ -7326,14 +7475,12 @@ Tracker PartTracker.tests.cpp:<line number> ............................................................................... -PartTracker.tests.cpp:<line number>: -PASSED: +PartTracker.tests.cpp:<line number>: PASSED: REQUIRE( testCase.isOpen() ) with expansion: true -PartTracker.tests.cpp:<line number>: -PASSED: +PartTracker.tests.cpp:<line number>: PASSED: REQUIRE( s1.isOpen() ) with expansion: true @@ -7345,26 +7492,22 @@ Tracker PartTracker.tests.cpp:<line number> ............................................................................... -PartTracker.tests.cpp:<line number>: -PASSED: +PartTracker.tests.cpp:<line number>: PASSED: REQUIRE( s1.isSuccessfullyCompleted() ) with expansion: true -PartTracker.tests.cpp:<line number>: -PASSED: +PartTracker.tests.cpp:<line number>: PASSED: REQUIRE( testCase.isComplete() == false ) with expansion: false == false -PartTracker.tests.cpp:<line number>: -PASSED: +PartTracker.tests.cpp:<line number>: PASSED: REQUIRE( ctx.completedCycle() ) with expansion: true -PartTracker.tests.cpp:<line number>: -PASSED: +PartTracker.tests.cpp:<line number>: PASSED: REQUIRE( testCase.isSuccessfullyCompleted() ) with expansion: true @@ -7375,14 +7518,12 @@ Tracker PartTracker.tests.cpp:<line number> ............................................................................... -PartTracker.tests.cpp:<line number>: -PASSED: +PartTracker.tests.cpp:<line number>: PASSED: REQUIRE( testCase.isOpen() ) with expansion: true -PartTracker.tests.cpp:<line number>: -PASSED: +PartTracker.tests.cpp:<line number>: PASSED: REQUIRE( s1.isOpen() ) with expansion: true @@ -7394,32 +7535,27 @@ Tracker PartTracker.tests.cpp:<line number> ............................................................................... -PartTracker.tests.cpp:<line number>: -PASSED: +PartTracker.tests.cpp:<line number>: PASSED: REQUIRE( s1.isComplete() ) with expansion: true -PartTracker.tests.cpp:<line number>: -PASSED: +PartTracker.tests.cpp:<line number>: PASSED: REQUIRE( s1.isSuccessfullyCompleted() == false ) with expansion: false == false -PartTracker.tests.cpp:<line number>: -PASSED: +PartTracker.tests.cpp:<line number>: PASSED: REQUIRE( testCase.isComplete() == false ) with expansion: false == false -PartTracker.tests.cpp:<line number>: -PASSED: +PartTracker.tests.cpp:<line number>: PASSED: REQUIRE( ctx.completedCycle() ) with expansion: true -PartTracker.tests.cpp:<line number>: -PASSED: +PartTracker.tests.cpp:<line number>: PASSED: REQUIRE( testCase.isSuccessfullyCompleted() == false ) with expansion: false == false @@ -7432,32 +7568,27 @@ Tracker PartTracker.tests.cpp:<line number> ............................................................................... -PartTracker.tests.cpp:<line number>: -PASSED: +PartTracker.tests.cpp:<line number>: PASSED: REQUIRE( testCase2.isOpen() ) with expansion: true -PartTracker.tests.cpp:<line number>: -PASSED: +PartTracker.tests.cpp:<line number>: PASSED: REQUIRE( s1b.isOpen() == false ) with expansion: false == false -PartTracker.tests.cpp:<line number>: -PASSED: +PartTracker.tests.cpp:<line number>: PASSED: REQUIRE( ctx.completedCycle() ) with expansion: true -PartTracker.tests.cpp:<line number>: -PASSED: +PartTracker.tests.cpp:<line number>: PASSED: REQUIRE( testCase.isComplete() ) with expansion: true -PartTracker.tests.cpp:<line number>: -PASSED: +PartTracker.tests.cpp:<line number>: PASSED: REQUIRE( testCase.isSuccessfullyCompleted() ) with expansion: true @@ -7468,14 +7599,12 @@ Tracker PartTracker.tests.cpp:<line number> ............................................................................... -PartTracker.tests.cpp:<line number>: -PASSED: +PartTracker.tests.cpp:<line number>: PASSED: REQUIRE( testCase.isOpen() ) with expansion: true -PartTracker.tests.cpp:<line number>: -PASSED: +PartTracker.tests.cpp:<line number>: PASSED: REQUIRE( s1.isOpen() ) with expansion: true @@ -7487,32 +7616,27 @@ Tracker PartTracker.tests.cpp:<line number> ............................................................................... -PartTracker.tests.cpp:<line number>: -PASSED: +PartTracker.tests.cpp:<line number>: PASSED: REQUIRE( s1.isComplete() ) with expansion: true -PartTracker.tests.cpp:<line number>: -PASSED: +PartTracker.tests.cpp:<line number>: PASSED: REQUIRE( s1.isSuccessfullyCompleted() == false ) with expansion: false == false -PartTracker.tests.cpp:<line number>: -PASSED: +PartTracker.tests.cpp:<line number>: PASSED: REQUIRE( testCase.isComplete() == false ) with expansion: false == false -PartTracker.tests.cpp:<line number>: -PASSED: +PartTracker.tests.cpp:<line number>: PASSED: REQUIRE( ctx.completedCycle() ) with expansion: true -PartTracker.tests.cpp:<line number>: -PASSED: +PartTracker.tests.cpp:<line number>: PASSED: REQUIRE( testCase.isSuccessfullyCompleted() == false ) with expansion: false == false @@ -7525,38 +7649,32 @@ Tracker PartTracker.tests.cpp:<line number> ............................................................................... -PartTracker.tests.cpp:<line number>: -PASSED: +PartTracker.tests.cpp:<line number>: PASSED: REQUIRE( testCase2.isOpen() ) with expansion: true -PartTracker.tests.cpp:<line number>: -PASSED: +PartTracker.tests.cpp:<line number>: PASSED: REQUIRE( s1b.isOpen() == false ) with expansion: false == false -PartTracker.tests.cpp:<line number>: -PASSED: +PartTracker.tests.cpp:<line number>: PASSED: REQUIRE( s2.isOpen() ) with expansion: true -PartTracker.tests.cpp:<line number>: -PASSED: +PartTracker.tests.cpp:<line number>: PASSED: REQUIRE( ctx.completedCycle() ) with expansion: true -PartTracker.tests.cpp:<line number>: -PASSED: +PartTracker.tests.cpp:<line number>: PASSED: REQUIRE( testCase.isComplete() ) with expansion: true -PartTracker.tests.cpp:<line number>: -PASSED: +PartTracker.tests.cpp:<line number>: PASSED: REQUIRE( testCase.isSuccessfullyCompleted() ) with expansion: true @@ -7567,14 +7685,12 @@ Tracker PartTracker.tests.cpp:<line number> ............................................................................... -PartTracker.tests.cpp:<line number>: -PASSED: +PartTracker.tests.cpp:<line number>: PASSED: REQUIRE( testCase.isOpen() ) with expansion: true -PartTracker.tests.cpp:<line number>: -PASSED: +PartTracker.tests.cpp:<line number>: PASSED: REQUIRE( s1.isOpen() ) with expansion: true @@ -7586,14 +7702,12 @@ Tracker PartTracker.tests.cpp:<line number> ............................................................................... -PartTracker.tests.cpp:<line number>: -PASSED: +PartTracker.tests.cpp:<line number>: PASSED: REQUIRE( s2.isOpen() == false ) with expansion: false == false -PartTracker.tests.cpp:<line number>: -PASSED: +PartTracker.tests.cpp:<line number>: PASSED: REQUIRE( testCase.isComplete() == false ) with expansion: false == false @@ -7606,26 +7720,22 @@ Tracker PartTracker.tests.cpp:<line number> ............................................................................... -PartTracker.tests.cpp:<line number>: -PASSED: +PartTracker.tests.cpp:<line number>: PASSED: REQUIRE( testCase2.isOpen() ) with expansion: true -PartTracker.tests.cpp:<line number>: -PASSED: +PartTracker.tests.cpp:<line number>: PASSED: REQUIRE( s1b.isOpen() == false ) with expansion: false == false -PartTracker.tests.cpp:<line number>: -PASSED: +PartTracker.tests.cpp:<line number>: PASSED: REQUIRE( s2b.isOpen() ) with expansion: true -PartTracker.tests.cpp:<line number>: -PASSED: +PartTracker.tests.cpp:<line number>: PASSED: REQUIRE( ctx.completedCycle() == false ) with expansion: false == false @@ -7639,26 +7749,22 @@ Tracker PartTracker.tests.cpp:<line number> ............................................................................... -PartTracker.tests.cpp:<line number>: -PASSED: +PartTracker.tests.cpp:<line number>: PASSED: REQUIRE( ctx.completedCycle() ) with expansion: true -PartTracker.tests.cpp:<line number>: -PASSED: +PartTracker.tests.cpp:<line number>: PASSED: REQUIRE( s2b.isSuccessfullyCompleted() ) with expansion: true -PartTracker.tests.cpp:<line number>: -PASSED: +PartTracker.tests.cpp:<line number>: PASSED: REQUIRE( testCase2.isComplete() == false ) with expansion: false == false -PartTracker.tests.cpp:<line number>: -PASSED: +PartTracker.tests.cpp:<line number>: PASSED: REQUIRE( testCase2.isSuccessfullyCompleted() ) with expansion: true @@ -7669,14 +7775,12 @@ Tracker PartTracker.tests.cpp:<line number> ............................................................................... -PartTracker.tests.cpp:<line number>: -PASSED: +PartTracker.tests.cpp:<line number>: PASSED: REQUIRE( testCase.isOpen() ) with expansion: true -PartTracker.tests.cpp:<line number>: -PASSED: +PartTracker.tests.cpp:<line number>: PASSED: REQUIRE( s1.isOpen() ) with expansion: true @@ -7688,14 +7792,12 @@ Tracker PartTracker.tests.cpp:<line number> ............................................................................... -PartTracker.tests.cpp:<line number>: -PASSED: +PartTracker.tests.cpp:<line number>: PASSED: REQUIRE( s2.isOpen() == false ) with expansion: false == false -PartTracker.tests.cpp:<line number>: -PASSED: +PartTracker.tests.cpp:<line number>: PASSED: REQUIRE( testCase.isComplete() == false ) with expansion: false == false @@ -7708,26 +7810,22 @@ Tracker PartTracker.tests.cpp:<line number> ............................................................................... -PartTracker.tests.cpp:<line number>: -PASSED: +PartTracker.tests.cpp:<line number>: PASSED: REQUIRE( testCase2.isOpen() ) with expansion: true -PartTracker.tests.cpp:<line number>: -PASSED: +PartTracker.tests.cpp:<line number>: PASSED: REQUIRE( s1b.isOpen() == false ) with expansion: false == false -PartTracker.tests.cpp:<line number>: -PASSED: +PartTracker.tests.cpp:<line number>: PASSED: REQUIRE( s2b.isOpen() ) with expansion: true -PartTracker.tests.cpp:<line number>: -PASSED: +PartTracker.tests.cpp:<line number>: PASSED: REQUIRE( ctx.completedCycle() == false ) with expansion: false == false @@ -7741,50 +7839,42 @@ Tracker PartTracker.tests.cpp:<line number> ............................................................................... -PartTracker.tests.cpp:<line number>: -PASSED: +PartTracker.tests.cpp:<line number>: PASSED: REQUIRE( ctx.completedCycle() ) with expansion: true -PartTracker.tests.cpp:<line number>: -PASSED: +PartTracker.tests.cpp:<line number>: PASSED: REQUIRE( s2b.isComplete() ) with expansion: true -PartTracker.tests.cpp:<line number>: -PASSED: +PartTracker.tests.cpp:<line number>: PASSED: REQUIRE( s2b.isSuccessfullyCompleted() == false ) with expansion: false == false -PartTracker.tests.cpp:<line number>: -PASSED: +PartTracker.tests.cpp:<line number>: PASSED: REQUIRE( testCase2.isSuccessfullyCompleted() == false ) with expansion: false == false -PartTracker.tests.cpp:<line number>: -PASSED: +PartTracker.tests.cpp:<line number>: PASSED: REQUIRE( testCase3.isOpen() ) with expansion: true -PartTracker.tests.cpp:<line number>: -PASSED: +PartTracker.tests.cpp:<line number>: PASSED: REQUIRE( s1c.isOpen() == false ) with expansion: false == false -PartTracker.tests.cpp:<line number>: -PASSED: +PartTracker.tests.cpp:<line number>: PASSED: REQUIRE( s2c.isOpen() == false ) with expansion: false == false -PartTracker.tests.cpp:<line number>: -PASSED: +PartTracker.tests.cpp:<line number>: PASSED: REQUIRE( testCase3.isSuccessfullyCompleted() ) with expansion: true @@ -7795,14 +7885,12 @@ Tracker PartTracker.tests.cpp:<line number> ............................................................................... -PartTracker.tests.cpp:<line number>: -PASSED: +PartTracker.tests.cpp:<line number>: PASSED: REQUIRE( testCase.isOpen() ) with expansion: true -PartTracker.tests.cpp:<line number>: -PASSED: +PartTracker.tests.cpp:<line number>: PASSED: REQUIRE( s1.isOpen() ) with expansion: true @@ -7814,38 +7902,32 @@ Tracker PartTracker.tests.cpp:<line number> ............................................................................... -PartTracker.tests.cpp:<line number>: -PASSED: +PartTracker.tests.cpp:<line number>: PASSED: REQUIRE( s2.isOpen() ) with expansion: true -PartTracker.tests.cpp:<line number>: -PASSED: +PartTracker.tests.cpp:<line number>: PASSED: REQUIRE( s2.isComplete() ) with expansion: true -PartTracker.tests.cpp:<line number>: -PASSED: +PartTracker.tests.cpp:<line number>: PASSED: REQUIRE( s1.isComplete() == false ) with expansion: false == false -PartTracker.tests.cpp:<line number>: -PASSED: +PartTracker.tests.cpp:<line number>: PASSED: REQUIRE( s1.isComplete() ) with expansion: true -PartTracker.tests.cpp:<line number>: -PASSED: +PartTracker.tests.cpp:<line number>: PASSED: REQUIRE( testCase.isComplete() == false ) with expansion: false == false -PartTracker.tests.cpp:<line number>: -PASSED: +PartTracker.tests.cpp:<line number>: PASSED: REQUIRE( testCase.isComplete() ) with expansion: true @@ -7856,14 +7938,12 @@ Tracker PartTracker.tests.cpp:<line number> ............................................................................... -PartTracker.tests.cpp:<line number>: -PASSED: +PartTracker.tests.cpp:<line number>: PASSED: REQUIRE( testCase.isOpen() ) with expansion: true -PartTracker.tests.cpp:<line number>: -PASSED: +PartTracker.tests.cpp:<line number>: PASSED: REQUIRE( s1.isOpen() ) with expansion: true @@ -7875,26 +7955,22 @@ Tracker PartTracker.tests.cpp:<line number> ............................................................................... -PartTracker.tests.cpp:<line number>: -PASSED: +PartTracker.tests.cpp:<line number>: PASSED: REQUIRE( g1.isOpen() ) with expansion: true -PartTracker.tests.cpp:<line number>: -PASSED: +PartTracker.tests.cpp:<line number>: PASSED: REQUIRE( g1.index() == 0 ) with expansion: 0 == 0 -PartTracker.tests.cpp:<line number>: -PASSED: +PartTracker.tests.cpp:<line number>: PASSED: REQUIRE( g1.isComplete() == false ) with expansion: false == false -PartTracker.tests.cpp:<line number>: -PASSED: +PartTracker.tests.cpp:<line number>: PASSED: REQUIRE( s1.isComplete() == false ) with expansion: false == false @@ -7907,14 +7983,12 @@ Tracker PartTracker.tests.cpp:<line number> ............................................................................... -PartTracker.tests.cpp:<line number>: -PASSED: +PartTracker.tests.cpp:<line number>: PASSED: REQUIRE( s1.isComplete() == false ) with expansion: false == false -PartTracker.tests.cpp:<line number>: -PASSED: +PartTracker.tests.cpp:<line number>: PASSED: REQUIRE( testCase.isSuccessfullyCompleted() == false ) with expansion: false == false @@ -7928,50 +8002,42 @@ Tracker PartTracker.tests.cpp:<line number> ............................................................................... -PartTracker.tests.cpp:<line number>: -PASSED: +PartTracker.tests.cpp:<line number>: PASSED: REQUIRE( testCase2.isOpen() ) with expansion: true -PartTracker.tests.cpp:<line number>: -PASSED: +PartTracker.tests.cpp:<line number>: PASSED: REQUIRE( s1b.isOpen() ) with expansion: true -PartTracker.tests.cpp:<line number>: -PASSED: +PartTracker.tests.cpp:<line number>: PASSED: REQUIRE( g1b.isOpen() ) with expansion: true -PartTracker.tests.cpp:<line number>: -PASSED: +PartTracker.tests.cpp:<line number>: PASSED: REQUIRE( g1b.index() == 1 ) with expansion: 1 == 1 -PartTracker.tests.cpp:<line number>: -PASSED: +PartTracker.tests.cpp:<line number>: PASSED: REQUIRE( s1.isComplete() == false ) with expansion: false == false -PartTracker.tests.cpp:<line number>: -PASSED: +PartTracker.tests.cpp:<line number>: PASSED: REQUIRE( s1b.isComplete() ) with expansion: true -PartTracker.tests.cpp:<line number>: -PASSED: +PartTracker.tests.cpp:<line number>: PASSED: REQUIRE( g1b.isComplete() ) with expansion: true -PartTracker.tests.cpp:<line number>: -PASSED: +PartTracker.tests.cpp:<line number>: PASSED: REQUIRE( testCase2.isComplete() ) with expansion: true @@ -7982,14 +8048,12 @@ Tracker PartTracker.tests.cpp:<line number> ............................................................................... -PartTracker.tests.cpp:<line number>: -PASSED: +PartTracker.tests.cpp:<line number>: PASSED: REQUIRE( testCase.isOpen() ) with expansion: true -PartTracker.tests.cpp:<line number>: -PASSED: +PartTracker.tests.cpp:<line number>: PASSED: REQUIRE( s1.isOpen() ) with expansion: true @@ -8001,26 +8065,22 @@ Tracker PartTracker.tests.cpp:<line number> ............................................................................... -PartTracker.tests.cpp:<line number>: -PASSED: +PartTracker.tests.cpp:<line number>: PASSED: REQUIRE( g1.isOpen() ) with expansion: true -PartTracker.tests.cpp:<line number>: -PASSED: +PartTracker.tests.cpp:<line number>: PASSED: REQUIRE( g1.index() == 0 ) with expansion: 0 == 0 -PartTracker.tests.cpp:<line number>: -PASSED: +PartTracker.tests.cpp:<line number>: PASSED: REQUIRE( g1.isComplete() == false ) with expansion: false == false -PartTracker.tests.cpp:<line number>: -PASSED: +PartTracker.tests.cpp:<line number>: PASSED: REQUIRE( s1.isComplete() == false ) with expansion: false == false @@ -8033,26 +8093,22 @@ Tracker PartTracker.tests.cpp:<line number> ............................................................................... -PartTracker.tests.cpp:<line number>: -PASSED: +PartTracker.tests.cpp:<line number>: PASSED: REQUIRE( s2.isOpen() ) with expansion: true -PartTracker.tests.cpp:<line number>: -PASSED: +PartTracker.tests.cpp:<line number>: PASSED: REQUIRE( s2.isComplete() ) with expansion: true -PartTracker.tests.cpp:<line number>: -PASSED: +PartTracker.tests.cpp:<line number>: PASSED: REQUIRE( s1.isComplete() == false ) with expansion: false == false -PartTracker.tests.cpp:<line number>: -PASSED: +PartTracker.tests.cpp:<line number>: PASSED: REQUIRE( testCase.isComplete() == false ) with expansion: false == false @@ -8066,56 +8122,47 @@ Tracker PartTracker.tests.cpp:<line number> ............................................................................... -PartTracker.tests.cpp:<line number>: -PASSED: +PartTracker.tests.cpp:<line number>: PASSED: REQUIRE( testCase2.isOpen() ) with expansion: true -PartTracker.tests.cpp:<line number>: -PASSED: +PartTracker.tests.cpp:<line number>: PASSED: REQUIRE( s1b.isOpen() ) with expansion: true -PartTracker.tests.cpp:<line number>: -PASSED: +PartTracker.tests.cpp:<line number>: PASSED: REQUIRE( g1b.isOpen() ) with expansion: true -PartTracker.tests.cpp:<line number>: -PASSED: +PartTracker.tests.cpp:<line number>: PASSED: REQUIRE( g1b.index() == 1 ) with expansion: 1 == 1 -PartTracker.tests.cpp:<line number>: -PASSED: +PartTracker.tests.cpp:<line number>: PASSED: REQUIRE( s2b.isOpen() ) with expansion: true -PartTracker.tests.cpp:<line number>: -PASSED: +PartTracker.tests.cpp:<line number>: PASSED: REQUIRE( s2b.isComplete() ) with expansion: true -PartTracker.tests.cpp:<line number>: -PASSED: +PartTracker.tests.cpp:<line number>: PASSED: REQUIRE( g1b.isComplete() ) with expansion: true -PartTracker.tests.cpp:<line number>: -PASSED: +PartTracker.tests.cpp:<line number>: PASSED: REQUIRE( s1b.isComplete() ) with expansion: true -PartTracker.tests.cpp:<line number>: -PASSED: +PartTracker.tests.cpp:<line number>: PASSED: REQUIRE( testCase2.isComplete() ) with expansion: true @@ -8126,14 +8173,12 @@ Tracker PartTracker.tests.cpp:<line number> ............................................................................... -PartTracker.tests.cpp:<line number>: -PASSED: +PartTracker.tests.cpp:<line number>: PASSED: REQUIRE( testCase.isOpen() ) with expansion: true -PartTracker.tests.cpp:<line number>: -PASSED: +PartTracker.tests.cpp:<line number>: PASSED: REQUIRE( s1.isOpen() ) with expansion: true @@ -8145,26 +8190,22 @@ Tracker PartTracker.tests.cpp:<line number> ............................................................................... -PartTracker.tests.cpp:<line number>: -PASSED: +PartTracker.tests.cpp:<line number>: PASSED: REQUIRE( g1.isOpen() ) with expansion: true -PartTracker.tests.cpp:<line number>: -PASSED: +PartTracker.tests.cpp:<line number>: PASSED: REQUIRE( g1.index() == 0 ) with expansion: 0 == 0 -PartTracker.tests.cpp:<line number>: -PASSED: +PartTracker.tests.cpp:<line number>: PASSED: REQUIRE( g1.isComplete() == false ) with expansion: false == false -PartTracker.tests.cpp:<line number>: -PASSED: +PartTracker.tests.cpp:<line number>: PASSED: REQUIRE( s1.isComplete() == false ) with expansion: false == false @@ -8177,32 +8218,27 @@ Tracker PartTracker.tests.cpp:<line number> ............................................................................... -PartTracker.tests.cpp:<line number>: -PASSED: +PartTracker.tests.cpp:<line number>: PASSED: REQUIRE( s2.isOpen() ) with expansion: true -PartTracker.tests.cpp:<line number>: -PASSED: +PartTracker.tests.cpp:<line number>: PASSED: REQUIRE( s2.isComplete() ) with expansion: true -PartTracker.tests.cpp:<line number>: -PASSED: +PartTracker.tests.cpp:<line number>: PASSED: REQUIRE( s2.isSuccessfullyCompleted() == false ) with expansion: false == false -PartTracker.tests.cpp:<line number>: -PASSED: +PartTracker.tests.cpp:<line number>: PASSED: REQUIRE( s1.isComplete() == false ) with expansion: false == false -PartTracker.tests.cpp:<line number>: -PASSED: +PartTracker.tests.cpp:<line number>: PASSED: REQUIRE( testCase.isComplete() == false ) with expansion: false == false @@ -8216,104 +8252,87 @@ Tracker PartTracker.tests.cpp:<line number> ............................................................................... -PartTracker.tests.cpp:<line number>: -PASSED: +PartTracker.tests.cpp:<line number>: PASSED: REQUIRE( testCase2.isOpen() ) with expansion: true -PartTracker.tests.cpp:<line number>: -PASSED: +PartTracker.tests.cpp:<line number>: PASSED: REQUIRE( s1b.isOpen() ) with expansion: true -PartTracker.tests.cpp:<line number>: -PASSED: +PartTracker.tests.cpp:<line number>: PASSED: REQUIRE( g1b.isOpen() ) with expansion: true -PartTracker.tests.cpp:<line number>: -PASSED: +PartTracker.tests.cpp:<line number>: PASSED: REQUIRE( g1b.index() == 0 ) with expansion: 0 == 0 -PartTracker.tests.cpp:<line number>: -PASSED: +PartTracker.tests.cpp:<line number>: PASSED: REQUIRE( s2b.isOpen() == false ) with expansion: false == false -PartTracker.tests.cpp:<line number>: -PASSED: +PartTracker.tests.cpp:<line number>: PASSED: REQUIRE( g1b.isComplete() == false ) with expansion: false == false -PartTracker.tests.cpp:<line number>: -PASSED: +PartTracker.tests.cpp:<line number>: PASSED: REQUIRE( s1b.isComplete() == false ) with expansion: false == false -PartTracker.tests.cpp:<line number>: -PASSED: +PartTracker.tests.cpp:<line number>: PASSED: REQUIRE( testCase2.isComplete() == false ) with expansion: false == false -PartTracker.tests.cpp:<line number>: -PASSED: +PartTracker.tests.cpp:<line number>: PASSED: REQUIRE( testCase3.isOpen() ) with expansion: true -PartTracker.tests.cpp:<line number>: -PASSED: +PartTracker.tests.cpp:<line number>: PASSED: REQUIRE( s1c.isOpen() ) with expansion: true -PartTracker.tests.cpp:<line number>: -PASSED: +PartTracker.tests.cpp:<line number>: PASSED: REQUIRE( g1c.isOpen() ) with expansion: true -PartTracker.tests.cpp:<line number>: -PASSED: +PartTracker.tests.cpp:<line number>: PASSED: REQUIRE( g1c.index() == 1 ) with expansion: 1 == 1 -PartTracker.tests.cpp:<line number>: -PASSED: +PartTracker.tests.cpp:<line number>: PASSED: REQUIRE( s2c.isOpen() ) with expansion: true -PartTracker.tests.cpp:<line number>: -PASSED: +PartTracker.tests.cpp:<line number>: PASSED: REQUIRE( s2c.isComplete() ) with expansion: true -PartTracker.tests.cpp:<line number>: -PASSED: +PartTracker.tests.cpp:<line number>: PASSED: REQUIRE( g1c.isComplete() ) with expansion: true -PartTracker.tests.cpp:<line number>: -PASSED: +PartTracker.tests.cpp:<line number>: PASSED: REQUIRE( s1c.isComplete() ) with expansion: true -PartTracker.tests.cpp:<line number>: -PASSED: +PartTracker.tests.cpp:<line number>: PASSED: REQUIRE( testCase3.isComplete() ) with expansion: true @@ -8334,50 +8353,42 @@ Use a custom approx Approx.tests.cpp:<line number> ............................................................................... -Approx.tests.cpp:<line number>: -PASSED: +Approx.tests.cpp:<line number>: PASSED: REQUIRE( d == approx( 1.23 ) ) with expansion: 1.23 == Approx( 1.23 ) -Approx.tests.cpp:<line number>: -PASSED: +Approx.tests.cpp:<line number>: PASSED: REQUIRE( d == approx( 1.22 ) ) with expansion: 1.23 == Approx( 1.22 ) -Approx.tests.cpp:<line number>: -PASSED: +Approx.tests.cpp:<line number>: PASSED: REQUIRE( d == approx( 1.24 ) ) with expansion: 1.23 == Approx( 1.24 ) -Approx.tests.cpp:<line number>: -PASSED: +Approx.tests.cpp:<line number>: PASSED: REQUIRE( d != approx( 1.25 ) ) with expansion: 1.23 != Approx( 1.25 ) -Approx.tests.cpp:<line number>: -PASSED: +Approx.tests.cpp:<line number>: PASSED: REQUIRE( approx( d ) == 1.23 ) with expansion: Approx( 1.23 ) == 1.23 -Approx.tests.cpp:<line number>: -PASSED: +Approx.tests.cpp:<line number>: PASSED: REQUIRE( approx( d ) == 1.22 ) with expansion: Approx( 1.23 ) == 1.22 -Approx.tests.cpp:<line number>: -PASSED: +Approx.tests.cpp:<line number>: PASSED: REQUIRE( approx( d ) == 1.24 ) with expansion: Approx( 1.23 ) == 1.24 -Approx.tests.cpp:<line number>: -PASSED: +Approx.tests.cpp:<line number>: PASSED: REQUIRE( approx( d ) != 1.25 ) with expansion: Approx( 1.23 ) != 1.25 @@ -8389,8 +8400,7 @@ Variadic macros VariadicMacros.tests.cpp:<line number> ............................................................................... -VariadicMacros.tests.cpp:<line number>: -PASSED: +VariadicMacros.tests.cpp:<line number>: PASSED: with message: no assertions @@ -8401,14 +8411,12 @@ Vector matchers Matchers.tests.cpp:<line number> ............................................................................... -Matchers.tests.cpp:<line number>: -PASSED: +Matchers.tests.cpp:<line number>: PASSED: CHECK_THAT( v, VectorContains(1) ) with expansion: { 1, 2, 3 } Contains: 1 -Matchers.tests.cpp:<line number>: -PASSED: +Matchers.tests.cpp:<line number>: PASSED: CHECK_THAT( v, VectorContains(2) ) with expansion: { 1, 2, 3 } Contains: 2 @@ -8420,26 +8428,22 @@ Vector matchers Matchers.tests.cpp:<line number> ............................................................................... -Matchers.tests.cpp:<line number>: -PASSED: +Matchers.tests.cpp:<line number>: PASSED: CHECK_THAT( v, Contains(v2) ) with expansion: { 1, 2, 3 } Contains: { 1, 2 } -Matchers.tests.cpp:<line number>: -PASSED: +Matchers.tests.cpp:<line number>: PASSED: CHECK_THAT( v, Contains(v2) ) with expansion: { 1, 2, 3 } Contains: { 1, 2, 3 } -Matchers.tests.cpp:<line number>: -PASSED: +Matchers.tests.cpp:<line number>: PASSED: CHECK_THAT( v, Contains(empty) ) with expansion: { 1, 2, 3 } Contains: { } -Matchers.tests.cpp:<line number>: -PASSED: +Matchers.tests.cpp:<line number>: PASSED: CHECK_THAT( empty, Contains(empty) ) with expansion: { } Contains: { } @@ -8451,8 +8455,7 @@ Vector matchers Matchers.tests.cpp:<line number> ............................................................................... -Matchers.tests.cpp:<line number>: -PASSED: +Matchers.tests.cpp:<line number>: PASSED: CHECK_THAT( v, VectorContains(1) && VectorContains(2) ) with expansion: { 1, 2, 3 } ( Contains: 1 and Contains: 2 ) @@ -8464,20 +8467,17 @@ Vector matchers Matchers.tests.cpp:<line number> ............................................................................... -Matchers.tests.cpp:<line number>: -PASSED: +Matchers.tests.cpp:<line number>: PASSED: CHECK_THAT( v, Equals(v) ) with expansion: { 1, 2, 3 } Equals: { 1, 2, 3 } -Matchers.tests.cpp:<line number>: -PASSED: +Matchers.tests.cpp:<line number>: PASSED: CHECK_THAT( empty, Equals(empty) ) with expansion: { } Equals: { } -Matchers.tests.cpp:<line number>: -PASSED: +Matchers.tests.cpp:<line number>: PASSED: CHECK_THAT( v, Equals(v2) ) with expansion: { 1, 2, 3 } Equals: { 1, 2, 3 } @@ -8489,26 +8489,22 @@ Vector matchers Matchers.tests.cpp:<line number> ............................................................................... -Matchers.tests.cpp:<line number>: -PASSED: +Matchers.tests.cpp:<line number>: PASSED: CHECK_THAT( v, UnorderedEquals(v) ) with expansion: { 1, 2, 3 } UnorderedEquals: { 1, 2, 3 } -Matchers.tests.cpp:<line number>: -PASSED: +Matchers.tests.cpp:<line number>: PASSED: CHECK_THAT( empty, UnorderedEquals(empty) ) with expansion: { } UnorderedEquals: { } -Matchers.tests.cpp:<line number>: -PASSED: +Matchers.tests.cpp:<line number>: PASSED: REQUIRE_THAT( permuted, UnorderedEquals(v) ) with expansion: { 1, 3, 2 } UnorderedEquals: { 1, 2, 3 } -Matchers.tests.cpp:<line number>: -PASSED: +Matchers.tests.cpp:<line number>: PASSED: REQUIRE_THAT( permuted, UnorderedEquals(v) ) with expansion: { 2, 3, 1 } UnorderedEquals: { 1, 2, 3 } @@ -8607,16 +8603,13 @@ When checked exceptions are thrown they can be expected or unexpected Exception.tests.cpp:<line number> ............................................................................... -Exception.tests.cpp:<line number>: -PASSED: +Exception.tests.cpp:<line number>: PASSED: REQUIRE_THROWS_AS( thisThrows(), std::domain_error ) -Exception.tests.cpp:<line number>: -PASSED: +Exception.tests.cpp:<line number>: PASSED: REQUIRE_NOTHROW( thisDoesntThrow() ) -Exception.tests.cpp:<line number>: -PASSED: +Exception.tests.cpp:<line number>: PASSED: REQUIRE_THROWS( thisThrows() ) ------------------------------------------------------------------------------- @@ -8689,8 +8682,7 @@ Where the LHS is not a simple value Tricky.tests.cpp:<line number> ............................................................................... -Tricky.tests.cpp:<line number>: -warning: +Tricky.tests.cpp:<line number>: warning: Uncomment the code in this test to check that it gives a sensible compiler error @@ -8703,8 +8695,7 @@ Where there is more to the expression after the RHS Tricky.tests.cpp:<line number> ............................................................................... -Tricky.tests.cpp:<line number>: -warning: +Tricky.tests.cpp:<line number>: warning: Uncomment the code in this test to check that it gives a sensible compiler error @@ -8717,8 +8708,7 @@ X/level/0/a Tricky.tests.cpp:<line number> ............................................................................... -Tricky.tests.cpp:<line number>: -PASSED: +Tricky.tests.cpp:<line number>: PASSED: ------------------------------------------------------------------------------- X/level/0/b @@ -8726,8 +8716,7 @@ X/level/0/b Tricky.tests.cpp:<line number> ............................................................................... -Tricky.tests.cpp:<line number>: -PASSED: +Tricky.tests.cpp:<line number>: PASSED: ------------------------------------------------------------------------------- X/level/1/a @@ -8735,8 +8724,7 @@ X/level/1/a Tricky.tests.cpp:<line number> ............................................................................... -Tricky.tests.cpp:<line number>: -PASSED: +Tricky.tests.cpp:<line number>: PASSED: ------------------------------------------------------------------------------- X/level/1/b @@ -8744,8 +8732,7 @@ X/level/1/b Tricky.tests.cpp:<line number> ............................................................................... -Tricky.tests.cpp:<line number>: -PASSED: +Tricky.tests.cpp:<line number>: PASSED: ------------------------------------------------------------------------------- XmlEncode @@ -8754,8 +8741,7 @@ XmlEncode Xml.tests.cpp:<line number> ............................................................................... -Xml.tests.cpp:<line number>: -PASSED: +Xml.tests.cpp:<line number>: PASSED: REQUIRE( encode( "normal string" ) == "normal string" ) with expansion: "normal string" == "normal string" @@ -8767,8 +8753,7 @@ XmlEncode Xml.tests.cpp:<line number> ............................................................................... -Xml.tests.cpp:<line number>: -PASSED: +Xml.tests.cpp:<line number>: PASSED: REQUIRE( encode( "" ) == "" ) with expansion: "" == "" @@ -8780,8 +8765,7 @@ XmlEncode Xml.tests.cpp:<line number> ............................................................................... -Xml.tests.cpp:<line number>: -PASSED: +Xml.tests.cpp:<line number>: PASSED: REQUIRE( encode( "smith & jones" ) == "smith & jones" ) with expansion: "smith & jones" == "smith & jones" @@ -8793,8 +8777,7 @@ XmlEncode Xml.tests.cpp:<line number> ............................................................................... -Xml.tests.cpp:<line number>: -PASSED: +Xml.tests.cpp:<line number>: PASSED: REQUIRE( encode( "smith < jones" ) == "smith < jones" ) with expansion: "smith < jones" == "smith < jones" @@ -8806,14 +8789,12 @@ XmlEncode Xml.tests.cpp:<line number> ............................................................................... -Xml.tests.cpp:<line number>: -PASSED: +Xml.tests.cpp:<line number>: PASSED: REQUIRE( encode( "smith > jones" ) == "smith > jones" ) with expansion: "smith > jones" == "smith > jones" -Xml.tests.cpp:<line number>: -PASSED: +Xml.tests.cpp:<line number>: PASSED: REQUIRE( encode( "smith ]]> jones" ) == "smith ]]> jones" ) with expansion: "smith ]]> jones" @@ -8827,16 +8808,14 @@ XmlEncode Xml.tests.cpp:<line number> ............................................................................... -Xml.tests.cpp:<line number>: -PASSED: +Xml.tests.cpp:<line number>: PASSED: REQUIRE( encode( stringWithQuotes ) == stringWithQuotes ) with expansion: "don't "quote" me on that" == "don't "quote" me on that" -Xml.tests.cpp:<line number>: -PASSED: +Xml.tests.cpp:<line number>: PASSED: REQUIRE( encode( stringWithQuotes, Catch::XmlEncode::ForAttributes ) == "don't "quote" me on that" ) with expansion: "don't "quote" me on that" @@ -8850,8 +8829,7 @@ XmlEncode Xml.tests.cpp:<line number> ............................................................................... -Xml.tests.cpp:<line number>: -PASSED: +Xml.tests.cpp:<line number>: PASSED: REQUIRE( encode( "[\x01]" ) == "[\\x01]" ) with expansion: "[\x01]" == "[\x01]" @@ -8863,8 +8841,7 @@ XmlEncode Xml.tests.cpp:<line number> ............................................................................... -Xml.tests.cpp:<line number>: -PASSED: +Xml.tests.cpp:<line number>: PASSED: REQUIRE( encode( "[\x7F]" ) == "[\\x7F]" ) with expansion: "[\x7F]" == "[\x7F]" @@ -8876,56 +8853,47 @@ XmlEncode: UTF-8 Xml.tests.cpp:<line number> ............................................................................... -Xml.tests.cpp:<line number>: -PASSED: +Xml.tests.cpp:<line number>: PASSED: CHECK( encode(u8"Here be 👾") == u8"Here be 👾" ) with expansion: "Here be 👾" == "Here be 👾" -Xml.tests.cpp:<line number>: -PASSED: +Xml.tests.cpp:<line number>: PASSED: CHECK( encode(u8"šš") == u8"šš" ) with expansion: "šš" == "šš" -Xml.tests.cpp:<line number>: -PASSED: +Xml.tests.cpp:<line number>: PASSED: CHECK( encode("\xDF\xBF") == "\xDF\xBF" ) with expansion: "߿" == "߿" -Xml.tests.cpp:<line number>: -PASSED: +Xml.tests.cpp:<line number>: PASSED: CHECK( encode("\xE0\xA0\x80") == "\xE0\xA0\x80" ) with expansion: "ࠀ" == "ࠀ" -Xml.tests.cpp:<line number>: -PASSED: +Xml.tests.cpp:<line number>: PASSED: CHECK( encode("\xED\x9F\xBF") == "\xED\x9F\xBF" ) with expansion: "" == "" -Xml.tests.cpp:<line number>: -PASSED: +Xml.tests.cpp:<line number>: PASSED: CHECK( encode("\xEE\x80\x80") == "\xEE\x80\x80" ) with expansion: "" == "" -Xml.tests.cpp:<line number>: -PASSED: +Xml.tests.cpp:<line number>: PASSED: CHECK( encode("\xEF\xBF\xBF") == "\xEF\xBF\xBF" ) with expansion: "" == "" -Xml.tests.cpp:<line number>: -PASSED: +Xml.tests.cpp:<line number>: PASSED: CHECK( encode("\xF0\x90\x80\x80") == "\xF0\x90\x80\x80" ) with expansion: "𐀀" == "𐀀" -Xml.tests.cpp:<line number>: -PASSED: +Xml.tests.cpp:<line number>: PASSED: CHECK( encode("\xF4\x8F\xBF\xBF") == "\xF4\x8F\xBF\xBF" ) with expansion: "" == "" @@ -8938,26 +8906,22 @@ XmlEncode: UTF-8 Xml.tests.cpp:<line number> ............................................................................... -Xml.tests.cpp:<line number>: -PASSED: +Xml.tests.cpp:<line number>: PASSED: CHECK( encode("Here \xFF be 👾") == u8"Here \\xFF be 👾" ) with expansion: "Here \xFF be 👾" == "Here \xFF be 👾" -Xml.tests.cpp:<line number>: -PASSED: +Xml.tests.cpp:<line number>: PASSED: CHECK( encode("\xFF") == "\\xFF" ) with expansion: "\xFF" == "\xFF" -Xml.tests.cpp:<line number>: -PASSED: +Xml.tests.cpp:<line number>: PASSED: CHECK( encode("\xC5\xC5\xA0") == u8"\\xC5Š" ) with expansion: "\xC5Š" == "\xC5Š" -Xml.tests.cpp:<line number>: -PASSED: +Xml.tests.cpp:<line number>: PASSED: CHECK( encode("\xF4\x90\x80\x80") == u8"\\xF4\\x90\\x80\\x80" ) with expansion: "\xF4\x90\x80\x80" == "\xF4\x90\x80\x80" @@ -8970,32 +8934,27 @@ XmlEncode: UTF-8 Xml.tests.cpp:<line number> ............................................................................... -Xml.tests.cpp:<line number>: -PASSED: +Xml.tests.cpp:<line number>: PASSED: CHECK( encode("\xC0\x80") == u8"\\xC0\\x80" ) with expansion: "\xC0\x80" == "\xC0\x80" -Xml.tests.cpp:<line number>: -PASSED: +Xml.tests.cpp:<line number>: PASSED: CHECK( encode("\xF0\x80\x80\x80") == u8"\\xF0\\x80\\x80\\x80" ) with expansion: "\xF0\x80\x80\x80" == "\xF0\x80\x80\x80" -Xml.tests.cpp:<line number>: -PASSED: +Xml.tests.cpp:<line number>: PASSED: CHECK( encode("\xC1\xBF") == u8"\\xC1\\xBF" ) with expansion: "\xC1\xBF" == "\xC1\xBF" -Xml.tests.cpp:<line number>: -PASSED: +Xml.tests.cpp:<line number>: PASSED: CHECK( encode("\xE0\x9F\xBF") == u8"\\xE0\\x9F\\xBF" ) with expansion: "\xE0\x9F\xBF" == "\xE0\x9F\xBF" -Xml.tests.cpp:<line number>: -PASSED: +Xml.tests.cpp:<line number>: PASSED: CHECK( encode("\xF0\x8F\xBF\xBF") == u8"\\xF0\\x8F\\xBF\\xBF" ) with expansion: "\xF0\x8F\xBF\xBF" == "\xF0\x8F\xBF\xBF" @@ -9008,26 +8967,22 @@ XmlEncode: UTF-8 Xml.tests.cpp:<line number> ............................................................................... -Xml.tests.cpp:<line number>: -PASSED: +Xml.tests.cpp:<line number>: PASSED: CHECK( encode("\xED\xA0\x80") == "\xED\xA0\x80" ) with expansion: "���" == "���" -Xml.tests.cpp:<line number>: -PASSED: +Xml.tests.cpp:<line number>: PASSED: CHECK( encode("\xED\xAF\xBF") == "\xED\xAF\xBF" ) with expansion: "���" == "���" -Xml.tests.cpp:<line number>: -PASSED: +Xml.tests.cpp:<line number>: PASSED: CHECK( encode("\xED\xB0\x80") == "\xED\xB0\x80" ) with expansion: "���" == "���" -Xml.tests.cpp:<line number>: -PASSED: +Xml.tests.cpp:<line number>: PASSED: CHECK( encode("\xED\xBF\xBF") == "\xED\xBF\xBF" ) with expansion: "���" == "���" @@ -9040,44 +8995,37 @@ XmlEncode: UTF-8 Xml.tests.cpp:<line number> ............................................................................... -Xml.tests.cpp:<line number>: -PASSED: +Xml.tests.cpp:<line number>: PASSED: CHECK( encode("\x80") == u8"\\x80" ) with expansion: "\x80" == "\x80" -Xml.tests.cpp:<line number>: -PASSED: +Xml.tests.cpp:<line number>: PASSED: CHECK( encode("\x81") == u8"\\x81" ) with expansion: "\x81" == "\x81" -Xml.tests.cpp:<line number>: -PASSED: +Xml.tests.cpp:<line number>: PASSED: CHECK( encode("\xBC") == u8"\\xBC" ) with expansion: "\xBC" == "\xBC" -Xml.tests.cpp:<line number>: -PASSED: +Xml.tests.cpp:<line number>: PASSED: CHECK( encode("\xBF") == u8"\\xBF" ) with expansion: "\xBF" == "\xBF" -Xml.tests.cpp:<line number>: -PASSED: +Xml.tests.cpp:<line number>: PASSED: CHECK( encode("\xF5\x80\x80\x80") == u8"\\xF5\\x80\\x80\\x80" ) with expansion: "\xF5\x80\x80\x80" == "\xF5\x80\x80\x80" -Xml.tests.cpp:<line number>: -PASSED: +Xml.tests.cpp:<line number>: PASSED: CHECK( encode("\xF6\x80\x80\x80") == u8"\\xF6\\x80\\x80\\x80" ) with expansion: "\xF6\x80\x80\x80" == "\xF6\x80\x80\x80" -Xml.tests.cpp:<line number>: -PASSED: +Xml.tests.cpp:<line number>: PASSED: CHECK( encode("\xF7\x80\x80\x80") == u8"\\xF7\\x80\\x80\\x80" ) with expansion: "\xF7\x80\x80\x80" == "\xF7\x80\x80\x80" @@ -9090,80 +9038,67 @@ XmlEncode: UTF-8 Xml.tests.cpp:<line number> ............................................................................... -Xml.tests.cpp:<line number>: -PASSED: +Xml.tests.cpp:<line number>: PASSED: CHECK( encode("\xDE") == u8"\\xDE" ) with expansion: "\xDE" == "\xDE" -Xml.tests.cpp:<line number>: -PASSED: +Xml.tests.cpp:<line number>: PASSED: CHECK( encode("\xDF") == u8"\\xDF" ) with expansion: "\xDF" == "\xDF" -Xml.tests.cpp:<line number>: -PASSED: +Xml.tests.cpp:<line number>: PASSED: CHECK( encode("\xE0") == u8"\\xE0" ) with expansion: "\xE0" == "\xE0" -Xml.tests.cpp:<line number>: -PASSED: +Xml.tests.cpp:<line number>: PASSED: CHECK( encode("\xEF") == u8"\\xEF" ) with expansion: "\xEF" == "\xEF" -Xml.tests.cpp:<line number>: -PASSED: +Xml.tests.cpp:<line number>: PASSED: CHECK( encode("\xF0") == u8"\\xF0" ) with expansion: "\xF0" == "\xF0" -Xml.tests.cpp:<line number>: -PASSED: +Xml.tests.cpp:<line number>: PASSED: CHECK( encode("\xF4") == u8"\\xF4" ) with expansion: "\xF4" == "\xF4" -Xml.tests.cpp:<line number>: -PASSED: +Xml.tests.cpp:<line number>: PASSED: CHECK( encode("\xE0\x80") == u8"\\xE0\\x80" ) with expansion: "\xE0\x80" == "\xE0\x80" -Xml.tests.cpp:<line number>: -PASSED: +Xml.tests.cpp:<line number>: PASSED: CHECK( encode("\xE0\xBF") == u8"\\xE0\\xBF" ) with expansion: "\xE0\xBF" == "\xE0\xBF" -Xml.tests.cpp:<line number>: -PASSED: +Xml.tests.cpp:<line number>: PASSED: CHECK( encode("\xE1\x80") == u8"\\xE1\\x80" ) with expansion: "\xE1\x80" == "\xE1\x80" -Xml.tests.cpp:<line number>: -PASSED: +Xml.tests.cpp:<line number>: PASSED: CHECK( encode("\xF0\x80") == u8"\\xF0\\x80" ) with expansion: "\xF0\x80" == "\xF0\x80" -Xml.tests.cpp:<line number>: -PASSED: +Xml.tests.cpp:<line number>: PASSED: CHECK( encode("\xF4\x80") == u8"\\xF4\\x80" ) with expansion: "\xF4\x80" == "\xF4\x80" -Xml.tests.cpp:<line number>: -PASSED: +Xml.tests.cpp:<line number>: PASSED: CHECK( encode("\xF0\x80\x80") == u8"\\xF0\\x80\\x80" ) with expansion: "\xF0\x80\x80" == "\xF0\x80\x80" -Xml.tests.cpp:<line number>: -PASSED: +Xml.tests.cpp:<line number>: PASSED: CHECK( encode("\xF4\x80\x80") == u8"\\xF4\\x80\\x80" ) with expansion: "\xF4\x80\x80" == "\xF4\x80\x80" @@ -9174,20 +9109,17 @@ array<int, N> -> toString ToStringVector.tests.cpp:<line number> ............................................................................... -ToStringVector.tests.cpp:<line number>: -PASSED: +ToStringVector.tests.cpp:<line number>: PASSED: REQUIRE( Catch::Detail::stringify( empty ) == "{ }" ) with expansion: "{ }" == "{ }" -ToStringVector.tests.cpp:<line number>: -PASSED: +ToStringVector.tests.cpp:<line number>: PASSED: REQUIRE( Catch::Detail::stringify( oneValue ) == "{ 42 }" ) with expansion: "{ 42 }" == "{ 42 }" -ToStringVector.tests.cpp:<line number>: -PASSED: +ToStringVector.tests.cpp:<line number>: PASSED: REQUIRE( Catch::Detail::stringify( twoValues ) == "{ 42, 250 }" ) with expansion: "{ 42, 250 }" == "{ 42, 250 }" @@ -9198,8 +9130,7 @@ atomic if Misc.tests.cpp:<line number> ............................................................................... -Misc.tests.cpp:<line number>: -PASSED: +Misc.tests.cpp:<line number>: PASSED: REQUIRE( x == 0 ) with expansion: 0 == 0 @@ -9210,8 +9141,7 @@ boolean member Tricky.tests.cpp:<line number> ............................................................................... -Tricky.tests.cpp:<line number>: -PASSED: +Tricky.tests.cpp:<line number>: PASSED: REQUIRE( obj.prop != 0 ) with expansion: 0x<hex digits> != 0 @@ -9222,14 +9152,12 @@ checkedElse Misc.tests.cpp:<line number> ............................................................................... -Misc.tests.cpp:<line number>: -PASSED: +Misc.tests.cpp:<line number>: PASSED: CHECKED_ELSE( flag ) with expansion: true -Misc.tests.cpp:<line number>: -PASSED: +Misc.tests.cpp:<line number>: PASSED: REQUIRE( testCheckedElse( true ) ) with expansion: true @@ -9256,14 +9184,12 @@ checkedIf Misc.tests.cpp:<line number> ............................................................................... -Misc.tests.cpp:<line number>: -PASSED: +Misc.tests.cpp:<line number>: PASSED: CHECKED_IF( flag ) with expansion: true -Misc.tests.cpp:<line number>: -PASSED: +Misc.tests.cpp:<line number>: PASSED: REQUIRE( testCheckedIf( true ) ) with expansion: true @@ -9290,26 +9216,22 @@ comparisons between const int variables Condition.tests.cpp:<line number> ............................................................................... -Condition.tests.cpp:<line number>: -PASSED: +Condition.tests.cpp:<line number>: PASSED: REQUIRE( unsigned_char_var == 1 ) with expansion: 1 == 1 -Condition.tests.cpp:<line number>: -PASSED: +Condition.tests.cpp:<line number>: PASSED: REQUIRE( unsigned_short_var == 1 ) with expansion: 1 == 1 -Condition.tests.cpp:<line number>: -PASSED: +Condition.tests.cpp:<line number>: PASSED: REQUIRE( unsigned_int_var == 1 ) with expansion: 1 == 1 -Condition.tests.cpp:<line number>: -PASSED: +Condition.tests.cpp:<line number>: PASSED: REQUIRE( unsigned_long_var == 1 ) with expansion: 1 == 1 @@ -9320,26 +9242,22 @@ comparisons between int variables Condition.tests.cpp:<line number> ............................................................................... -Condition.tests.cpp:<line number>: -PASSED: +Condition.tests.cpp:<line number>: PASSED: REQUIRE( long_var == unsigned_char_var ) with expansion: 1 == 1 -Condition.tests.cpp:<line number>: -PASSED: +Condition.tests.cpp:<line number>: PASSED: REQUIRE( long_var == unsigned_short_var ) with expansion: 1 == 1 -Condition.tests.cpp:<line number>: -PASSED: +Condition.tests.cpp:<line number>: PASSED: REQUIRE( long_var == unsigned_int_var ) with expansion: 1 == 1 -Condition.tests.cpp:<line number>: -PASSED: +Condition.tests.cpp:<line number>: PASSED: REQUIRE( long_var == unsigned_long_var ) with expansion: 1 == 1 @@ -9352,8 +9270,7 @@ even more nested SECTION tests Misc.tests.cpp:<line number> ............................................................................... -Misc.tests.cpp:<line number>: -PASSED: +Misc.tests.cpp:<line number>: PASSED: ------------------------------------------------------------------------------- even more nested SECTION tests @@ -9363,8 +9280,7 @@ even more nested SECTION tests Misc.tests.cpp:<line number> ............................................................................... -Misc.tests.cpp:<line number>: -PASSED: +Misc.tests.cpp:<line number>: PASSED: ------------------------------------------------------------------------------- even more nested SECTION tests @@ -9373,8 +9289,7 @@ even more nested SECTION tests Misc.tests.cpp:<line number> ............................................................................... -Misc.tests.cpp:<line number>: -PASSED: +Misc.tests.cpp:<line number>: PASSED: ------------------------------------------------------------------------------- first tag @@ -9420,8 +9335,7 @@ long long Misc.tests.cpp:<line number> ............................................................................... -Misc.tests.cpp:<line number>: -PASSED: +Misc.tests.cpp:<line number>: PASSED: REQUIRE( l == std::numeric_limits<long long>::max() ) with expansion: 9223372036854775807 (0x<hex digits>) @@ -9459,8 +9373,7 @@ looped SECTION tests Misc.tests.cpp:<line number> ............................................................................... -Misc.tests.cpp:<line number>: -PASSED: +Misc.tests.cpp:<line number>: PASSED: CHECK( b > a ) with expansion: 2 > 1 @@ -9472,8 +9385,7 @@ looped SECTION tests Misc.tests.cpp:<line number> ............................................................................... -Misc.tests.cpp:<line number>: -PASSED: +Misc.tests.cpp:<line number>: PASSED: CHECK( b > a ) with expansion: 3 > 1 @@ -9485,8 +9397,7 @@ looped SECTION tests Misc.tests.cpp:<line number> ............................................................................... -Misc.tests.cpp:<line number>: -PASSED: +Misc.tests.cpp:<line number>: PASSED: CHECK( b > a ) with expansion: 4 > 1 @@ -9498,8 +9409,7 @@ looped SECTION tests Misc.tests.cpp:<line number> ............................................................................... -Misc.tests.cpp:<line number>: -PASSED: +Misc.tests.cpp:<line number>: PASSED: CHECK( b > a ) with expansion: 5 > 1 @@ -9511,8 +9421,7 @@ looped SECTION tests Misc.tests.cpp:<line number> ............................................................................... -Misc.tests.cpp:<line number>: -PASSED: +Misc.tests.cpp:<line number>: PASSED: CHECK( b > a ) with expansion: 6 > 1 @@ -9524,8 +9433,7 @@ looped SECTION tests Misc.tests.cpp:<line number> ............................................................................... -Misc.tests.cpp:<line number>: -PASSED: +Misc.tests.cpp:<line number>: PASSED: CHECK( b > a ) with expansion: 7 > 1 @@ -9537,8 +9445,7 @@ looped SECTION tests Misc.tests.cpp:<line number> ............................................................................... -Misc.tests.cpp:<line number>: -PASSED: +Misc.tests.cpp:<line number>: PASSED: CHECK( b > a ) with expansion: 8 > 1 @@ -9550,8 +9457,7 @@ looped SECTION tests Misc.tests.cpp:<line number> ............................................................................... -Misc.tests.cpp:<line number>: -PASSED: +Misc.tests.cpp:<line number>: PASSED: CHECK( b > a ) with expansion: 9 > 1 @@ -9576,8 +9482,7 @@ with expansion: with message: Testing if fib[1] (1) is even -Misc.tests.cpp:<line number>: -PASSED: +Misc.tests.cpp:<line number>: PASSED: CHECK( ( fib[i] % 2 ) == 0 ) with expansion: 0 == 0 @@ -9598,8 +9503,7 @@ with expansion: with message: Testing if fib[4] (5) is even -Misc.tests.cpp:<line number>: -PASSED: +Misc.tests.cpp:<line number>: PASSED: CHECK( ( fib[i] % 2 ) == 0 ) with expansion: 0 == 0 @@ -9641,8 +9545,7 @@ more nested SECTION tests Misc.tests.cpp:<line number> ............................................................................... -Misc.tests.cpp:<line number>: -PASSED: +Misc.tests.cpp:<line number>: PASSED: REQUIRE( a != b ) with expansion: 1 != 2 @@ -9655,8 +9558,7 @@ more nested SECTION tests Misc.tests.cpp:<line number> ............................................................................... -Misc.tests.cpp:<line number>: -PASSED: +Misc.tests.cpp:<line number>: PASSED: REQUIRE( a < b ) with expansion: 1 < 2 @@ -9668,14 +9570,12 @@ nested SECTION tests Misc.tests.cpp:<line number> ............................................................................... -Misc.tests.cpp:<line number>: -PASSED: +Misc.tests.cpp:<line number>: PASSED: REQUIRE( a != b ) with expansion: 1 != 2 -Misc.tests.cpp:<line number>: -PASSED: +Misc.tests.cpp:<line number>: PASSED: REQUIRE( b != a ) with expansion: 2 != 1 @@ -9688,8 +9588,7 @@ nested SECTION tests Misc.tests.cpp:<line number> ............................................................................... -Misc.tests.cpp:<line number>: -PASSED: +Misc.tests.cpp:<line number>: PASSED: REQUIRE( a != b ) with expansion: 1 != 2 @@ -9700,8 +9599,7 @@ non streamable - with conv. op Tricky.tests.cpp:<line number> ............................................................................... -Tricky.tests.cpp:<line number>: -PASSED: +Tricky.tests.cpp:<line number>: PASSED: REQUIRE( s == "7" ) with expansion: "7" == "7" @@ -9712,8 +9610,7 @@ non-copyable objects Tricky.tests.cpp:<line number> ............................................................................... -Tricky.tests.cpp:<line number>: -PASSED: +Tricky.tests.cpp:<line number>: PASSED: CHECK( ti == typeid(int) ) with expansion: {?} == {?} @@ -9724,8 +9621,7 @@ not allowed Misc.tests.cpp:<line number> ............................................................................... -Misc.tests.cpp:<line number>: -PASSED: +Misc.tests.cpp:<line number>: PASSED: ------------------------------------------------------------------------------- null strings @@ -9733,14 +9629,12 @@ null strings Misc.tests.cpp:<line number> ............................................................................... -Misc.tests.cpp:<line number>: -PASSED: +Misc.tests.cpp:<line number>: PASSED: REQUIRE( makeString( false ) != static_cast<char*>(0) ) with expansion: "valid string" != {null string} -Misc.tests.cpp:<line number>: -PASSED: +Misc.tests.cpp:<line number>: PASSED: REQUIRE( makeString( true ) == static_cast<char*>(0) ) with expansion: {null string} == {null string} @@ -9751,8 +9645,7 @@ null_ptr Tricky.tests.cpp:<line number> ............................................................................... -Tricky.tests.cpp:<line number>: -PASSED: +Tricky.tests.cpp:<line number>: PASSED: REQUIRE( ptr.get() == 0 ) with expansion: 0 == 0 @@ -9763,8 +9656,7 @@ pair<pair<int,const char *,pair<std::string,int> > -> toString ToStringPair.tests.cpp:<line number> ............................................................................... -ToStringPair.tests.cpp:<line number>: -PASSED: +ToStringPair.tests.cpp:<line number>: PASSED: REQUIRE( ::Catch::Detail::stringify( pair ) == "{ { 42, \"Arthur\" }, { \"Ford\", 24 } }" ) with expansion: "{ { 42, "Arthur" }, { "Ford", 24 } }" @@ -9777,8 +9669,7 @@ pointer to class Tricky.tests.cpp:<line number> ............................................................................... -Tricky.tests.cpp:<line number>: -PASSED: +Tricky.tests.cpp:<line number>: PASSED: REQUIRE( p == 0 ) with expansion: 0 == 0 @@ -9790,14 +9681,12 @@ random SECTION tests Misc.tests.cpp:<line number> ............................................................................... -Misc.tests.cpp:<line number>: -PASSED: +Misc.tests.cpp:<line number>: PASSED: REQUIRE( a != b ) with expansion: 1 != 2 -Misc.tests.cpp:<line number>: -PASSED: +Misc.tests.cpp:<line number>: PASSED: REQUIRE( b != a ) with expansion: 2 != 1 @@ -9809,8 +9698,7 @@ random SECTION tests Misc.tests.cpp:<line number> ............................................................................... -Misc.tests.cpp:<line number>: -PASSED: +Misc.tests.cpp:<line number>: PASSED: REQUIRE( a != b ) with expansion: 1 != 2 @@ -9822,14 +9710,12 @@ replaceInPlace String.tests.cpp:<line number> ............................................................................... -String.tests.cpp:<line number>: -PASSED: +String.tests.cpp:<line number>: PASSED: CHECK( Catch::replaceInPlace( letters, "b", "z" ) ) with expansion: true -String.tests.cpp:<line number>: -PASSED: +String.tests.cpp:<line number>: PASSED: CHECK( letters == "azcdefcg" ) with expansion: "azcdefcg" == "azcdefcg" @@ -9841,14 +9727,12 @@ replaceInPlace String.tests.cpp:<line number> ............................................................................... -String.tests.cpp:<line number>: -PASSED: +String.tests.cpp:<line number>: PASSED: CHECK( Catch::replaceInPlace( letters, "c", "z" ) ) with expansion: true -String.tests.cpp:<line number>: -PASSED: +String.tests.cpp:<line number>: PASSED: CHECK( letters == "abzdefzg" ) with expansion: "abzdefzg" == "abzdefzg" @@ -9860,14 +9744,12 @@ replaceInPlace String.tests.cpp:<line number> ............................................................................... -String.tests.cpp:<line number>: -PASSED: +String.tests.cpp:<line number>: PASSED: CHECK( Catch::replaceInPlace( letters, "a", "z" ) ) with expansion: true -String.tests.cpp:<line number>: -PASSED: +String.tests.cpp:<line number>: PASSED: CHECK( letters == "zbcdefcg" ) with expansion: "zbcdefcg" == "zbcdefcg" @@ -9879,14 +9761,12 @@ replaceInPlace String.tests.cpp:<line number> ............................................................................... -String.tests.cpp:<line number>: -PASSED: +String.tests.cpp:<line number>: PASSED: CHECK( Catch::replaceInPlace( letters, "g", "z" ) ) with expansion: true -String.tests.cpp:<line number>: -PASSED: +String.tests.cpp:<line number>: PASSED: CHECK( letters == "abcdefcz" ) with expansion: "abcdefcz" == "abcdefcz" @@ -9898,14 +9778,12 @@ replaceInPlace String.tests.cpp:<line number> ............................................................................... -String.tests.cpp:<line number>: -PASSED: +String.tests.cpp:<line number>: PASSED: CHECK( Catch::replaceInPlace( letters, letters, "replaced" ) ) with expansion: true -String.tests.cpp:<line number>: -PASSED: +String.tests.cpp:<line number>: PASSED: CHECK( letters == "replaced" ) with expansion: "replaced" == "replaced" @@ -9917,14 +9795,12 @@ replaceInPlace String.tests.cpp:<line number> ............................................................................... -String.tests.cpp:<line number>: -PASSED: +String.tests.cpp:<line number>: PASSED: CHECK_FALSE( Catch::replaceInPlace( letters, "x", "z" ) ) with expansion: !false -String.tests.cpp:<line number>: -PASSED: +String.tests.cpp:<line number>: PASSED: CHECK( letters == letters ) with expansion: "abcdefcg" == "abcdefcg" @@ -9936,14 +9812,12 @@ replaceInPlace String.tests.cpp:<line number> ............................................................................... -String.tests.cpp:<line number>: -PASSED: +String.tests.cpp:<line number>: PASSED: CHECK( Catch::replaceInPlace( s, "'", "|'" ) ) with expansion: true -String.tests.cpp:<line number>: -PASSED: +String.tests.cpp:<line number>: PASSED: CHECK( s == "didn|'t" ) with expansion: "didn|'t" == "didn|'t" @@ -9987,8 +9861,7 @@ std::map is convertible string ToStringGeneral.tests.cpp:<line number> ............................................................................... -ToStringGeneral.tests.cpp:<line number>: -PASSED: +ToStringGeneral.tests.cpp:<line number>: PASSED: REQUIRE( Catch::Detail::stringify( emptyMap ) == "{ }" ) with expansion: "{ }" == "{ }" @@ -10000,8 +9873,7 @@ std::map is convertible string ToStringGeneral.tests.cpp:<line number> ............................................................................... -ToStringGeneral.tests.cpp:<line number>: -PASSED: +ToStringGeneral.tests.cpp:<line number>: PASSED: REQUIRE( Catch::Detail::stringify( map ) == "{ { \"one\", 1 } }" ) with expansion: "{ { "one", 1 } }" == "{ { "one", 1 } }" @@ -10013,8 +9885,7 @@ std::map is convertible string ToStringGeneral.tests.cpp:<line number> ............................................................................... -ToStringGeneral.tests.cpp:<line number>: -PASSED: +ToStringGeneral.tests.cpp:<line number>: PASSED: REQUIRE( Catch::Detail::stringify( map ) == "{ { \"abc\", 1 }, { \"def\", 2 }, { \"ghi\", 3 } }" ) with expansion: "{ { "abc", 1 }, { "def", 2 }, { "ghi", 3 } }" @@ -10027,8 +9898,7 @@ std::pair<int,const std::string> -> toString ToStringPair.tests.cpp:<line number> ............................................................................... -ToStringPair.tests.cpp:<line number>: -PASSED: +ToStringPair.tests.cpp:<line number>: PASSED: REQUIRE( ::Catch::Detail::stringify(value) == "{ 34, \"xyzzy\" }" ) with expansion: "{ 34, "xyzzy" }" == "{ 34, "xyzzy" }" @@ -10039,8 +9909,7 @@ std::pair<int,std::string> -> toString ToStringPair.tests.cpp:<line number> ............................................................................... -ToStringPair.tests.cpp:<line number>: -PASSED: +ToStringPair.tests.cpp:<line number>: PASSED: REQUIRE( ::Catch::Detail::stringify( value ) == "{ 34, \"xyzzy\" }" ) with expansion: "{ 34, "xyzzy" }" == "{ 34, "xyzzy" }" @@ -10052,8 +9921,7 @@ std::set is convertible string ToStringGeneral.tests.cpp:<line number> ............................................................................... -ToStringGeneral.tests.cpp:<line number>: -PASSED: +ToStringGeneral.tests.cpp:<line number>: PASSED: REQUIRE( Catch::Detail::stringify( emptySet ) == "{ }" ) with expansion: "{ }" == "{ }" @@ -10065,8 +9933,7 @@ std::set is convertible string ToStringGeneral.tests.cpp:<line number> ............................................................................... -ToStringGeneral.tests.cpp:<line number>: -PASSED: +ToStringGeneral.tests.cpp:<line number>: PASSED: REQUIRE( Catch::Detail::stringify( set ) == "{ \"one\" }" ) with expansion: "{ "one" }" == "{ "one" }" @@ -10078,8 +9945,7 @@ std::set is convertible string ToStringGeneral.tests.cpp:<line number> ............................................................................... -ToStringGeneral.tests.cpp:<line number>: -PASSED: +ToStringGeneral.tests.cpp:<line number>: PASSED: REQUIRE( Catch::Detail::stringify( set ) == "{ \"abc\", \"def\", \"ghi\" }" ) with expansion: "{ "abc", "def", "ghi" }" @@ -10092,8 +9958,7 @@ std::vector<std::pair<std::string,int> > -> toString ToStringPair.tests.cpp:<line number> ............................................................................... -ToStringPair.tests.cpp:<line number>: -PASSED: +ToStringPair.tests.cpp:<line number>: PASSED: REQUIRE( ::Catch::Detail::stringify( pr ) == "{ { \"green\", 55 } }" ) with expansion: "{ { "green", 55 } }" @@ -10117,30 +9982,26 @@ stringify ranges ToStringWhich.tests.cpp:<line number> ............................................................................... -ToStringWhich.tests.cpp:<line number>: -PASSED: +ToStringWhich.tests.cpp:<line number>: PASSED: REQUIRE( ::Catch::Detail::stringify(streamable_range{}) == "op<<(streamable_range)" ) with expansion: "op<<(streamable_range)" == "op<<(streamable_range)" -ToStringWhich.tests.cpp:<line number>: -PASSED: +ToStringWhich.tests.cpp:<line number>: PASSED: REQUIRE( ::Catch::Detail::stringify(stringmaker_range{}) == "stringmaker(streamable_range)" ) with expansion: "stringmaker(streamable_range)" == "stringmaker(streamable_range)" -ToStringWhich.tests.cpp:<line number>: -PASSED: +ToStringWhich.tests.cpp:<line number>: PASSED: REQUIRE( ::Catch::Detail::stringify(just_range{}) == "{ 1, 2, 3, 4 }" ) with expansion: "{ 1, 2, 3, 4 }" == "{ 1, 2, 3, 4 }" -ToStringWhich.tests.cpp:<line number>: -PASSED: +ToStringWhich.tests.cpp:<line number>: PASSED: REQUIRE( ::Catch::Detail::stringify(disabled_range{}) == "{ !!! }" ) with expansion: "{ !!! }" == "{ !!! }" @@ -10151,8 +10012,7 @@ stringify( has_maker ) ToStringWhich.tests.cpp:<line number> ............................................................................... -ToStringWhich.tests.cpp:<line number>: -PASSED: +ToStringWhich.tests.cpp:<line number>: PASSED: REQUIRE( ::Catch::Detail::stringify( item ) == "StringMaker<has_maker>" ) with expansion: "StringMaker<has_maker>" @@ -10165,8 +10025,7 @@ stringify( has_maker_and_operator ) ToStringWhich.tests.cpp:<line number> ............................................................................... -ToStringWhich.tests.cpp:<line number>: -PASSED: +ToStringWhich.tests.cpp:<line number>: PASSED: REQUIRE( ::Catch::Detail::stringify( item ) == "StringMaker<has_maker_and_operator>" ) with expansion: "StringMaker<has_maker_and_operator>" @@ -10179,8 +10038,7 @@ stringify( has_neither ) ToStringWhich.tests.cpp:<line number> ............................................................................... -ToStringWhich.tests.cpp:<line number>: -PASSED: +ToStringWhich.tests.cpp:<line number>: PASSED: REQUIRE( ::Catch::Detail::stringify(item) == "{ !!! }" ) with expansion: "{ !!! }" == "{ !!! }" @@ -10191,8 +10049,7 @@ stringify( has_operator ) ToStringWhich.tests.cpp:<line number> ............................................................................... -ToStringWhich.tests.cpp:<line number>: -PASSED: +ToStringWhich.tests.cpp:<line number>: PASSED: REQUIRE( ::Catch::Detail::stringify( item ) == "operator<<( has_operator )" ) with expansion: "operator<<( has_operator )" @@ -10205,8 +10062,7 @@ stringify( has_template_operator ) ToStringWhich.tests.cpp:<line number> ............................................................................... -ToStringWhich.tests.cpp:<line number>: -PASSED: +ToStringWhich.tests.cpp:<line number>: PASSED: REQUIRE( ::Catch::Detail::stringify( item ) == "operator<<( has_template_operator )" ) with expansion: "operator<<( has_template_operator )" @@ -10219,8 +10075,7 @@ stringify( vectors<has_maker> ) ToStringWhich.tests.cpp:<line number> ............................................................................... -ToStringWhich.tests.cpp:<line number>: -PASSED: +ToStringWhich.tests.cpp:<line number>: PASSED: REQUIRE( ::Catch::Detail::stringify( v ) == "{ StringMaker<has_maker> }" ) with expansion: "{ StringMaker<has_maker> }" @@ -10233,8 +10088,7 @@ stringify( vectors<has_maker_and_operator> ) ToStringWhich.tests.cpp:<line number> ............................................................................... -ToStringWhich.tests.cpp:<line number>: -PASSED: +ToStringWhich.tests.cpp:<line number>: PASSED: REQUIRE( ::Catch::Detail::stringify( v ) == "{ StringMaker<has_maker_and_operator> }" ) with expansion: "{ StringMaker<has_maker_and_operator> }" @@ -10247,8 +10101,7 @@ stringify( vectors<has_operator> ) ToStringWhich.tests.cpp:<line number> ............................................................................... -ToStringWhich.tests.cpp:<line number>: -PASSED: +ToStringWhich.tests.cpp:<line number>: PASSED: REQUIRE( ::Catch::Detail::stringify( v ) == "{ operator<<( has_operator ) }" ) with expansion: "{ operator<<( has_operator ) }" @@ -10261,8 +10114,7 @@ strlen3 Generators.tests.cpp:<line number> ............................................................................... -Generators.tests.cpp:<line number>: -PASSED: +Generators.tests.cpp:<line number>: PASSED: REQUIRE( data.str.size() == data.len ) with expansion: 3 == 3 @@ -10273,8 +10125,7 @@ strlen3 Generators.tests.cpp:<line number> ............................................................................... -Generators.tests.cpp:<line number>: -PASSED: +Generators.tests.cpp:<line number>: PASSED: REQUIRE( data.str.size() == data.len ) with expansion: 3 == 3 @@ -10285,8 +10136,7 @@ strlen3 Generators.tests.cpp:<line number> ............................................................................... -Generators.tests.cpp:<line number>: -PASSED: +Generators.tests.cpp:<line number>: PASSED: REQUIRE( data.str.size() == data.len ) with expansion: 5 == 5 @@ -10297,8 +10147,7 @@ strlen3 Generators.tests.cpp:<line number> ............................................................................... -Generators.tests.cpp:<line number>: -PASSED: +Generators.tests.cpp:<line number>: PASSED: REQUIRE( data.str.size() == data.len ) with expansion: 4 == 4 @@ -10319,8 +10168,7 @@ toString on const wchar_t const pointer returns the string contents Misc.tests.cpp:<line number> ............................................................................... -Misc.tests.cpp:<line number>: -PASSED: +Misc.tests.cpp:<line number>: PASSED: CHECK( result == "\"wide load\"" ) with expansion: ""wide load"" == ""wide load"" @@ -10331,8 +10179,7 @@ toString on const wchar_t pointer returns the string contents Misc.tests.cpp:<line number> ............................................................................... -Misc.tests.cpp:<line number>: -PASSED: +Misc.tests.cpp:<line number>: PASSED: CHECK( result == "\"wide load\"" ) with expansion: ""wide load"" == ""wide load"" @@ -10343,8 +10190,7 @@ toString on wchar_t const pointer returns the string contents Misc.tests.cpp:<line number> ............................................................................... -Misc.tests.cpp:<line number>: -PASSED: +Misc.tests.cpp:<line number>: PASSED: CHECK( result == "\"wide load\"" ) with expansion: ""wide load"" == ""wide load"" @@ -10355,8 +10201,7 @@ toString on wchar_t returns the string contents Misc.tests.cpp:<line number> ............................................................................... -Misc.tests.cpp:<line number>: -PASSED: +Misc.tests.cpp:<line number>: PASSED: CHECK( result == "\"wide load\"" ) with expansion: ""wide load"" == ""wide load"" @@ -10367,20 +10212,17 @@ toString(enum class w/operator<<) EnumToString.tests.cpp:<line number> ............................................................................... -EnumToString.tests.cpp:<line number>: -PASSED: +EnumToString.tests.cpp:<line number>: PASSED: CHECK( ::Catch::Detail::stringify(e0) == "E2/V0" ) with expansion: "E2/V0" == "E2/V0" -EnumToString.tests.cpp:<line number>: -PASSED: +EnumToString.tests.cpp:<line number>: PASSED: CHECK( ::Catch::Detail::stringify(e1) == "E2/V1" ) with expansion: "E2/V1" == "E2/V1" -EnumToString.tests.cpp:<line number>: -PASSED: +EnumToString.tests.cpp:<line number>: PASSED: CHECK( ::Catch::Detail::stringify(e3) == "Unknown enum value 10" ) with expansion: "Unknown enum value 10" @@ -10393,14 +10235,12 @@ toString(enum class) EnumToString.tests.cpp:<line number> ............................................................................... -EnumToString.tests.cpp:<line number>: -PASSED: +EnumToString.tests.cpp:<line number>: PASSED: CHECK( ::Catch::Detail::stringify(e0) == "0" ) with expansion: "0" == "0" -EnumToString.tests.cpp:<line number>: -PASSED: +EnumToString.tests.cpp:<line number>: PASSED: CHECK( ::Catch::Detail::stringify(e1) == "1" ) with expansion: "1" == "1" @@ -10411,14 +10251,12 @@ toString(enum w/operator<<) EnumToString.tests.cpp:<line number> ............................................................................... -EnumToString.tests.cpp:<line number>: -PASSED: +EnumToString.tests.cpp:<line number>: PASSED: CHECK( ::Catch::Detail::stringify(e0) == "E2{0}" ) with expansion: "E2{0}" == "E2{0}" -EnumToString.tests.cpp:<line number>: -PASSED: +EnumToString.tests.cpp:<line number>: PASSED: CHECK( ::Catch::Detail::stringify(e1) == "E2{1}" ) with expansion: "E2{1}" == "E2{1}" @@ -10429,14 +10267,12 @@ toString(enum) EnumToString.tests.cpp:<line number> ............................................................................... -EnumToString.tests.cpp:<line number>: -PASSED: +EnumToString.tests.cpp:<line number>: PASSED: CHECK( ::Catch::Detail::stringify(e0) == "0" ) with expansion: "0" == "0" -EnumToString.tests.cpp:<line number>: -PASSED: +EnumToString.tests.cpp:<line number>: PASSED: CHECK( ::Catch::Detail::stringify(e1) == "1" ) with expansion: "1" == "1" @@ -10447,14 +10283,12 @@ tuple<> ToStringTuple.tests.cpp:<line number> ............................................................................... -ToStringTuple.tests.cpp:<line number>: -PASSED: +ToStringTuple.tests.cpp:<line number>: PASSED: CHECK( "{ }" == ::Catch::Detail::stringify(type{}) ) with expansion: "{ }" == "{ }" -ToStringTuple.tests.cpp:<line number>: -PASSED: +ToStringTuple.tests.cpp:<line number>: PASSED: CHECK( "{ }" == ::Catch::Detail::stringify(value) ) with expansion: "{ }" == "{ }" @@ -10465,14 +10299,12 @@ tuple<float,int> ToStringTuple.tests.cpp:<line number> ............................................................................... -ToStringTuple.tests.cpp:<line number>: -PASSED: +ToStringTuple.tests.cpp:<line number>: PASSED: CHECK( "1.2f" == ::Catch::Detail::stringify(float(1.2)) ) with expansion: "1.2f" == "1.2f" -ToStringTuple.tests.cpp:<line number>: -PASSED: +ToStringTuple.tests.cpp:<line number>: PASSED: CHECK( "{ 1.2f, 0 }" == ::Catch::Detail::stringify(type{1.2f,0}) ) with expansion: "{ 1.2f, 0 }" == "{ 1.2f, 0 }" @@ -10483,8 +10315,7 @@ tuple<int> ToStringTuple.tests.cpp:<line number> ............................................................................... -ToStringTuple.tests.cpp:<line number>: -PASSED: +ToStringTuple.tests.cpp:<line number>: PASSED: CHECK( "{ 0 }" == ::Catch::Detail::stringify(type{0}) ) with expansion: "{ 0 }" == "{ 0 }" @@ -10495,8 +10326,7 @@ tuple<0,int,const char *> ToStringTuple.tests.cpp:<line number> ............................................................................... -ToStringTuple.tests.cpp:<line number>: -PASSED: +ToStringTuple.tests.cpp:<line number>: PASSED: CHECK( "{ 0, 42, \"Catch me\" }" == ::Catch::Detail::stringify(value) ) with expansion: "{ 0, 42, "Catch me" }" @@ -10509,8 +10339,7 @@ tuple<string,string> ToStringTuple.tests.cpp:<line number> ............................................................................... -ToStringTuple.tests.cpp:<line number>: -PASSED: +ToStringTuple.tests.cpp:<line number>: PASSED: CHECK( "{ \"hello\", \"world\" }" == ::Catch::Detail::stringify(type{"hello","world"}) ) with expansion: "{ "hello", "world" }" @@ -10523,8 +10352,7 @@ tuple<tuple<int>,tuple<>,float> ToStringTuple.tests.cpp:<line number> ............................................................................... -ToStringTuple.tests.cpp:<line number>: -PASSED: +ToStringTuple.tests.cpp:<line number>: PASSED: CHECK( "{ { 42 }, { }, 1.2f }" == ::Catch::Detail::stringify(value) ) with expansion: "{ { 42 }, { }, 1.2f }" @@ -10537,14 +10365,12 @@ vec<vec<string,alloc>> -> toString ToStringVector.tests.cpp:<line number> ............................................................................... -ToStringVector.tests.cpp:<line number>: -PASSED: +ToStringVector.tests.cpp:<line number>: PASSED: REQUIRE( ::Catch::Detail::stringify(v) == "{ }" ) with expansion: "{ }" == "{ }" -ToStringVector.tests.cpp:<line number>: -PASSED: +ToStringVector.tests.cpp:<line number>: PASSED: REQUIRE( ::Catch::Detail::stringify(v) == "{ { \"hello\" }, { \"world\" } }" ) with expansion: "{ { "hello" }, { "world" } }" @@ -10557,20 +10383,17 @@ vector<bool> -> toString ToStringVector.tests.cpp:<line number> ............................................................................... -ToStringVector.tests.cpp:<line number>: -PASSED: +ToStringVector.tests.cpp:<line number>: PASSED: REQUIRE( ::Catch::Detail::stringify(bools) == "{ }" ) with expansion: "{ }" == "{ }" -ToStringVector.tests.cpp:<line number>: -PASSED: +ToStringVector.tests.cpp:<line number>: PASSED: REQUIRE( ::Catch::Detail::stringify(bools) == "{ true }" ) with expansion: "{ true }" == "{ true }" -ToStringVector.tests.cpp:<line number>: -PASSED: +ToStringVector.tests.cpp:<line number>: PASSED: REQUIRE( ::Catch::Detail::stringify(bools) == "{ true, false }" ) with expansion: "{ true, false }" == "{ true, false }" @@ -10581,20 +10404,17 @@ vector<int,allocator> -> toString ToStringVector.tests.cpp:<line number> ............................................................................... -ToStringVector.tests.cpp:<line number>: -PASSED: +ToStringVector.tests.cpp:<line number>: PASSED: REQUIRE( ::Catch::Detail::stringify(vv) == "{ }" ) with expansion: "{ }" == "{ }" -ToStringVector.tests.cpp:<line number>: -PASSED: +ToStringVector.tests.cpp:<line number>: PASSED: REQUIRE( ::Catch::Detail::stringify(vv) == "{ 42 }" ) with expansion: "{ 42 }" == "{ 42 }" -ToStringVector.tests.cpp:<line number>: -PASSED: +ToStringVector.tests.cpp:<line number>: PASSED: REQUIRE( ::Catch::Detail::stringify(vv) == "{ 42, 250 }" ) with expansion: "{ 42, 250 }" == "{ 42, 250 }" @@ -10605,20 +10425,17 @@ vector<int> -> toString ToStringVector.tests.cpp:<line number> ............................................................................... -ToStringVector.tests.cpp:<line number>: -PASSED: +ToStringVector.tests.cpp:<line number>: PASSED: REQUIRE( ::Catch::Detail::stringify(vv) == "{ }" ) with expansion: "{ }" == "{ }" -ToStringVector.tests.cpp:<line number>: -PASSED: +ToStringVector.tests.cpp:<line number>: PASSED: REQUIRE( ::Catch::Detail::stringify(vv) == "{ 42 }" ) with expansion: "{ 42 }" == "{ 42 }" -ToStringVector.tests.cpp:<line number>: -PASSED: +ToStringVector.tests.cpp:<line number>: PASSED: REQUIRE( ::Catch::Detail::stringify(vv) == "{ 42, 250 }" ) with expansion: "{ 42, 250 }" == "{ 42, 250 }" @@ -10629,20 +10446,17 @@ vector<string> -> toString ToStringVector.tests.cpp:<line number> ............................................................................... -ToStringVector.tests.cpp:<line number>: -PASSED: +ToStringVector.tests.cpp:<line number>: PASSED: REQUIRE( ::Catch::Detail::stringify(vv) == "{ }" ) with expansion: "{ }" == "{ }" -ToStringVector.tests.cpp:<line number>: -PASSED: +ToStringVector.tests.cpp:<line number>: PASSED: REQUIRE( ::Catch::Detail::stringify(vv) == "{ \"hello\" }" ) with expansion: "{ "hello" }" == "{ "hello" }" -ToStringVector.tests.cpp:<line number>: -PASSED: +ToStringVector.tests.cpp:<line number>: PASSED: REQUIRE( ::Catch::Detail::stringify(vv) == "{ \"hello\", \"world\" }" ) with expansion: "{ "hello", "world" }" @@ -10655,14 +10469,12 @@ vectors can be sized and resized Misc.tests.cpp:<line number> ............................................................................... -Misc.tests.cpp:<line number>: -PASSED: +Misc.tests.cpp:<line number>: PASSED: REQUIRE( v.size() == 5 ) with expansion: 5 == 5 -Misc.tests.cpp:<line number>: -PASSED: +Misc.tests.cpp:<line number>: PASSED: REQUIRE( v.capacity() >= 5 ) with expansion: 5 >= 5 @@ -10674,14 +10486,12 @@ vectors can be sized and resized Misc.tests.cpp:<line number> ............................................................................... -Misc.tests.cpp:<line number>: -PASSED: +Misc.tests.cpp:<line number>: PASSED: REQUIRE( v.size() == 10 ) with expansion: 10 == 10 -Misc.tests.cpp:<line number>: -PASSED: +Misc.tests.cpp:<line number>: PASSED: REQUIRE( v.capacity() >= 10 ) with expansion: 10 >= 10 @@ -10692,14 +10502,12 @@ vectors can be sized and resized Misc.tests.cpp:<line number> ............................................................................... -Misc.tests.cpp:<line number>: -PASSED: +Misc.tests.cpp:<line number>: PASSED: REQUIRE( v.size() == 5 ) with expansion: 5 == 5 -Misc.tests.cpp:<line number>: -PASSED: +Misc.tests.cpp:<line number>: PASSED: REQUIRE( v.capacity() >= 5 ) with expansion: 5 >= 5 @@ -10711,14 +10519,12 @@ vectors can be sized and resized Misc.tests.cpp:<line number> ............................................................................... -Misc.tests.cpp:<line number>: -PASSED: +Misc.tests.cpp:<line number>: PASSED: REQUIRE( v.size() == 0 ) with expansion: 0 == 0 -Misc.tests.cpp:<line number>: -PASSED: +Misc.tests.cpp:<line number>: PASSED: REQUIRE( v.capacity() >= 5 ) with expansion: 5 >= 5 @@ -10731,8 +10537,7 @@ vectors can be sized and resized Misc.tests.cpp:<line number> ............................................................................... -Misc.tests.cpp:<line number>: -PASSED: +Misc.tests.cpp:<line number>: PASSED: REQUIRE( v.capacity() == 0 ) with expansion: 0 == 0 @@ -10743,14 +10548,12 @@ vectors can be sized and resized Misc.tests.cpp:<line number> ............................................................................... -Misc.tests.cpp:<line number>: -PASSED: +Misc.tests.cpp:<line number>: PASSED: REQUIRE( v.size() == 5 ) with expansion: 5 == 5 -Misc.tests.cpp:<line number>: -PASSED: +Misc.tests.cpp:<line number>: PASSED: REQUIRE( v.capacity() >= 5 ) with expansion: 5 >= 5 @@ -10762,14 +10565,12 @@ vectors can be sized and resized Misc.tests.cpp:<line number> ............................................................................... -Misc.tests.cpp:<line number>: -PASSED: +Misc.tests.cpp:<line number>: PASSED: REQUIRE( v.size() == 5 ) with expansion: 5 == 5 -Misc.tests.cpp:<line number>: -PASSED: +Misc.tests.cpp:<line number>: PASSED: REQUIRE( v.capacity() >= 10 ) with expansion: 10 >= 10 @@ -10780,14 +10581,12 @@ vectors can be sized and resized Misc.tests.cpp:<line number> ............................................................................... -Misc.tests.cpp:<line number>: -PASSED: +Misc.tests.cpp:<line number>: PASSED: REQUIRE( v.size() == 5 ) with expansion: 5 == 5 -Misc.tests.cpp:<line number>: -PASSED: +Misc.tests.cpp:<line number>: PASSED: REQUIRE( v.capacity() >= 5 ) with expansion: 5 >= 5 @@ -10799,14 +10598,12 @@ vectors can be sized and resized Misc.tests.cpp:<line number> ............................................................................... -Misc.tests.cpp:<line number>: -PASSED: +Misc.tests.cpp:<line number>: PASSED: REQUIRE( v.size() == 5 ) with expansion: 5 == 5 -Misc.tests.cpp:<line number>: -PASSED: +Misc.tests.cpp:<line number>: PASSED: REQUIRE( v.capacity() >= 5 ) with expansion: 5 >= 5 @@ -10814,14 +10611,13 @@ with expansion: ------------------------------------------------------------------------------- xmlentitycheck embedded xml: <test>it should be possible to embed xml characters, such as <, - " or &, or even whole <xml>documents</xml> within an attribute</test> + " or &, or even whole <xml>documents</xml> within an attribute </test> ------------------------------------------------------------------------------- Misc.tests.cpp:<line number> ............................................................................... -Misc.tests.cpp:<line number>: -PASSED: +Misc.tests.cpp:<line number>: PASSED: ------------------------------------------------------------------------------- xmlentitycheck @@ -10830,10 +10626,9 @@ xmlentitycheck Misc.tests.cpp:<line number> ............................................................................... -Misc.tests.cpp:<line number>: -PASSED: +Misc.tests.cpp:<line number>: PASSED: =============================================================================== -test cases: 213 | 147 passed | 62 failed | 4 failed as expected -assertions: 1242 | 1099 passed | 122 failed | 21 failed as expected +test cases: 243 | 170 passed | 69 failed | 4 failed as expected +assertions: 1339 | 1189 passed | 129 failed | 21 failed as expected diff --git a/packages/Catch2/projects/SelfTest/Baselines/console.swa4.approved.txt b/packages/Catch2/projects/SelfTest/Baselines/console.swa4.approved.txt index d69844d8b53578eac5d94239540856827bb7ffee..36ca1bde56afeffddb2adc4152c0a7b94b7642a2 100644 --- a/packages/Catch2/projects/SelfTest/Baselines/console.swa4.approved.txt +++ b/packages/Catch2/projects/SelfTest/Baselines/console.swa4.approved.txt @@ -3,14 +3,15 @@ <exe-name> is a <version> host application. Run with -? for options +Randomness seeded to: 1 + ------------------------------------------------------------------------------- # A test name that starts with a # ------------------------------------------------------------------------------- Misc.tests.cpp:<line number> ............................................................................... -Misc.tests.cpp:<line number>: -PASSED: +Misc.tests.cpp:<line number>: PASSED: with message: yay @@ -21,14 +22,12 @@ with message: Decomposition.tests.cpp:<line number> ............................................................................... -Decomposition.tests.cpp:<line number>: -PASSED: +Decomposition.tests.cpp:<line number>: PASSED: REQUIRE( fptr == 0 ) with expansion: 0 == 0 -Decomposition.tests.cpp:<line number>: -PASSED: +Decomposition.tests.cpp:<line number>: PASSED: REQUIRE( fptr == 0l ) with expansion: 0 == 0 @@ -39,14 +38,12 @@ with expansion: Compilation.tests.cpp:<line number> ............................................................................... -Compilation.tests.cpp:<line number>: -PASSED: +Compilation.tests.cpp:<line number>: PASSED: REQUIRE( y.v == 0 ) with expansion: 0 == 0 -Compilation.tests.cpp:<line number>: -PASSED: +Compilation.tests.cpp:<line number>: PASSED: REQUIRE( 0 == y.v ) with expansion: 0 == 0 @@ -57,38 +54,32 @@ with expansion: Compilation.tests.cpp:<line number> ............................................................................... -Compilation.tests.cpp:<line number>: -PASSED: +Compilation.tests.cpp:<line number>: PASSED: REQUIRE( t1 == t2 ) with expansion: {?} == {?} -Compilation.tests.cpp:<line number>: -PASSED: +Compilation.tests.cpp:<line number>: PASSED: REQUIRE( t1 != t2 ) with expansion: {?} != {?} -Compilation.tests.cpp:<line number>: -PASSED: +Compilation.tests.cpp:<line number>: PASSED: REQUIRE( t1 < t2 ) with expansion: {?} < {?} -Compilation.tests.cpp:<line number>: -PASSED: +Compilation.tests.cpp:<line number>: PASSED: REQUIRE( t1 > t2 ) with expansion: {?} > {?} -Compilation.tests.cpp:<line number>: -PASSED: +Compilation.tests.cpp:<line number>: PASSED: REQUIRE( t1 <= t2 ) with expansion: {?} <= {?} -Compilation.tests.cpp:<line number>: -PASSED: +Compilation.tests.cpp:<line number>: PASSED: REQUIRE( t1 >= t2 ) with expansion: {?} >= {?} @@ -99,8 +90,7 @@ with expansion: Misc.tests.cpp:<line number> ............................................................................... -Misc.tests.cpp:<line number>: -PASSED: +Misc.tests.cpp:<line number>: PASSED: ------------------------------------------------------------------------------- #1238 @@ -108,8 +98,7 @@ PASSED: Compilation.tests.cpp:<line number> ............................................................................... -Compilation.tests.cpp:<line number>: -PASSED: +Compilation.tests.cpp:<line number>: PASSED: REQUIRE( std::memcmp(uarr, "123", sizeof(uarr)) == 0 ) with expansion: 0 == 0 @@ -117,8 +106,7 @@ with messages: uarr := "123" sarr := "456" -Compilation.tests.cpp:<line number>: -PASSED: +Compilation.tests.cpp:<line number>: PASSED: REQUIRE( std::memcmp(sarr, "456", sizeof(sarr)) == 0 ) with expansion: 0 == 0 @@ -132,8 +120,18 @@ with messages: Compilation.tests.cpp:<line number> ............................................................................... -Compilation.tests.cpp:<line number>: -PASSED: +Compilation.tests.cpp:<line number>: PASSED: + +------------------------------------------------------------------------------- +#1403 +------------------------------------------------------------------------------- +Compilation.tests.cpp:<line number> +............................................................................... + +Compilation.tests.cpp:<line number>: PASSED: + REQUIRE( h1 == h2 ) +with expansion: + [1403 helper] == [1403 helper] ------------------------------------------------------------------------------- #748 - captures with unexpected exceptions @@ -167,8 +165,7 @@ due to unexpected exception with messages: Exception.tests.cpp:<line number> ............................................................................... -Exception.tests.cpp:<line number>: -PASSED: +Exception.tests.cpp:<line number>: PASSED: REQUIRE_THROWS( thisThrows() ) with message: answer := 42 @@ -179,8 +176,7 @@ with message: Compilation.tests.cpp:<line number> ............................................................................... -Compilation.tests.cpp:<line number>: -PASSED: +Compilation.tests.cpp:<line number>: PASSED: REQUIRE( 42 == f ) with expansion: 42 == {?} @@ -191,38 +187,31 @@ with expansion: Compilation.tests.cpp:<line number> ............................................................................... -Compilation.tests.cpp:<line number>: -PASSED: +Compilation.tests.cpp:<line number>: PASSED: REQUIRE( a == t ) with expansion: 3 == 3 -Compilation.tests.cpp:<line number>: -PASSED: +Compilation.tests.cpp:<line number>: PASSED: CHECK( a == t ) with expansion: 3 == 3 -Compilation.tests.cpp:<line number>: -PASSED: +Compilation.tests.cpp:<line number>: PASSED: REQUIRE_THROWS( throws_int(true) ) -Compilation.tests.cpp:<line number>: -PASSED: +Compilation.tests.cpp:<line number>: PASSED: CHECK_THROWS_AS( throws_int(true), int ) -Compilation.tests.cpp:<line number>: -PASSED: +Compilation.tests.cpp:<line number>: PASSED: REQUIRE_NOTHROW( throws_int(false) ) -Compilation.tests.cpp:<line number>: -PASSED: +Compilation.tests.cpp:<line number>: PASSED: REQUIRE_THAT( "aaa", Catch::EndsWith("aaa") ) with expansion: "aaa" ends with: "aaa" -Compilation.tests.cpp:<line number>: -PASSED: +Compilation.tests.cpp:<line number>: PASSED: REQUIRE( templated_tests<int>(3) ) with expansion: true @@ -238,8 +227,7 @@ Misc.tests.cpp:<line number>: FAILED: with expansion: 1 == 0 -Misc.tests.cpp:<line number>: -PASSED: +Misc.tests.cpp:<line number>: PASSED: REQUIRE( errno == 1 ) with expansion: 1 == 1 @@ -250,8 +238,7 @@ with expansion: Compilation.tests.cpp:<line number> ............................................................................... -Compilation.tests.cpp:<line number>: -PASSED: +Compilation.tests.cpp:<line number>: PASSED: REQUIRE( x == 4 ) with expansion: {?} == 4 @@ -265,8 +252,7 @@ with message: Misc.tests.cpp:<line number> ............................................................................... -Misc.tests.cpp:<line number>: -PASSED: +Misc.tests.cpp:<line number>: PASSED: with message: Everything is OK @@ -277,8 +263,7 @@ with message: Misc.tests.cpp:<line number> ............................................................................... -Misc.tests.cpp:<line number>: -PASSED: +Misc.tests.cpp:<line number>: PASSED: with message: Everything is OK @@ -289,8 +274,7 @@ with message: Misc.tests.cpp:<line number> ............................................................................... -Misc.tests.cpp:<line number>: -PASSED: +Misc.tests.cpp:<line number>: PASSED: with message: Everything is OK @@ -301,8 +285,7 @@ with message: Misc.tests.cpp:<line number> ............................................................................... -Misc.tests.cpp:<line number>: -PASSED: +Misc.tests.cpp:<line number>: PASSED: with message: Everything is OK @@ -313,8 +296,7 @@ with message: Misc.tests.cpp:<line number> ............................................................................... -Misc.tests.cpp:<line number>: -PASSED: +Misc.tests.cpp:<line number>: PASSED: with message: Everything is OK @@ -341,6 +323,6 @@ with expansion: !true =============================================================================== -test cases: 14 | 11 passed | 1 failed | 2 failed as expected -assertions: 38 | 31 passed | 4 failed | 3 failed as expected +test cases: 15 | 12 passed | 1 failed | 2 failed as expected +assertions: 39 | 32 passed | 4 failed | 3 failed as expected diff --git a/packages/Catch2/projects/SelfTest/Baselines/junit.sw.approved.txt b/packages/Catch2/projects/SelfTest/Baselines/junit.sw.approved.txt index ad5caeb17976c45856b83aa42adecff16e6e624b..beb8b459da6a148712fe25e2044476172f91f22d 100644 --- a/packages/Catch2/projects/SelfTest/Baselines/junit.sw.approved.txt +++ b/packages/Catch2/projects/SelfTest/Baselines/junit.sw.approved.txt @@ -1,7 +1,7 @@ <?xml version="1.0" encoding="UTF-8"?> <testsuitesloose text artifact > - <testsuite name="<exe-name>" errors="17" failures="106" tests="1243" hostname="tbd" time="{duration}" timestamp="{iso8601-timestamp}"> + <testsuite name="<exe-name>" errors="17" failures="113" tests="1340" hostname="tbd" time="{duration}" timestamp="{iso8601-timestamp}"> <testcase classname="<exe-name>.global" name="# A test name that starts with a #" time="{duration}"/> <testcase classname="<exe-name>.global" name="#1005: Comparing pointer to int and long (NULL can be either on various systems)" time="{duration}"/> <testcase classname="<exe-name>.global" name="#1027" time="{duration}"/> @@ -9,6 +9,7 @@ <testcase classname="<exe-name>.global" name="#1175 - Hidden Test" time="{duration}"/> <testcase classname="<exe-name>.global" name="#1238" time="{duration}"/> <testcase classname="<exe-name>.(Fixture_1245<int, int>)" name="#1245" time="{duration}"/> + <testcase classname="<exe-name>.global" name="#1403" time="{duration}"/> <testcase classname="<exe-name>.global" name="#748 - captures with unexpected exceptions/outside assertions" time="{duration}"> <error type="TEST_CASE"> expected exception @@ -76,12 +77,58 @@ Class.tests.cpp:<line number> </failure> </testcase> <testcase classname="<exe-name>.TestClass" name="A METHOD_AS_TEST_CASE based test run that succeeds" time="{duration}"/> + <testcase classname="<exe-name>.Template_Fixture_2" name="A TEMPLATE_PRODUCT_TEST_CASE_METHOD based test run that fails - 0" time="{duration}"> + <failure message="0 == 1" type="REQUIRE"> +Class.tests.cpp:<line number> + </failure> + </testcase> + <testcase classname="<exe-name>.Template_Fixture_2" name="A TEMPLATE_PRODUCT_TEST_CASE_METHOD based test run that fails - 1" time="{duration}"> + <failure message="0 == 1" type="REQUIRE"> +Class.tests.cpp:<line number> + </failure> + </testcase> + <testcase classname="<exe-name>.Template_Fixture_2" name="A TEMPLATE_PRODUCT_TEST_CASE_METHOD based test run that fails - 2" time="{duration}"> + <failure message="0 == 1" type="REQUIRE"> +Class.tests.cpp:<line number> + </failure> + </testcase> + <testcase classname="<exe-name>.Template_Fixture_2" name="A TEMPLATE_PRODUCT_TEST_CASE_METHOD based test run that fails - 3" time="{duration}"> + <failure message="0 == 1" type="REQUIRE"> +Class.tests.cpp:<line number> + </failure> + </testcase> + <testcase classname="<exe-name>.Template_Fixture_2" name="A TEMPLATE_PRODUCT_TEST_CASE_METHOD based test run that succeeds - 0" time="{duration}"/> + <testcase classname="<exe-name>.Template_Fixture_2" name="A TEMPLATE_PRODUCT_TEST_CASE_METHOD based test run that succeeds - 1" time="{duration}"/> + <testcase classname="<exe-name>.Template_Fixture_2" name="A TEMPLATE_PRODUCT_TEST_CASE_METHOD based test run that succeeds - 2" time="{duration}"/> + <testcase classname="<exe-name>.Template_Fixture_2" name="A TEMPLATE_PRODUCT_TEST_CASE_METHOD based test run that succeeds - 3" time="{duration}"/> + <testcase classname="<exe-name>.Template_Fixture" name="A TEMPLATE_TEST_CASE_METHOD based test run that fails - double" time="{duration}"> + <failure message="1.0 == 2" type="REQUIRE"> +Class.tests.cpp:<line number> + </failure> + </testcase> + <testcase classname="<exe-name>.Template_Fixture" name="A TEMPLATE_TEST_CASE_METHOD based test run that fails - float" time="{duration}"> + <failure message="1.0f == 2" type="REQUIRE"> +Class.tests.cpp:<line number> + </failure> + </testcase> + <testcase classname="<exe-name>.Template_Fixture" name="A TEMPLATE_TEST_CASE_METHOD based test run that fails - int" time="{duration}"> + <failure message="1 == 2" type="REQUIRE"> +Class.tests.cpp:<line number> + </failure> + </testcase> + <testcase classname="<exe-name>.Template_Fixture" name="A TEMPLATE_TEST_CASE_METHOD based test run that succeeds - double" time="{duration}"/> + <testcase classname="<exe-name>.Template_Fixture" name="A TEMPLATE_TEST_CASE_METHOD based test run that succeeds - float" time="{duration}"/> + <testcase classname="<exe-name>.Template_Fixture" name="A TEMPLATE_TEST_CASE_METHOD based test run that succeeds - int" time="{duration}"/> <testcase classname="<exe-name>.Fixture" name="A TEST_CASE_METHOD based test run that fails" time="{duration}"> <failure message="1 == 2" type="REQUIRE"> Class.tests.cpp:<line number> </failure> </testcase> <testcase classname="<exe-name>.Fixture" name="A TEST_CASE_METHOD based test run that succeeds" time="{duration}"/> + <testcase classname="<exe-name>.global" name="A Template product test case - 0" time="{duration}"/> + <testcase classname="<exe-name>.global" name="A Template product test case - 1" time="{duration}"/> + <testcase classname="<exe-name>.global" name="A Template product test case - 2" time="{duration}"/> + <testcase classname="<exe-name>.global" name="A Template product test case - 3" time="{duration}"/> <testcase classname="<exe-name>.global" name="A comparison that uses literals instead of the normal constructor" time="{duration}"/> <testcase classname="<exe-name>.global" name="A couple of nested sections followed by a failure" time="{duration}"> <failure type="FAIL"> @@ -122,6 +169,8 @@ Exception.tests.cpp:<line number> <testcase classname="<exe-name>.global" name="Assertions then sections/A section/Another other section" time="{duration}"/> <testcase classname="<exe-name>.global" name="Assorted miscellaneous tests" time="{duration}"/> <testcase classname="<exe-name>.global" name="Bitfields can be captured (#1027)" time="{duration}"/> + <testcase classname="<exe-name>.global" name="CAPTURE can deal with complex expressions" time="{duration}"/> + <testcase classname="<exe-name>.global" name="CAPTURE can deal with complex expressions involving commas" time="{duration}"/> <testcase classname="<exe-name>.global" name="Capture and info messages/Capture should stringify like assertions" time="{duration}"/> <testcase classname="<exe-name>.global" name="Capture and info messages/Info should NOT stringify the way assertions do" time="{duration}"/> <testcase classname="<exe-name>.global" name="Character pretty printing/Specifically escaped" time="{duration}"/> @@ -374,6 +423,7 @@ Exception.tests.cpp:<line number> </error> </testcase> <testcase classname="<exe-name>.global" name="Objects that evaluated in boolean contexts can be checked" time="{duration}"/> + <testcase classname="<exe-name>.global" name="Optionally static assertions" time="{duration}"/> <testcase classname="<exe-name>.global" name="Ordering comparison checks that should fail" time="{duration}"> <failure message="7 > 7" type="CHECK"> Condition.tests.cpp:<line number> @@ -478,6 +528,7 @@ Message.tests.cpp:<line number> <testcase classname="<exe-name>.global" name="Parse test names and tags/empty quoted name" time="{duration}"/> <testcase classname="<exe-name>.global" name="Parse test names and tags/quoted string followed by tag exclusion" time="{duration}"/> <testcase classname="<exe-name>.global" name="Pointers can be compared to null" time="{duration}"/> + <testcase classname="<exe-name>.global" name="Predicate matcher can accept const char*" time="{duration}"/> <testcase classname="<exe-name>.global" name="Process can be configured on command line/empty args don't cause a crash" time="{duration}"/> <testcase classname="<exe-name>.global" name="Process can be configured on command line/default - no arguments" time="{duration}"/> <testcase classname="<exe-name>.global" name="Process can be configured on command line/test lists/Specify one test case using" time="{duration}"/> @@ -487,6 +538,7 @@ Message.tests.cpp:<line number> <testcase classname="<exe-name>.global" name="Process can be configured on command line/reporter/-r/xml" time="{duration}"/> <testcase classname="<exe-name>.global" name="Process can be configured on command line/reporter/--reporter/junit" time="{duration}"/> <testcase classname="<exe-name>.global" name="Process can be configured on command line/reporter/Only one reporter is accepted" time="{duration}"/> + <testcase classname="<exe-name>.global" name="Process can be configured on command line/reporter/must match one of the available ones" time="{duration}"/> <testcase classname="<exe-name>.global" name="Process can be configured on command line/debugger/-b" time="{duration}"/> <testcase classname="<exe-name>.global" name="Process can be configured on command line/debugger/--break" time="{duration}"/> <testcase classname="<exe-name>.global" name="Process can be configured on command line/abort/-a aborts after first failure" time="{duration}"/> @@ -502,6 +554,9 @@ Message.tests.cpp:<line number> <testcase classname="<exe-name>.global" name="Process can be configured on command line/use-colour/yes" time="{duration}"/> <testcase classname="<exe-name>.global" name="Process can be configured on command line/use-colour/no" time="{duration}"/> <testcase classname="<exe-name>.global" name="Process can be configured on command line/use-colour/error" time="{duration}"/> + <testcase classname="<exe-name>.global" name="Product with differing arities - 0" time="{duration}"/> + <testcase classname="<exe-name>.global" name="Product with differing arities - 1" time="{duration}"/> + <testcase classname="<exe-name>.global" name="Product with differing arities - 2" time="{duration}"/> <testcase classname="<exe-name>.global" name="Reconstruction should be based on stringification: #914" time="{duration}"> <failure message="Hey, its truthy!" type="CHECK"> Decomposition.tests.cpp:<line number> @@ -592,6 +647,30 @@ Misc.tests.cpp:<line number> </testcase> <testcase classname="<exe-name>.global" name="Tag alias can be registered against tag patterns/The same tag alias can only be registered once" time="{duration}"/> <testcase classname="<exe-name>.global" name="Tag alias can be registered against tag patterns/Tag aliases must be of the form [@name]" time="{duration}"/> + <testcase classname="<exe-name>.global" name="TemplateTest: vectors can be sized and resized - float" time="{duration}"/> + <testcase classname="<exe-name>.global" name="TemplateTest: vectors can be sized and resized - float/resizing bigger changes size and capacity" time="{duration}"/> + <testcase classname="<exe-name>.global" name="TemplateTest: vectors can be sized and resized - float/resizing smaller changes size but not capacity" time="{duration}"/> + <testcase classname="<exe-name>.global" name="TemplateTest: vectors can be sized and resized - float/resizing smaller changes size but not capacity/We can use the 'swap trick' to reset the capacity" time="{duration}"/> + <testcase classname="<exe-name>.global" name="TemplateTest: vectors can be sized and resized - float/reserving bigger changes capacity but not size" time="{duration}"/> + <testcase classname="<exe-name>.global" name="TemplateTest: vectors can be sized and resized - float/reserving smaller does not change size or capacity" time="{duration}"/> + <testcase classname="<exe-name>.global" name="TemplateTest: vectors can be sized and resized - int" time="{duration}"/> + <testcase classname="<exe-name>.global" name="TemplateTest: vectors can be sized and resized - int/resizing bigger changes size and capacity" time="{duration}"/> + <testcase classname="<exe-name>.global" name="TemplateTest: vectors can be sized and resized - int/resizing smaller changes size but not capacity" time="{duration}"/> + <testcase classname="<exe-name>.global" name="TemplateTest: vectors can be sized and resized - int/resizing smaller changes size but not capacity/We can use the 'swap trick' to reset the capacity" time="{duration}"/> + <testcase classname="<exe-name>.global" name="TemplateTest: vectors can be sized and resized - int/reserving bigger changes capacity but not size" time="{duration}"/> + <testcase classname="<exe-name>.global" name="TemplateTest: vectors can be sized and resized - int/reserving smaller does not change size or capacity" time="{duration}"/> + <testcase classname="<exe-name>.global" name="TemplateTest: vectors can be sized and resized - std::string" time="{duration}"/> + <testcase classname="<exe-name>.global" name="TemplateTest: vectors can be sized and resized - std::string/resizing bigger changes size and capacity" time="{duration}"/> + <testcase classname="<exe-name>.global" name="TemplateTest: vectors can be sized and resized - std::string/resizing smaller changes size but not capacity" time="{duration}"/> + <testcase classname="<exe-name>.global" name="TemplateTest: vectors can be sized and resized - std::string/resizing smaller changes size but not capacity/We can use the 'swap trick' to reset the capacity" time="{duration}"/> + <testcase classname="<exe-name>.global" name="TemplateTest: vectors can be sized and resized - std::string/reserving bigger changes capacity but not size" time="{duration}"/> + <testcase classname="<exe-name>.global" name="TemplateTest: vectors can be sized and resized - std::string/reserving smaller does not change size or capacity" time="{duration}"/> + <testcase classname="<exe-name>.global" name="TemplateTest: vectors can be sized and resized - std::tuple<int,float>" time="{duration}"/> + <testcase classname="<exe-name>.global" name="TemplateTest: vectors can be sized and resized - std::tuple<int,float>/resizing bigger changes size and capacity" time="{duration}"/> + <testcase classname="<exe-name>.global" name="TemplateTest: vectors can be sized and resized - std::tuple<int,float>/resizing smaller changes size but not capacity" time="{duration}"/> + <testcase classname="<exe-name>.global" name="TemplateTest: vectors can be sized and resized - std::tuple<int,float>/resizing smaller changes size but not capacity/We can use the 'swap trick' to reset the capacity" time="{duration}"/> + <testcase classname="<exe-name>.global" name="TemplateTest: vectors can be sized and resized - std::tuple<int,float>/reserving bigger changes capacity but not size" time="{duration}"/> + <testcase classname="<exe-name>.global" name="TemplateTest: vectors can be sized and resized - std::tuple<int,float>/reserving smaller does not change size or capacity" time="{duration}"/> <testcase classname="<exe-name>.global" name="Test case with one argument" time="{duration}"/> <testcase classname="<exe-name>.global" name="Test enum bit values" time="{duration}"/> <testcase classname="<exe-name>.global" name="The NO_FAIL macro reports a failure but does not fail the test" time="{duration}"/> diff --git a/packages/Catch2/projects/SelfTest/Baselines/xml.sw.approved.txt b/packages/Catch2/projects/SelfTest/Baselines/xml.sw.approved.txt index 3428787441dc597b7b16bd01346c68079725eadc..b2d0c61e28d5b2a5c197219b01dd9d4cf5a14656 100644 --- a/packages/Catch2/projects/SelfTest/Baselines/xml.sw.approved.txt +++ b/packages/Catch2/projects/SelfTest/Baselines/xml.sw.approved.txt @@ -1,5 +1,6 @@ <?xml version="1.0" encoding="UTF-8"?> <Catch name="<exe-name>"> + <Randomness seed="1"/> <Group name="<exe-name>"> <TestCase name="# A test name that starts with a #" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" > <OverallResult success="true"/> @@ -130,6 +131,17 @@ <TestCase name="#1245" tags="[compilation]" filename="projects/<exe-name>/UsageTests/Compilation.tests.cpp" > <OverallResult success="true"/> </TestCase> + <TestCase name="#1403" tags="[compilation]" filename="projects/<exe-name>/UsageTests/Compilation.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Compilation.tests.cpp" > + <Original> + h1 == h2 + </Original> + <Expanded> + [1403 helper] == [1403 helper] + </Expanded> + </Expression> + <OverallResult success="true"/> + </TestCase> <TestCase name="#748 - captures with unexpected exceptions" tags="[!shouldfail][!throws][.][failing]" filename="projects/<exe-name>/UsageTests/Exception.tests.cpp" > <Section name="outside assertions" filename="projects/<exe-name>/UsageTests/Exception.tests.cpp" > <Info> @@ -1335,6 +1347,160 @@ </Expression> <OverallResult success="true"/> </TestCase> + <TestCase name="A TEMPLATE_PRODUCT_TEST_CASE_METHOD based test run that fails - 0" tags="[.][class][failing][product][template]" filename="projects/<exe-name>/UsageTests/Class.tests.cpp" > + <Expression success="false" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Class.tests.cpp" > + <Original> + Template_Fixture_2<TestType>::m_a.size() == 1 + </Original> + <Expanded> + 0 == 1 + </Expanded> + </Expression> + <OverallResult success="false"/> + </TestCase> + <TestCase name="A TEMPLATE_PRODUCT_TEST_CASE_METHOD based test run that fails - 1" tags="[.][class][failing][product][template]" filename="projects/<exe-name>/UsageTests/Class.tests.cpp" > + <Expression success="false" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Class.tests.cpp" > + <Original> + Template_Fixture_2<TestType>::m_a.size() == 1 + </Original> + <Expanded> + 0 == 1 + </Expanded> + </Expression> + <OverallResult success="false"/> + </TestCase> + <TestCase name="A TEMPLATE_PRODUCT_TEST_CASE_METHOD based test run that fails - 2" tags="[.][class][failing][product][template]" filename="projects/<exe-name>/UsageTests/Class.tests.cpp" > + <Expression success="false" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Class.tests.cpp" > + <Original> + Template_Fixture_2<TestType>::m_a.size() == 1 + </Original> + <Expanded> + 0 == 1 + </Expanded> + </Expression> + <OverallResult success="false"/> + </TestCase> + <TestCase name="A TEMPLATE_PRODUCT_TEST_CASE_METHOD based test run that fails - 3" tags="[.][class][failing][product][template]" filename="projects/<exe-name>/UsageTests/Class.tests.cpp" > + <Expression success="false" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Class.tests.cpp" > + <Original> + Template_Fixture_2<TestType>::m_a.size() == 1 + </Original> + <Expanded> + 0 == 1 + </Expanded> + </Expression> + <OverallResult success="false"/> + </TestCase> + <TestCase name="A TEMPLATE_PRODUCT_TEST_CASE_METHOD based test run that succeeds - 0" tags="[class][product][template]" filename="projects/<exe-name>/UsageTests/Class.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Class.tests.cpp" > + <Original> + Template_Fixture_2<TestType>::m_a.size() == 0 + </Original> + <Expanded> + 0 == 0 + </Expanded> + </Expression> + <OverallResult success="true"/> + </TestCase> + <TestCase name="A TEMPLATE_PRODUCT_TEST_CASE_METHOD based test run that succeeds - 1" tags="[class][product][template]" filename="projects/<exe-name>/UsageTests/Class.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Class.tests.cpp" > + <Original> + Template_Fixture_2<TestType>::m_a.size() == 0 + </Original> + <Expanded> + 0 == 0 + </Expanded> + </Expression> + <OverallResult success="true"/> + </TestCase> + <TestCase name="A TEMPLATE_PRODUCT_TEST_CASE_METHOD based test run that succeeds - 2" tags="[class][product][template]" filename="projects/<exe-name>/UsageTests/Class.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Class.tests.cpp" > + <Original> + Template_Fixture_2<TestType>::m_a.size() == 0 + </Original> + <Expanded> + 0 == 0 + </Expanded> + </Expression> + <OverallResult success="true"/> + </TestCase> + <TestCase name="A TEMPLATE_PRODUCT_TEST_CASE_METHOD based test run that succeeds - 3" tags="[class][product][template]" filename="projects/<exe-name>/UsageTests/Class.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Class.tests.cpp" > + <Original> + Template_Fixture_2<TestType>::m_a.size() == 0 + </Original> + <Expanded> + 0 == 0 + </Expanded> + </Expression> + <OverallResult success="true"/> + </TestCase> + <TestCase name="A TEMPLATE_TEST_CASE_METHOD based test run that fails - double" tags="[.][class][failing][template]" filename="projects/<exe-name>/UsageTests/Class.tests.cpp" > + <Expression success="false" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Class.tests.cpp" > + <Original> + Template_Fixture<TestType>::m_a == 2 + </Original> + <Expanded> + 1.0 == 2 + </Expanded> + </Expression> + <OverallResult success="false"/> + </TestCase> + <TestCase name="A TEMPLATE_TEST_CASE_METHOD based test run that fails - float" tags="[.][class][failing][template]" filename="projects/<exe-name>/UsageTests/Class.tests.cpp" > + <Expression success="false" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Class.tests.cpp" > + <Original> + Template_Fixture<TestType>::m_a == 2 + </Original> + <Expanded> + 1.0f == 2 + </Expanded> + </Expression> + <OverallResult success="false"/> + </TestCase> + <TestCase name="A TEMPLATE_TEST_CASE_METHOD based test run that fails - int" tags="[.][class][failing][template]" filename="projects/<exe-name>/UsageTests/Class.tests.cpp" > + <Expression success="false" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Class.tests.cpp" > + <Original> + Template_Fixture<TestType>::m_a == 2 + </Original> + <Expanded> + 1 == 2 + </Expanded> + </Expression> + <OverallResult success="false"/> + </TestCase> + <TestCase name="A TEMPLATE_TEST_CASE_METHOD based test run that succeeds - double" tags="[class][template]" filename="projects/<exe-name>/UsageTests/Class.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Class.tests.cpp" > + <Original> + Template_Fixture<TestType>::m_a == 1 + </Original> + <Expanded> + 1.0 == 1 + </Expanded> + </Expression> + <OverallResult success="true"/> + </TestCase> + <TestCase name="A TEMPLATE_TEST_CASE_METHOD based test run that succeeds - float" tags="[class][template]" filename="projects/<exe-name>/UsageTests/Class.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Class.tests.cpp" > + <Original> + Template_Fixture<TestType>::m_a == 1 + </Original> + <Expanded> + 1.0f == 1 + </Expanded> + </Expression> + <OverallResult success="true"/> + </TestCase> + <TestCase name="A TEMPLATE_TEST_CASE_METHOD based test run that succeeds - int" tags="[class][template]" filename="projects/<exe-name>/UsageTests/Class.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Class.tests.cpp" > + <Original> + Template_Fixture<TestType>::m_a == 1 + </Original> + <Expanded> + 1 == 1 + </Expanded> + </Expression> + <OverallResult success="true"/> + </TestCase> <TestCase name="A TEST_CASE_METHOD based test run that fails" tags="[.][class][failing]" filename="projects/<exe-name>/UsageTests/Class.tests.cpp" > <Expression success="false" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Class.tests.cpp" > <Original> @@ -1357,6 +1523,50 @@ </Expression> <OverallResult success="true"/> </TestCase> + <TestCase name="A Template product test case - 0" tags="[product][template]" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" > + <Original> + x.size() == 0 + </Original> + <Expanded> + 0 == 0 + </Expanded> + </Expression> + <OverallResult success="true"/> + </TestCase> + <TestCase name="A Template product test case - 1" tags="[product][template]" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" > + <Original> + x.size() == 0 + </Original> + <Expanded> + 0 == 0 + </Expanded> + </Expression> + <OverallResult success="true"/> + </TestCase> + <TestCase name="A Template product test case - 2" tags="[product][template]" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" > + <Original> + x.size() == 0 + </Original> + <Expanded> + 0 == 0 + </Expanded> + </Expression> + <OverallResult success="true"/> + </TestCase> + <TestCase name="A Template product test case - 3" tags="[product][template]" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" > + <Original> + x.size() == 0 + </Original> + <Expanded> + 0 == 0 + </Expanded> + </Expression> + <OverallResult success="true"/> + </TestCase> <TestCase name="A comparison that uses literals instead of the normal constructor" tags="[Approx]" filename="projects/<exe-name>/UsageTests/Approx.tests.cpp" > <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Approx.tests.cpp" > <Original> @@ -1908,6 +2118,54 @@ </Expression> <OverallResult success="true"/> </TestCase> + <TestCase name="CAPTURE can deal with complex expressions" tags="[capture][messages]" filename="projects/<exe-name>/UsageTests/Message.tests.cpp" > + <Info> + a := 1 + </Info> + <Info> + b := 2 + </Info> + <Info> + c := 3 + </Info> + <Info> + a + b := 3 + </Info> + <Info> + a+b := 3 + </Info> + <Info> + c > b := true + </Info> + <Info> + a == 1 := true + </Info> + <OverallResult success="true"/> + </TestCase> + <TestCase name="CAPTURE can deal with complex expressions involving commas" tags="[capture][messages]" filename="projects/<exe-name>/UsageTests/Message.tests.cpp" > + <Info> + std::vector<int>{1, 2, 3}[0, 1, 2] := 3 + </Info> + <Info> + std::vector<int>{1, 2, 3}[(0, 1)] := 2 + </Info> + <Info> + std::vector<int>{1, 2, 3}[0] := 1 + </Info> + <Info> + (helper_1436<int, int>{12, -12}) := { 12, -12 } + </Info> + <Info> + (helper_1436<int, int>(-12, 12)) := { -12, 12 } + </Info> + <Info> + (1, 2) := 2 + </Info> + <Info> + (2, 3) := 3 + </Info> + <OverallResult success="true"/> + </TestCase> <TestCase name="Capture and info messages" filename="projects/<exe-name>/UsageTests/ToStringGeneral.tests.cpp" > <Section name="Capture should stringify like assertions" filename="projects/<exe-name>/UsageTests/ToStringGeneral.tests.cpp" > <Info> @@ -4397,6 +4655,9 @@ </Expression> <OverallResult success="true"/> </TestCase> + <TestCase name="Optionally static assertions" tags="[compilation]" filename="projects/<exe-name>/UsageTests/Compilation.tests.cpp" > + <OverallResult success="true"/> + </TestCase> <TestCase name="Ordering comparison checks that should fail" tags="[.][failing]" filename="projects/<exe-name>/UsageTests/Condition.tests.cpp" > <Expression success="false" type="CHECK" filename="projects/<exe-name>/UsageTests/Condition.tests.cpp" > <Original> @@ -5949,6 +6210,17 @@ </Expression> <OverallResult success="true"/> </TestCase> + <TestCase name="Predicate matcher can accept const char*" tags="[compilation][matchers]" filename="projects/<exe-name>/UsageTests/Matchers.tests.cpp" > + <Expression success="true" type="REQUIRE_THAT" filename="projects/<exe-name>/UsageTests/Matchers.tests.cpp" > + <Original> + "foo", Predicate<const char*>([] (const char* const&) { return true; }) + </Original> + <Expanded> + "foo" matches undescribed predicate + </Expanded> + </Expression> + <OverallResult success="true"/> + </TestCase> <TestCase name="Process can be configured on command line" tags="[command-line][config]" filename="projects/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > <Section name="empty args don't cause a crash" filename="projects/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > <Expression success="true" type="CHECK" filename="projects/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > @@ -6222,6 +6494,28 @@ </Section> <OverallResults successes="1" failures="0" expectedFailures="0"/> </Section> + <Section name="reporter" filename="projects/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Section name="must match one of the available ones" filename="projects/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Expression success="true" type="CHECK" filename="projects/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Original> + !result + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE_THAT" filename="projects/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Original> + result.errorMessage(), Contains("Unrecognized reporter") + </Original> + <Expanded> + "Unrecognized reporter, 'unsupported'. Check available with --list-reporters" contains: "Unrecognized reporter" + </Expanded> + </Expression> + <OverallResults successes="2" failures="0" expectedFailures="0"/> + </Section> + <OverallResults successes="2" failures="0" expectedFailures="0"/> + </Section> <Section name="debugger" filename="projects/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > <Section name="-b" filename="projects/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > <Expression success="true" type="CHECK" filename="projects/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > @@ -6570,6 +6864,39 @@ </Section> <OverallResult success="true"/> </TestCase> + <TestCase name="Product with differing arities - 0" tags="[product][template]" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" > + <Original> + std::tuple_size<TestType>::value >= 1 + </Original> + <Expanded> + 1 >= 1 + </Expanded> + </Expression> + <OverallResult success="true"/> + </TestCase> + <TestCase name="Product with differing arities - 1" tags="[product][template]" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" > + <Original> + std::tuple_size<TestType>::value >= 1 + </Original> + <Expanded> + 2 >= 1 + </Expanded> + </Expression> + <OverallResult success="true"/> + </TestCase> + <TestCase name="Product with differing arities - 2" tags="[product][template]" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" > + <Original> + std::tuple_size<TestType>::value >= 1 + </Original> + <Expanded> + 3 >= 1 + </Expanded> + </Expression> + <OverallResult success="true"/> + </TestCase> <TestCase name="Reconstruction should be based on stringification: #914" tags="[.][Decomposition][failing]" filename="projects/<exe-name>/UsageTests/Decomposition.tests.cpp" > <Expression success="false" type="CHECK" filename="projects/<exe-name>/UsageTests/Decomposition.tests.cpp" > <Original> @@ -7643,6 +7970,622 @@ Message from section two </Section> <OverallResult success="true"/> </TestCase> + <TestCase name="TemplateTest: vectors can be sized and resized - float" tags="[template][vector]" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" > + <Original> + v.size() == 5 + </Original> + <Expanded> + 5 == 5 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" > + <Original> + v.capacity() >= 5 + </Original> + <Expanded> + 5 >= 5 + </Expanded> + </Expression> + <Section name="resizing bigger changes size and capacity" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" > + <Original> + v.size() == 10 + </Original> + <Expanded> + 10 == 10 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" > + <Original> + v.capacity() >= 10 + </Original> + <Expanded> + 10 >= 10 + </Expanded> + </Expression> + <OverallResults successes="2" failures="0" expectedFailures="0"/> + </Section> + <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" > + <Original> + v.size() == 5 + </Original> + <Expanded> + 5 == 5 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" > + <Original> + v.capacity() >= 5 + </Original> + <Expanded> + 5 >= 5 + </Expanded> + </Expression> + <Section name="resizing smaller changes size but not capacity" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" > + <Original> + v.size() == 0 + </Original> + <Expanded> + 0 == 0 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" > + <Original> + v.capacity() >= 5 + </Original> + <Expanded> + 5 >= 5 + </Expanded> + </Expression> + <Section name="We can use the 'swap trick' to reset the capacity" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" > + <Original> + v.capacity() == 0 + </Original> + <Expanded> + 0 == 0 + </Expanded> + </Expression> + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> + <OverallResults successes="3" failures="0" expectedFailures="0"/> + </Section> + <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" > + <Original> + v.size() == 5 + </Original> + <Expanded> + 5 == 5 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" > + <Original> + v.capacity() >= 5 + </Original> + <Expanded> + 5 >= 5 + </Expanded> + </Expression> + <Section name="reserving bigger changes capacity but not size" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" > + <Original> + v.size() == 5 + </Original> + <Expanded> + 5 == 5 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" > + <Original> + v.capacity() >= 10 + </Original> + <Expanded> + 10 >= 10 + </Expanded> + </Expression> + <OverallResults successes="2" failures="0" expectedFailures="0"/> + </Section> + <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" > + <Original> + v.size() == 5 + </Original> + <Expanded> + 5 == 5 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" > + <Original> + v.capacity() >= 5 + </Original> + <Expanded> + 5 >= 5 + </Expanded> + </Expression> + <Section name="reserving smaller does not change size or capacity" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" > + <Original> + v.size() == 5 + </Original> + <Expanded> + 5 == 5 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" > + <Original> + v.capacity() >= 5 + </Original> + <Expanded> + 5 >= 5 + </Expanded> + </Expression> + <OverallResults successes="2" failures="0" expectedFailures="0"/> + </Section> + <OverallResult success="true"/> + </TestCase> + <TestCase name="TemplateTest: vectors can be sized and resized - int" tags="[template][vector]" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" > + <Original> + v.size() == 5 + </Original> + <Expanded> + 5 == 5 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" > + <Original> + v.capacity() >= 5 + </Original> + <Expanded> + 5 >= 5 + </Expanded> + </Expression> + <Section name="resizing bigger changes size and capacity" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" > + <Original> + v.size() == 10 + </Original> + <Expanded> + 10 == 10 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" > + <Original> + v.capacity() >= 10 + </Original> + <Expanded> + 10 >= 10 + </Expanded> + </Expression> + <OverallResults successes="2" failures="0" expectedFailures="0"/> + </Section> + <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" > + <Original> + v.size() == 5 + </Original> + <Expanded> + 5 == 5 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" > + <Original> + v.capacity() >= 5 + </Original> + <Expanded> + 5 >= 5 + </Expanded> + </Expression> + <Section name="resizing smaller changes size but not capacity" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" > + <Original> + v.size() == 0 + </Original> + <Expanded> + 0 == 0 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" > + <Original> + v.capacity() >= 5 + </Original> + <Expanded> + 5 >= 5 + </Expanded> + </Expression> + <Section name="We can use the 'swap trick' to reset the capacity" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" > + <Original> + v.capacity() == 0 + </Original> + <Expanded> + 0 == 0 + </Expanded> + </Expression> + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> + <OverallResults successes="3" failures="0" expectedFailures="0"/> + </Section> + <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" > + <Original> + v.size() == 5 + </Original> + <Expanded> + 5 == 5 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" > + <Original> + v.capacity() >= 5 + </Original> + <Expanded> + 5 >= 5 + </Expanded> + </Expression> + <Section name="reserving bigger changes capacity but not size" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" > + <Original> + v.size() == 5 + </Original> + <Expanded> + 5 == 5 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" > + <Original> + v.capacity() >= 10 + </Original> + <Expanded> + 10 >= 10 + </Expanded> + </Expression> + <OverallResults successes="2" failures="0" expectedFailures="0"/> + </Section> + <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" > + <Original> + v.size() == 5 + </Original> + <Expanded> + 5 == 5 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" > + <Original> + v.capacity() >= 5 + </Original> + <Expanded> + 5 >= 5 + </Expanded> + </Expression> + <Section name="reserving smaller does not change size or capacity" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" > + <Original> + v.size() == 5 + </Original> + <Expanded> + 5 == 5 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" > + <Original> + v.capacity() >= 5 + </Original> + <Expanded> + 5 >= 5 + </Expanded> + </Expression> + <OverallResults successes="2" failures="0" expectedFailures="0"/> + </Section> + <OverallResult success="true"/> + </TestCase> + <TestCase name="TemplateTest: vectors can be sized and resized - std::string" tags="[template][vector]" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" > + <Original> + v.size() == 5 + </Original> + <Expanded> + 5 == 5 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" > + <Original> + v.capacity() >= 5 + </Original> + <Expanded> + 5 >= 5 + </Expanded> + </Expression> + <Section name="resizing bigger changes size and capacity" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" > + <Original> + v.size() == 10 + </Original> + <Expanded> + 10 == 10 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" > + <Original> + v.capacity() >= 10 + </Original> + <Expanded> + 10 >= 10 + </Expanded> + </Expression> + <OverallResults successes="2" failures="0" expectedFailures="0"/> + </Section> + <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" > + <Original> + v.size() == 5 + </Original> + <Expanded> + 5 == 5 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" > + <Original> + v.capacity() >= 5 + </Original> + <Expanded> + 5 >= 5 + </Expanded> + </Expression> + <Section name="resizing smaller changes size but not capacity" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" > + <Original> + v.size() == 0 + </Original> + <Expanded> + 0 == 0 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" > + <Original> + v.capacity() >= 5 + </Original> + <Expanded> + 5 >= 5 + </Expanded> + </Expression> + <Section name="We can use the 'swap trick' to reset the capacity" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" > + <Original> + v.capacity() == 0 + </Original> + <Expanded> + 0 == 0 + </Expanded> + </Expression> + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> + <OverallResults successes="3" failures="0" expectedFailures="0"/> + </Section> + <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" > + <Original> + v.size() == 5 + </Original> + <Expanded> + 5 == 5 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" > + <Original> + v.capacity() >= 5 + </Original> + <Expanded> + 5 >= 5 + </Expanded> + </Expression> + <Section name="reserving bigger changes capacity but not size" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" > + <Original> + v.size() == 5 + </Original> + <Expanded> + 5 == 5 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" > + <Original> + v.capacity() >= 10 + </Original> + <Expanded> + 10 >= 10 + </Expanded> + </Expression> + <OverallResults successes="2" failures="0" expectedFailures="0"/> + </Section> + <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" > + <Original> + v.size() == 5 + </Original> + <Expanded> + 5 == 5 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" > + <Original> + v.capacity() >= 5 + </Original> + <Expanded> + 5 >= 5 + </Expanded> + </Expression> + <Section name="reserving smaller does not change size or capacity" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" > + <Original> + v.size() == 5 + </Original> + <Expanded> + 5 == 5 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" > + <Original> + v.capacity() >= 5 + </Original> + <Expanded> + 5 >= 5 + </Expanded> + </Expression> + <OverallResults successes="2" failures="0" expectedFailures="0"/> + </Section> + <OverallResult success="true"/> + </TestCase> + <TestCase name="TemplateTest: vectors can be sized and resized - std::tuple<int,float>" tags="[template][vector]" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" > + <Original> + v.size() == 5 + </Original> + <Expanded> + 5 == 5 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" > + <Original> + v.capacity() >= 5 + </Original> + <Expanded> + 5 >= 5 + </Expanded> + </Expression> + <Section name="resizing bigger changes size and capacity" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" > + <Original> + v.size() == 10 + </Original> + <Expanded> + 10 == 10 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" > + <Original> + v.capacity() >= 10 + </Original> + <Expanded> + 10 >= 10 + </Expanded> + </Expression> + <OverallResults successes="2" failures="0" expectedFailures="0"/> + </Section> + <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" > + <Original> + v.size() == 5 + </Original> + <Expanded> + 5 == 5 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" > + <Original> + v.capacity() >= 5 + </Original> + <Expanded> + 5 >= 5 + </Expanded> + </Expression> + <Section name="resizing smaller changes size but not capacity" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" > + <Original> + v.size() == 0 + </Original> + <Expanded> + 0 == 0 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" > + <Original> + v.capacity() >= 5 + </Original> + <Expanded> + 5 >= 5 + </Expanded> + </Expression> + <Section name="We can use the 'swap trick' to reset the capacity" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" > + <Original> + v.capacity() == 0 + </Original> + <Expanded> + 0 == 0 + </Expanded> + </Expression> + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> + <OverallResults successes="3" failures="0" expectedFailures="0"/> + </Section> + <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" > + <Original> + v.size() == 5 + </Original> + <Expanded> + 5 == 5 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" > + <Original> + v.capacity() >= 5 + </Original> + <Expanded> + 5 >= 5 + </Expanded> + </Expression> + <Section name="reserving bigger changes capacity but not size" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" > + <Original> + v.size() == 5 + </Original> + <Expanded> + 5 == 5 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" > + <Original> + v.capacity() >= 10 + </Original> + <Expanded> + 10 >= 10 + </Expanded> + </Expression> + <OverallResults successes="2" failures="0" expectedFailures="0"/> + </Section> + <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" > + <Original> + v.size() == 5 + </Original> + <Expanded> + 5 == 5 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" > + <Original> + v.capacity() >= 5 + </Original> + <Expanded> + 5 >= 5 + </Expanded> + </Expression> + <Section name="reserving smaller does not change size or capacity" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" > + <Original> + v.size() == 5 + </Original> + <Expanded> + 5 == 5 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" > + <Original> + v.capacity() >= 5 + </Original> + <Expanded> + 5 >= 5 + </Expanded> + </Expression> + <OverallResults successes="2" failures="0" expectedFailures="0"/> + </Section> + <OverallResult success="true"/> + </TestCase> <TestCase name="Test case with one argument" filename="projects/<exe-name>/UsageTests/VariadicMacros.tests.cpp" > <OverallResult success="true"/> </TestCase> @@ -11321,7 +12264,7 @@ loose text artifact </Section> <OverallResult success="true"/> </TestCase> - <OverallResults successes="1099" failures="123" expectedFailures="21"/> + <OverallResults successes="1189" failures="130" expectedFailures="21"/> </Group> - <OverallResults successes="1099" failures="122" expectedFailures="21"/> + <OverallResults successes="1189" failures="129" expectedFailures="21"/> </Catch> diff --git a/packages/Catch2/projects/SelfTest/IntrospectiveTests/CmdLine.tests.cpp b/packages/Catch2/projects/SelfTest/IntrospectiveTests/CmdLine.tests.cpp index cb635eade97a2ffab998cbcf059081b3e665469e..9b5b0ed7c89985fd1aa3d44e6c9dc3f00dc55531 100644 --- a/packages/Catch2/projects/SelfTest/IntrospectiveTests/CmdLine.tests.cpp +++ b/packages/Catch2/projects/SelfTest/IntrospectiveTests/CmdLine.tests.cpp @@ -280,7 +280,6 @@ TEST_CASE( "Process can be configured on command line", "[config][command-line]" CHECK(config.processName == ""); } - SECTION("default - no arguments") { auto result = cli.parse({"test"}); CHECK(result); @@ -345,8 +344,15 @@ TEST_CASE( "Process can be configured on command line", "[config][command-line]" SECTION("Only one reporter is accepted") { REQUIRE_FALSE(cli.parse({ "test", "-r", "xml", "-r", "junit" })); } - } + SECTION("must match one of the available ones") { + auto result = cli.parse({"test", "--reporter", "unsupported"}); + CHECK(!result); +#ifndef CATCH_CONFIG_DISABLE_MATCHERS + REQUIRE_THAT(result.errorMessage(), Contains("Unrecognized reporter")); +#endif + } + } SECTION("debugger") { SECTION("-b") { diff --git a/packages/Catch2/projects/SelfTest/UsageTests/Class.tests.cpp b/packages/Catch2/projects/SelfTest/UsageTests/Class.tests.cpp index c19a5172cf0a1335b929b06aa32d5f2fa277d856..3bde1d82ab66e18a5825270e24e105df558210d3 100644 --- a/packages/Catch2/projects/SelfTest/UsageTests/Class.tests.cpp +++ b/packages/Catch2/projects/SelfTest/UsageTests/Class.tests.cpp @@ -39,6 +39,25 @@ struct Fixture int m_a; }; +template< typename T > +struct Template_Fixture { + Template_Fixture(): m_a(1) {} + + T m_a; +}; + +template<typename T> +struct Template_Fixture_2 { + Template_Fixture_2() {} + + T m_a; +}; + +template< typename T> +struct Template_Foo { + size_t size() { return 0; } +}; + #endif @@ -51,6 +70,15 @@ TEST_CASE_METHOD( Fixture, "A TEST_CASE_METHOD based test run that succeeds", "[ REQUIRE( m_a == 1 ); } +TEMPLATE_TEST_CASE_METHOD(Template_Fixture, "A TEMPLATE_TEST_CASE_METHOD based test run that succeeds", "[class][template]", int, float, double) { + REQUIRE( Template_Fixture<TestType>::m_a == 1 ); +} + +TEMPLATE_PRODUCT_TEST_CASE_METHOD(Template_Fixture_2, "A TEMPLATE_PRODUCT_TEST_CASE_METHOD based test run that succeeds","[class][template][product]",(std::vector,Template_Foo),(int,float)) +{ + REQUIRE( Template_Fixture_2<TestType>::m_a.size() == 0 ); +} + // We should be able to write our tests within a different namespace namespace Inner { @@ -58,6 +86,18 @@ namespace Inner { REQUIRE( m_a == 2 ); } + + TEMPLATE_TEST_CASE_METHOD(Template_Fixture,"A TEMPLATE_TEST_CASE_METHOD based test run that fails", "[.][class][template][failing]", int, float, double) + { + REQUIRE( Template_Fixture<TestType>::m_a == 2 ); + } + + TEMPLATE_PRODUCT_TEST_CASE_METHOD(Template_Fixture_2, "A TEMPLATE_PRODUCT_TEST_CASE_METHOD based test run that fails","[.][class][template][product][failing]",(std::vector,Template_Foo),(int,float)) + { + REQUIRE( Template_Fixture_2<TestType>::m_a.size() == 1 ); + } } + + }} // namespace ClassTests diff --git a/packages/Catch2/projects/SelfTest/UsageTests/Compilation.tests.cpp b/packages/Catch2/projects/SelfTest/UsageTests/Compilation.tests.cpp index 2e518ef2053563699bc53b20de84df5a25b890a8..325a81427ef50c7972f0addc4ee163f5648b3dbc 100644 --- a/packages/Catch2/projects/SelfTest/UsageTests/Compilation.tests.cpp +++ b/packages/Catch2/projects/SelfTest/UsageTests/Compilation.tests.cpp @@ -5,6 +5,26 @@ * file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) */ +#include <type_traits> + +// Setup for #1403 -- look for global overloads of operator << for classes +// in a different namespace. +#include <ostream> + +namespace foo { + struct helper_1403 { + bool operator==(helper_1403) const { return true; } + }; +} + +#ifdef __GNUC__ +#pragma GCC diagnostic ignored "-Wmissing-declarations" +#endif +std::ostream& operator<<(std::ostream& out, foo::helper_1403 const&) { + return out << "[1403 helper]"; +} +/////////////////////////////// + #include "catch.hpp" #include <cstring> @@ -154,4 +174,16 @@ namespace { namespace CompilationTests { SUCCEED(); } + TEST_CASE("#1403", "[compilation]") { + ::foo::helper_1403 h1, h2; + REQUIRE(h1 == h2); + } + + TEST_CASE("Optionally static assertions", "[compilation]") { + STATIC_REQUIRE( std::is_void<void>::value ); + STATIC_REQUIRE_FALSE( std::is_void<int>::value ); + } + }} // namespace CompilationTests + + diff --git a/packages/Catch2/projects/SelfTest/UsageTests/Matchers.tests.cpp b/packages/Catch2/projects/SelfTest/UsageTests/Matchers.tests.cpp index e09dad14e3cf18dad3e035438cfd70c6d1869a18..f07481d46d3e7b55cf892a47dac0a8aee0f1ebd2 100644 --- a/packages/Catch2/projects/SelfTest/UsageTests/Matchers.tests.cpp +++ b/packages/Catch2/projects/SelfTest/UsageTests/Matchers.tests.cpp @@ -432,6 +432,10 @@ namespace { namespace MatchersTests { CHECK_THAT(actual, !UnorderedEquals(expected)); } + TEST_CASE("Predicate matcher can accept const char*", "[matchers][compilation]") { + REQUIRE_THAT("foo", Predicate<const char*>([] (const char* const&) { return true; })); + } + } } // namespace MatchersTests #endif // CATCH_CONFIG_DISABLE_MATCHERS diff --git a/packages/Catch2/projects/SelfTest/UsageTests/Message.tests.cpp b/packages/Catch2/projects/SelfTest/UsageTests/Message.tests.cpp index f3ac02a1fa641d2642960957fd79d0503a4a3413..002fb875ae1504e8eb5dd92594b484a7df742544 100644 --- a/packages/Catch2/projects/SelfTest/UsageTests/Message.tests.cpp +++ b/packages/Catch2/projects/SelfTest/UsageTests/Message.tests.cpp @@ -9,10 +9,6 @@ #include "catch.hpp" #include <iostream> -#ifdef __clang__ -#pragma clang diagnostic ignored "-Wc++98-compat-pedantic" -#endif - TEST_CASE( "INFO and WARN do not abort tests", "[messages][.]" ) { INFO( "this is a " << "message" ); // This should output the message if a failure occurs WARN( "this is a " << "warning" ); // This should always output the message but then continue @@ -135,3 +131,60 @@ TEST_CASE( "Pointers can be converted to strings", "[messages][.][approvals]" ) WARN( "actual address of p: " << &p ); WARN( "toString(p): " << ::Catch::Detail::stringify( &p ) ); } + +TEST_CASE( "CAPTURE can deal with complex expressions", "[messages][capture]" ) { + int a = 1; + int b = 2; + int c = 3; + CAPTURE( a, b, c, a + b, a+b, c > b, a == 1 ); + SUCCEED(); +} + +#ifdef __clang__ +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wunused-value" // In (1, 2), the "1" is unused ... +#endif +#ifdef __GNUC__ +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wunused-value" // All the comma operators are side-effect free +#endif +#ifdef _MSC_VER +#pragma warning(push) +#pragma warning(disable:4709) // comma in indexing operator +#endif + +template <typename T1, typename T2> +struct helper_1436 { + helper_1436(T1 t1, T2 t2): + t1{ t1 }, + t2{ t2 } + {} + T1 t1; + T2 t2; +}; + +template <typename T1, typename T2> +std::ostream& operator<<(std::ostream& out, helper_1436<T1, T2> const& helper) { + out << "{ " << helper.t1 << ", " << helper.t2 << " }"; + return out; +} + +TEST_CASE("CAPTURE can deal with complex expressions involving commas", "[messages][capture]") { + CAPTURE(std::vector<int>{1, 2, 3}[0, 1, 2], + std::vector<int>{1, 2, 3}[(0, 1)], + std::vector<int>{1, 2, 3}[0]); + CAPTURE((helper_1436<int, int>{12, -12}), + (helper_1436<int, int>(-12, 12))); + CAPTURE( (1, 2), (2, 3) ); + SUCCEED(); +} + +#ifdef __clang__ +#pragma clang diagnostic pop +#endif +#ifdef __GNUC__ +#pragma GCC diagnostic pop +#endif +#ifdef _MSC_VER +#pragma warning(pop) +#endif diff --git a/packages/Catch2/projects/SelfTest/UsageTests/Misc.tests.cpp b/packages/Catch2/projects/SelfTest/UsageTests/Misc.tests.cpp index 820e801976939b609815849dc46bf8b8f72fec78..4de6f1aa0df3d84ec5df25e2c131778fea192a4b 100644 --- a/packages/Catch2/projects/SelfTest/UsageTests/Misc.tests.cpp +++ b/packages/Catch2/projects/SelfTest/UsageTests/Misc.tests.cpp @@ -61,6 +61,11 @@ CATCH_INTERNAL_SUPPRESS_GLOBALS_WARNINGS static AutoTestReg autoTestReg; CATCH_INTERNAL_UNSUPPRESS_GLOBALS_WARNINGS +template<typename T> +struct Foo { + size_t size() { return 0; } +}; + #endif TEST_CASE( "random SECTION tests", "[.][sections][failing]" ) { @@ -261,6 +266,55 @@ TEST_CASE( "vectors can be sized and resized", "[vector]" ) { } } +TEMPLATE_TEST_CASE( "TemplateTest: vectors can be sized and resized", "[vector][template]", int, float, std::string, (std::tuple<int,float>) ) { + + std::vector<TestType> v( 5 ); + + REQUIRE( v.size() == 5 ); + REQUIRE( v.capacity() >= 5 ); + + SECTION( "resizing bigger changes size and capacity" ) { + v.resize( 10 ); + + REQUIRE( v.size() == 10 ); + REQUIRE( v.capacity() >= 10 ); + } + SECTION( "resizing smaller changes size but not capacity" ) { + v.resize( 0 ); + + REQUIRE( v.size() == 0 ); + REQUIRE( v.capacity() >= 5 ); + + SECTION( "We can use the 'swap trick' to reset the capacity" ) { + std::vector<TestType> empty; + empty.swap( v ); + + REQUIRE( v.capacity() == 0 ); + } + } + SECTION( "reserving bigger changes capacity but not size" ) { + v.reserve( 10 ); + + REQUIRE( v.size() == 5 ); + REQUIRE( v.capacity() >= 10 ); + } + SECTION( "reserving smaller does not change size or capacity" ) { + v.reserve( 0 ); + + REQUIRE( v.size() == 5 ); + REQUIRE( v.capacity() >= 5 ); + } +} + +TEMPLATE_PRODUCT_TEST_CASE("A Template product test case", "[template][product]", (std::vector, Foo), (int, float)) { + TestType x; + REQUIRE(x.size() == 0); +} + +TEMPLATE_PRODUCT_TEST_CASE("Product with differing arities", "[template][product]", std::tuple, (int, (int, double), (int, double, float))) { + REQUIRE(std::tuple_size<TestType>::value >= 1); +} + // https://github.com/philsquared/Catch/issues/166 TEST_CASE("A couple of nested sections followed by a failure", "[failing][.]") { SECTION("Outer") diff --git a/packages/Catch2/scripts/approvalTests.py b/packages/Catch2/scripts/approvalTests.py index e2b0ce937732302a550b5780636925d4e196e44e..bb01e6d57063a8e0f04a668d2799d8ea32f8ab25 100755 --- a/packages/Catch2/scripts/approvalTests.py +++ b/packages/Catch2/scripts/approvalTests.py @@ -18,7 +18,7 @@ if os.name == 'nt': rootPath = os.path.join(catchPath, 'projects/SelfTest/Baselines') - +langFilenameParser = re.compile(r'(.+\.[ch]pp)') filelocParser = re.compile(r''' .*/ (.+\.[ch]pp) # filename @@ -91,12 +91,24 @@ def diffFiles(fileA, fileB): return [line for line in diff if line[0] in ('+', '-')] -def filterLine(line, isCompact): +def normalizeFilepath(line): if catchPath in line: # make paths relative to Catch root line = line.replace(catchPath + os.sep, '') + + m = langFilenameParser.match(line) + if m: + filepath = m.group(0) # go from \ in windows paths to / - line = line.replace('\\', '/') + filepath = filepath.replace('\\', '/') + # remove start of relative path + filepath = filepath.replace('../', '') + line = line[:m.start()] + filepath + line[m.end():] + + return line + +def filterLine(line, isCompact): + line = normalizeFilepath(line) # strip source line numbers m = filelocParser.match(line) @@ -181,17 +193,17 @@ print(" " + cmdPath) # ## Keep default reporters here ## # Standard console reporter -approve("console.std", ["~[!nonportable]~[!benchmark]~[approvals]", "--order", "lex", "--rng-seed", "0"]) +approve("console.std", ["~[!nonportable]~[!benchmark]~[approvals]", "--order", "lex", "--rng-seed", "1"]) # console reporter, include passes, warn about No Assertions -approve("console.sw", ["~[!nonportable]~[!benchmark]~[approvals]", "-s", "-w", "NoAssertions", "--order", "lex", "--rng-seed", "0"]) +approve("console.sw", ["~[!nonportable]~[!benchmark]~[approvals]", "-s", "-w", "NoAssertions", "--order", "lex", "--rng-seed", "1"]) # console reporter, include passes, warn about No Assertions, limit failures to first 4 -approve("console.swa4", ["~[!nonportable]~[!benchmark]~[approvals]", "-s", "-w", "NoAssertions", "-x", "4", "--order", "lex", "--rng-seed", "0"]) +approve("console.swa4", ["~[!nonportable]~[!benchmark]~[approvals]", "-s", "-w", "NoAssertions", "-x", "4", "--order", "lex", "--rng-seed", "1"]) # junit reporter, include passes, warn about No Assertions -approve("junit.sw", ["~[!nonportable]~[!benchmark]~[approvals]", "-s", "-w", "NoAssertions", "-r", "junit", "--order", "lex", "--rng-seed", "0"]) +approve("junit.sw", ["~[!nonportable]~[!benchmark]~[approvals]", "-s", "-w", "NoAssertions", "-r", "junit", "--order", "lex", "--rng-seed", "1"]) # xml reporter, include passes, warn about No Assertions -approve("xml.sw", ["~[!nonportable]~[!benchmark]~[approvals]", "-s", "-w", "NoAssertions", "-r", "xml", "--order", "lex", "--rng-seed", "0"]) +approve("xml.sw", ["~[!nonportable]~[!benchmark]~[approvals]", "-s", "-w", "NoAssertions", "-r", "xml", "--order", "lex", "--rng-seed", "1"]) # compact reporter, include passes, warn about No Assertions -approve('compact.sw', ['~[!nonportable]~[!benchmark]~[approvals]', '-s', '-w', 'NoAssertions', '-r', 'compact', '--order', 'lex', "--rng-seed", "0"]) +approve('compact.sw', ['~[!nonportable]~[!benchmark]~[approvals]', '-s', '-w', 'NoAssertions', '-r', 'compact', '--order', 'lex', "--rng-seed", "1"]) if overallResult != 0: print("If these differences are expected, run approve.py to approve new baselines.") diff --git a/packages/Catch2/scripts/releaseCommon.py b/packages/Catch2/scripts/releaseCommon.py index 1a8ee2c87e1a66a12968c085cea73e2c4e13262b..9cdc4f6c12eb4a29ffb6a84be5dcb82493029fdb 100644 --- a/packages/Catch2/scripts/releaseCommon.py +++ b/packages/Catch2/scripts/releaseCommon.py @@ -12,8 +12,6 @@ rootPath = os.path.join( catchPath, 'include/' ) versionPath = os.path.join( rootPath, "internal/catch_version.cpp" ) definePath = os.path.join(rootPath, 'catch.hpp') readmePath = os.path.join( catchPath, "README.md" ) -conanPath = os.path.join(catchPath, 'conanfile.py') -conanTestPath = os.path.join(catchPath, 'test_package', 'conanfile.py') cmakePath = os.path.join(catchPath, 'CMakeLists.txt') class Version: @@ -98,35 +96,6 @@ def updateReadmeFile(version): line = '[]({0})'.format(wandboxLink) f.write( line + "\n" ) -def updateConanFile(version): - conanParser = re.compile( r' version = "\d+\.\d+\.\d+.*"') - f = open( conanPath, 'r' ) - lines = [] - for line in f: - m = conanParser.match( line ) - if m: - lines.append( ' version = "{0}"'.format(format(version.getVersionString())) ) - else: - lines.append( line.rstrip() ) - f.close() - f = open( conanPath, 'w' ) - for line in lines: - f.write( line + "\n" ) - -def updateConanTestFile(version): - conanParser = re.compile( r' requires = \"Catch\/\d+\.\d+\.\d+.*@%s\/%s\" % \(username, channel\)') - f = open( conanTestPath, 'r' ) - lines = [] - for line in f: - m = conanParser.match( line ) - if m: - lines.append( ' requires = "Catch/{0}@%s/%s" % (username, channel)'.format(format(version.getVersionString())) ) - else: - lines.append( line.rstrip() ) - f.close() - f = open( conanTestPath, 'w' ) - for line in lines: - f.write( line + "\n" ) def updateCmakeFile(version): with open(cmakePath, 'r') as file: @@ -173,6 +142,4 @@ def performUpdates(version): shutil.copyfile(sourceFile, destFile) updateReadmeFile(version) - updateConanFile(version) - updateConanTestFile(version) updateCmakeFile(version) diff --git a/packages/Catch2/single_include/catch2/catch.hpp b/packages/Catch2/single_include/catch2/catch.hpp index 4191607a7931fbd827924bd23c852b69381ff5b7..b1b2411d24885571e21ec4b3653af58c57011c3e 100644 --- a/packages/Catch2/single_include/catch2/catch.hpp +++ b/packages/Catch2/single_include/catch2/catch.hpp @@ -1,6 +1,6 @@ /* - * Catch v2.4.1 - * Generated: 2018-09-28 15:50:15.645795 + * Catch v2.5.0 + * Generated: 2018-11-26 20:46:12.165372 * ---------------------------------------------------------- * This file has been merged from multiple headers. Please don't edit it directly * Copyright (c) 2018 Two Blue Cubes Ltd. All rights reserved. @@ -14,8 +14,8 @@ #define CATCH_VERSION_MAJOR 2 -#define CATCH_VERSION_MINOR 4 -#define CATCH_VERSION_PATCH 1 +#define CATCH_VERSION_MINOR 5 +#define CATCH_VERSION_PATCH 0 #ifdef __clang__ # pragma clang system_header @@ -226,6 +226,13 @@ namespace Catch { # define CATCH_INTERNAL_CONFIG_WINDOWS_SEH # endif +// MSVC traditional preprocessor needs some workaround for __VA_ARGS__ +// _MSVC_TRADITIONAL == 0 means new conformant preprocessor +// _MSVC_TRADITIONAL == 1 means old traditional non-conformant preprocessor +# if !defined(_MSVC_TRADITIONAL) || (defined(_MSVC_TRADITIONAL) && _MSVC_TRADITIONAL) +# define CATCH_INTERNAL_CONFIG_TRADITIONAL_MSVC_PREPROCESSOR +# endif + #endif // _MSC_VER //////////////////////////////////////////////////////////////////////////////// @@ -240,6 +247,12 @@ namespace Catch { # define CATCH_INTERNAL_CONFIG_NO_WCHAR #endif // __DJGPP__ +//////////////////////////////////////////////////////////////////////////////// +// Embarcadero C++Build +#if defined(__BORLANDC__) + #define CATCH_INTERNAL_CONFIG_POLYFILL_ISNAN +#endif + //////////////////////////////////////////////////////////////////////////////// // Use of __COUNTER__ is suppressed during code analysis in @@ -320,6 +333,10 @@ namespace Catch { # define CATCH_CONFIG_DISABLE_EXCEPTIONS #endif +#if defined(CATCH_INTERNAL_CONFIG_POLYFILL_ISNAN) && !defined(CATCH_CONFIG_NO_POLYFILL_ISNAN) && !defined(CATCH_CONFIG_POLYFILL_ISNAN) +# define CATCH_CONFIG_POLYFILL_ISNAN +#endif + #if !defined(CATCH_INTERNAL_SUPPRESS_PARENTHESES_WARNINGS) # define CATCH_INTERNAL_SUPPRESS_PARENTHESES_WARNINGS # define CATCH_INTERNAL_UNSUPPRESS_PARENTHESES_WARNINGS @@ -343,6 +360,10 @@ namespace Catch { #define CATCH_CATCH_ANON(type) catch (type) #endif +#if defined(CATCH_INTERNAL_CONFIG_TRADITIONAL_MSVC_PREPROCESSOR) && !defined(CATCH_CONFIG_NO_TRADITIONAL_MSVC_PREPROCESSOR) && !defined(CATCH_CONFIG_TRADITIONAL_MSVC_PREPROCESSOR) +#define CATCH_CONFIG_TRADITIONAL_MSVC_PREPROCESSOR +#endif + // end catch_compiler_capabilities.h #define INTERNAL_CATCH_UNIQUE_NAME_LINE2( name, line ) name##line #define INTERNAL_CATCH_UNIQUE_NAME_LINE( name, line ) INTERNAL_CATCH_UNIQUE_NAME_LINE2( name, line ) @@ -356,6 +377,10 @@ namespace Catch { #include <string> #include <cstdint> +// We need a dummy global operator<< so we can bring it into Catch namespace later +struct Catch_global_namespace_dummy {}; +std::ostream& operator<<(std::ostream&, Catch_global_namespace_dummy); + namespace Catch { struct CaseSensitive { enum Choice { @@ -397,6 +422,11 @@ namespace Catch { std::ostream& operator << ( std::ostream& os, SourceLineInfo const& info ); + // Bring in operator<< from global namespace into Catch namespace + // This is necessary because the overload of operator<< above makes + // lookup stop at namespace Catch + using ::operator<<; + // Use this in variadic streaming macros to allow // >> +StreamEndStop // as well as @@ -588,6 +618,102 @@ inline auto operator "" _catch_sr( char const* rawChars, std::size_t size ) noex } // end catch_stringref.h +// start catch_type_traits.hpp + + +namespace Catch{ + +#ifdef CATCH_CPP17_OR_GREATER + template <typename...> + inline constexpr auto is_unique = std::true_type{}; + + template <typename T, typename... Rest> + inline constexpr auto is_unique<T, Rest...> = std::bool_constant< + (!std::is_same_v<T, Rest> && ...) && is_unique<Rest...> + >{}; +#else + +template <typename...> +struct is_unique : std::true_type{}; + +template <typename T0, typename T1, typename... Rest> +struct is_unique<T0, T1, Rest...> : std::integral_constant +<bool, + !std::is_same<T0, T1>::value + && is_unique<T0, Rest...>::value + && is_unique<T1, Rest...>::value +>{}; + +#endif +} + +// end catch_type_traits.hpp +// start catch_preprocessor.hpp + + +#define CATCH_RECURSION_LEVEL0(...) __VA_ARGS__ +#define CATCH_RECURSION_LEVEL1(...) CATCH_RECURSION_LEVEL0(CATCH_RECURSION_LEVEL0(CATCH_RECURSION_LEVEL0(__VA_ARGS__))) +#define CATCH_RECURSION_LEVEL2(...) CATCH_RECURSION_LEVEL1(CATCH_RECURSION_LEVEL1(CATCH_RECURSION_LEVEL1(__VA_ARGS__))) +#define CATCH_RECURSION_LEVEL3(...) CATCH_RECURSION_LEVEL2(CATCH_RECURSION_LEVEL2(CATCH_RECURSION_LEVEL2(__VA_ARGS__))) +#define CATCH_RECURSION_LEVEL4(...) CATCH_RECURSION_LEVEL3(CATCH_RECURSION_LEVEL3(CATCH_RECURSION_LEVEL3(__VA_ARGS__))) +#define CATCH_RECURSION_LEVEL5(...) CATCH_RECURSION_LEVEL4(CATCH_RECURSION_LEVEL4(CATCH_RECURSION_LEVEL4(__VA_ARGS__))) + +#ifdef CATCH_CONFIG_TRADITIONAL_MSVC_PREPROCESSOR +#define INTERNAL_CATCH_EXPAND_VARGS(...) __VA_ARGS__ +// MSVC needs more evaluations +#define CATCH_RECURSION_LEVEL6(...) CATCH_RECURSION_LEVEL5(CATCH_RECURSION_LEVEL5(CATCH_RECURSION_LEVEL5(__VA_ARGS__))) +#define CATCH_RECURSE(...) CATCH_RECURSION_LEVEL6(CATCH_RECURSION_LEVEL6(__VA_ARGS__)) +#else +#define CATCH_RECURSE(...) CATCH_RECURSION_LEVEL5(__VA_ARGS__) +#endif + +#define CATCH_REC_END(...) +#define CATCH_REC_OUT + +#define CATCH_EMPTY() +#define CATCH_DEFER(id) id CATCH_EMPTY() + +#define CATCH_REC_GET_END2() 0, CATCH_REC_END +#define CATCH_REC_GET_END1(...) CATCH_REC_GET_END2 +#define CATCH_REC_GET_END(...) CATCH_REC_GET_END1 +#define CATCH_REC_NEXT0(test, next, ...) next CATCH_REC_OUT +#define CATCH_REC_NEXT1(test, next) CATCH_DEFER ( CATCH_REC_NEXT0 ) ( test, next, 0) +#define CATCH_REC_NEXT(test, next) CATCH_REC_NEXT1(CATCH_REC_GET_END test, next) + +#define CATCH_REC_LIST0(f, x, peek, ...) , f(x) CATCH_DEFER ( CATCH_REC_NEXT(peek, CATCH_REC_LIST1) ) ( f, peek, __VA_ARGS__ ) +#define CATCH_REC_LIST1(f, x, peek, ...) , f(x) CATCH_DEFER ( CATCH_REC_NEXT(peek, CATCH_REC_LIST0) ) ( f, peek, __VA_ARGS__ ) +#define CATCH_REC_LIST2(f, x, peek, ...) f(x) CATCH_DEFER ( CATCH_REC_NEXT(peek, CATCH_REC_LIST1) ) ( f, peek, __VA_ARGS__ ) + +#define CATCH_REC_LIST0_UD(f, userdata, x, peek, ...) , f(userdata, x) CATCH_DEFER ( CATCH_REC_NEXT(peek, CATCH_REC_LIST1_UD) ) ( f, userdata, peek, __VA_ARGS__ ) +#define CATCH_REC_LIST1_UD(f, userdata, x, peek, ...) , f(userdata, x) CATCH_DEFER ( CATCH_REC_NEXT(peek, CATCH_REC_LIST0_UD) ) ( f, userdata, peek, __VA_ARGS__ ) +#define CATCH_REC_LIST2_UD(f, userdata, x, peek, ...) f(userdata, x) CATCH_DEFER ( CATCH_REC_NEXT(peek, CATCH_REC_LIST1_UD) ) ( f, userdata, peek, __VA_ARGS__ ) + +// Applies the function macro `f` to each of the remaining parameters, inserts commas between the results, +// and passes userdata as the first parameter to each invocation, +// e.g. CATCH_REC_LIST_UD(f, x, a, b, c) evaluates to f(x, a), f(x, b), f(x, c) +#define CATCH_REC_LIST_UD(f, userdata, ...) CATCH_RECURSE(CATCH_REC_LIST2_UD(f, userdata, __VA_ARGS__, ()()(), ()()(), ()()(), 0)) + +#define CATCH_REC_LIST(f, ...) CATCH_RECURSE(CATCH_REC_LIST2(f, __VA_ARGS__, ()()(), ()()(), ()()(), 0)) + +#define INTERNAL_CATCH_EXPAND1(param) INTERNAL_CATCH_EXPAND2(param) +#define INTERNAL_CATCH_EXPAND2(...) INTERNAL_CATCH_NO## __VA_ARGS__ +#define INTERNAL_CATCH_DEF(...) INTERNAL_CATCH_DEF __VA_ARGS__ +#define INTERNAL_CATCH_NOINTERNAL_CATCH_DEF + +#define INTERNAL_CATCH_REMOVE_PARENS(...) INTERNAL_CATCH_EXPAND1(INTERNAL_CATCH_DEF __VA_ARGS__) + +#define INTERNAL_CATCH_TEMPLATE_UNIQUE_NAME2(Name, ...) INTERNAL_CATCH_TEMPLATE_UNIQUE_NAME3(Name, __VA_ARGS__) +#ifndef CATCH_CONFIG_TRADITIONAL_MSVC_PREPROCESSOR +#define INTERNAL_CATCH_TEMPLATE_UNIQUE_NAME3(Name,...) Name " - " #__VA_ARGS__ +#define INTERNAL_CATCH_TEMPLATE_UNIQUE_NAME(Name,...) INTERNAL_CATCH_TEMPLATE_UNIQUE_NAME2(Name, INTERNAL_CATCH_REMOVE_PARENS(__VA_ARGS__)) +#else +// MSVC is adding extra space and needs more calls to properly remove () +#define INTERNAL_CATCH_TEMPLATE_UNIQUE_NAME3(Name,...) Name " -" #__VA_ARGS__ +#define INTERNAL_CATCH_TEMPLATE_UNIQUE_NAME1(Name, ...) INTERNAL_CATCH_TEMPLATE_UNIQUE_NAME2(Name, __VA_ARGS__) +#define INTERNAL_CATCH_TEMPLATE_UNIQUE_NAME(Name, ...) INTERNAL_CATCH_TEMPLATE_UNIQUE_NAME1(Name, INTERNAL_CATCH_EXPAND_VARGS(INTERNAL_CATCH_REMOVE_PARENS(__VA_ARGS__))) +#endif + +// end catch_preprocessor.hpp namespace Catch { template<typename C> @@ -622,22 +748,28 @@ struct AutoReg : NonCopyable { } // end namespace Catch -#define INTERNAL_CATCH_EXPAND1(param) INTERNAL_CATCH_EXPAND2(param) -#define INTERNAL_CATCH_EXPAND2(...) INTERNAL_CATCH_NO## __VA_ARGS__ -#define INTERNAL_CATCH_DEF(...) INTERNAL_CATCH_DEF __VA_ARGS__ -#define INTERNAL_CATCH_NOINTERNAL_CATCH_DEF - #if defined(CATCH_CONFIG_DISABLE) #define INTERNAL_CATCH_TESTCASE_NO_REGISTRATION( TestName, ... ) \ static void TestName() #define INTERNAL_CATCH_TESTCASE_METHOD_NO_REGISTRATION( TestName, ClassName, ... ) \ namespace{ \ - struct TestName : INTERNAL_CATCH_EXPAND1(INTERNAL_CATCH_DEF ClassName) { \ + struct TestName : INTERNAL_CATCH_REMOVE_PARENS(ClassName) { \ void test(); \ }; \ } \ void TestName::test() - + #define INTERNAL_CATCH_TEMPLATE_TEST_CASE_NO_REGISTRATION( TestName, ... ) \ + template<typename TestType> \ + static void TestName() + #define INTERNAL_CATCH_TEMPLATE_TEST_CASE_METHOD_NO_REGISTRATION( TestName, ClassName, ... ) \ + namespace{ \ + template<typename TestType> \ + struct TestName : INTERNAL_CATCH_REMOVE_PARENS(ClassName <TestType>) { \ + void test(); \ + }; \ + } \ + template<typename TestType> \ + void TestName::test() #endif /////////////////////////////////////////////////////////////////////////////// @@ -660,7 +792,7 @@ struct AutoReg : NonCopyable { #define INTERNAL_CATCH_TEST_CASE_METHOD2( TestName, ClassName, ... )\ CATCH_INTERNAL_SUPPRESS_GLOBALS_WARNINGS \ namespace{ \ - struct TestName : INTERNAL_CATCH_EXPAND1(INTERNAL_CATCH_DEF ClassName) { \ + struct TestName : INTERNAL_CATCH_REMOVE_PARENS(ClassName) { \ void test(); \ }; \ Catch::AutoReg INTERNAL_CATCH_UNIQUE_NAME( autoRegistrar ) ( Catch::makeTestInvoker( &TestName::test ), CATCH_INTERNAL_LINEINFO, #ClassName, Catch::NameAndTags{ __VA_ARGS__ } ); /* NOLINT */ \ @@ -676,6 +808,77 @@ struct AutoReg : NonCopyable { Catch::AutoReg INTERNAL_CATCH_UNIQUE_NAME( autoRegistrar )( Catch::makeTestInvoker( Function ), CATCH_INTERNAL_LINEINFO, Catch::StringRef(), Catch::NameAndTags{ __VA_ARGS__ } ); /* NOLINT */ \ CATCH_INTERNAL_UNSUPPRESS_GLOBALS_WARNINGS + /////////////////////////////////////////////////////////////////////////////// + #define INTERNAL_CATCH_TEMPLATE_TEST_CASE_2(TestName, TestFunc, Name, Tags, ... )\ + CATCH_INTERNAL_SUPPRESS_GLOBALS_WARNINGS \ + template<typename TestType> \ + static void TestFunc();\ + namespace {\ + template<typename...Types> \ + struct TestName{\ + template<typename...Ts> \ + TestName(Ts...names){\ + CATCH_INTERNAL_CHECK_UNIQUE_TYPES(CATCH_REC_LIST(INTERNAL_CATCH_REMOVE_PARENS, __VA_ARGS__)) \ + using expander = int[];\ + (void)expander{(Catch::AutoReg( Catch::makeTestInvoker( &TestFunc<Types> ), CATCH_INTERNAL_LINEINFO, Catch::StringRef(), Catch::NameAndTags{ names, Tags } ), 0)... };/* NOLINT */ \ + }\ + };\ + INTERNAL_CATCH_TEMPLATE_REGISTRY_INITIATE(TestName, Name, __VA_ARGS__) \ + }\ + CATCH_INTERNAL_UNSUPPRESS_GLOBALS_WARNINGS \ + template<typename TestType> \ + static void TestFunc() + +#if defined(CATCH_CPP17_OR_GREATER) +#define CATCH_INTERNAL_CHECK_UNIQUE_TYPES(...) static_assert(Catch::is_unique<__VA_ARGS__>,"Duplicate type detected in declaration of template test case"); +#else +#define CATCH_INTERNAL_CHECK_UNIQUE_TYPES(...) static_assert(Catch::is_unique<__VA_ARGS__>::value,"Duplicate type detected in declaration of template test case"); +#endif + +#ifndef CATCH_CONFIG_TRADITIONAL_MSVC_PREPROCESSOR + #define INTERNAL_CATCH_TEMPLATE_TEST_CASE(Name, Tags, ...) \ + INTERNAL_CATCH_TEMPLATE_TEST_CASE_2( INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_M_P_L_A_T_E____T_E_S_T____ ), INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_M_P_L_A_T_E____T_E_S_T____F_U_N_C____ ), Name, Tags, __VA_ARGS__ ) +#else + #define INTERNAL_CATCH_TEMPLATE_TEST_CASE(Name, Tags, ...) \ + INTERNAL_CATCH_EXPAND_VARGS( INTERNAL_CATCH_TEMPLATE_TEST_CASE_2( INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_M_P_L_A_T_E____T_E_S_T____ ), INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_M_P_L_A_T_E____T_E_S_T____F_U_N_C____ ), Name, Tags, __VA_ARGS__ ) ) +#endif + + #define INTERNAL_CATCH_TEMPLATE_REGISTRY_INITIATE(TestName, Name, ...)\ + static int INTERNAL_CATCH_UNIQUE_NAME( globalRegistrar ) = [](){\ + TestName<CATCH_REC_LIST(INTERNAL_CATCH_REMOVE_PARENS, __VA_ARGS__)>(CATCH_REC_LIST_UD(INTERNAL_CATCH_TEMPLATE_UNIQUE_NAME,Name, __VA_ARGS__));\ + return 0;\ + }(); + + #define INTERNAL_CATCH_TEMPLATE_TEST_CASE_METHOD_2( TestNameClass, TestName, ClassName, Name, Tags, ... ) \ + CATCH_INTERNAL_SUPPRESS_GLOBALS_WARNINGS \ + namespace{ \ + template<typename TestType> \ + struct TestName : INTERNAL_CATCH_REMOVE_PARENS(ClassName <TestType>) { \ + void test();\ + };\ + template<typename...Types> \ + struct TestNameClass{\ + template<typename...Ts> \ + TestNameClass(Ts...names){\ + CATCH_INTERNAL_CHECK_UNIQUE_TYPES(CATCH_REC_LIST(INTERNAL_CATCH_REMOVE_PARENS, __VA_ARGS__)) \ + using expander = int[];\ + (void)expander{(Catch::AutoReg( Catch::makeTestInvoker( &TestName<Types>::test ), CATCH_INTERNAL_LINEINFO, #ClassName, Catch::NameAndTags{ names, Tags } ), 0)... };/* NOLINT */ \ + }\ + };\ + INTERNAL_CATCH_TEMPLATE_REGISTRY_INITIATE(TestNameClass, Name, __VA_ARGS__)\ + }\ + CATCH_INTERNAL_UNSUPPRESS_GLOBALS_WARNINGS\ + template<typename TestType> \ + void TestName<TestType>::test() + +#ifndef CATCH_CONFIG_TRADITIONAL_MSVC_PREPROCESSOR + #define INTERNAL_CATCH_TEMPLATE_TEST_CASE_METHOD( ClassName, Name, Tags,... ) \ + INTERNAL_CATCH_TEMPLATE_TEST_CASE_METHOD_2( INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_M_P_L_A_T_E____T_E_S_T____C_L_A_S_S____ ), INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_M_P_L_A_T_E____T_E_S_T____ ) , ClassName, Name, Tags, __VA_ARGS__ ) +#else + #define INTERNAL_CATCH_TEMPLATE_TEST_CASE_METHOD( ClassName, Name, Tags,... ) \ + INTERNAL_CATCH_EXPAND_VARGS( INTERNAL_CATCH_TEMPLATE_TEST_CASE_METHOD_2( INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_M_P_L_A_T_E____T_E_S_T____C_L_A_S_S____ ), INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_M_P_L_A_T_E____T_E_S_T____ ) , ClassName, Name, Tags, __VA_ARGS__ ) ) +#endif + // end catch_test_registry.h // start catch_capture.hpp @@ -850,14 +1053,7 @@ inline id performOptionalSelector( id obj, SEL sel ) { #pragma warning(disable:4180) // We attempt to stream a function (address) by const&, which MSVC complains about but is harmless #endif -// We need a dummy global operator<< so we can bring it into Catch namespace later -struct Catch_global_namespace_dummy {}; -std::ostream& operator<<(std::ostream&, Catch_global_namespace_dummy); - namespace Catch { - // Bring in operator<< from global namespace into Catch namespace - using ::operator<<; - namespace Detail { extern const std::string unprintableString; @@ -1821,16 +2017,16 @@ namespace Catch { Capturer( StringRef macroName, SourceLineInfo const& lineInfo, ResultWas::OfType resultType, StringRef names ); ~Capturer(); - void captureValue( size_t index, StringRef value ); + void captureValue( size_t index, std::string const& value ); template<typename T> - void captureValues( size_t index, T&& value ) { + void captureValues( size_t index, T const& value ) { captureValue( index, Catch::Detail::stringify( value ) ); } template<typename T, typename... Ts> - void captureValues( size_t index, T&& value, Ts&&... values ) { - captureValues( index, value ); + void captureValues( size_t index, T const& value, Ts const&... values ) { + captureValue( index, Catch::Detail::stringify(value) ); captureValues( index+1, values... ); } }; @@ -2451,10 +2647,6 @@ namespace Matchers { struct MatcherMethod { virtual bool match( ObjectT const& arg ) const = 0; }; - template<typename PtrT> - struct MatcherMethod<PtrT*> { - virtual bool match( PtrT* arg ) const = 0; - }; #ifdef __clang__ # pragma clang diagnostic pop @@ -4512,6 +4704,8 @@ namespace Catch { struct TestEventListenerBase : StreamingReporterBase<TestEventListenerBase> { TestEventListenerBase( ReporterConfig const& _config ); + static std::set<Verbosity> getSupportedVerbosities(); + void assertionStarting(AssertionInfo const&) override; bool assertionEnded(AssertionStats const&) override; }; @@ -5121,6 +5315,7 @@ namespace Catch { struct LeakDetector { LeakDetector(); + ~LeakDetector(); }; } @@ -5772,7 +5967,7 @@ namespace Catch { // // See https://github.com/philsquared/Clara for more details -// Clara v1.1.4 +// Clara v1.1.5 #ifndef CATCH_CLARA_CONFIG_CONSOLE_WIDTH @@ -5798,8 +5993,8 @@ namespace Catch { // // A single-header library for wrapping and laying out basic text, by Phil Nash // -// This work is licensed under the BSD 2-Clause license. -// See the accompanying LICENSE file, or the one at https://opensource.org/licenses/BSD-2-Clause +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // // This project is hosted at https://github.com/philsquared/textflowcpp @@ -5813,314 +6008,324 @@ namespace Catch { #define CATCH_CLARA_TEXTFLOW_CONFIG_CONSOLE_WIDTH 80 #endif -namespace Catch { namespace clara { namespace TextFlow { - - inline auto isWhitespace( char c ) -> bool { - static std::string chars = " \t\n\r"; - return chars.find( c ) != std::string::npos; - } - inline auto isBreakableBefore( char c ) -> bool { - static std::string chars = "[({<|"; - return chars.find( c ) != std::string::npos; - } - inline auto isBreakableAfter( char c ) -> bool { - static std::string chars = "])}>.,:;*+-=&/\\"; - return chars.find( c ) != std::string::npos; - } - - class Columns; - - class Column { - std::vector<std::string> m_strings; - size_t m_width = CATCH_CLARA_TEXTFLOW_CONFIG_CONSOLE_WIDTH; - size_t m_indent = 0; - size_t m_initialIndent = std::string::npos; - - public: - class iterator { - friend Column; - - Column const& m_column; - size_t m_stringIndex = 0; - size_t m_pos = 0; - - size_t m_len = 0; - size_t m_end = 0; - bool m_suffix = false; - - iterator( Column const& column, size_t stringIndex ) - : m_column( column ), - m_stringIndex( stringIndex ) - {} - - auto line() const -> std::string const& { return m_column.m_strings[m_stringIndex]; } - - auto isBoundary( size_t at ) const -> bool { - assert( at > 0 ); - assert( at <= line().size() ); - - return at == line().size() || - ( isWhitespace( line()[at] ) && !isWhitespace( line()[at-1] ) ) || - isBreakableBefore( line()[at] ) || - isBreakableAfter( line()[at-1] ); - } - - void calcLength() { - assert( m_stringIndex < m_column.m_strings.size() ); - - m_suffix = false; - auto width = m_column.m_width-indent(); - m_end = m_pos; - while( m_end < line().size() && line()[m_end] != '\n' ) - ++m_end; - - if( m_end < m_pos + width ) { - m_len = m_end - m_pos; - } - else { - size_t len = width; - while (len > 0 && !isBoundary(m_pos + len)) - --len; - while (len > 0 && isWhitespace( line()[m_pos + len - 1] )) - --len; - - if (len > 0) { - m_len = len; - } else { - m_suffix = true; - m_len = width - 1; - } - } - } - - auto indent() const -> size_t { - auto initial = m_pos == 0 && m_stringIndex == 0 ? m_column.m_initialIndent : std::string::npos; - return initial == std::string::npos ? m_column.m_indent : initial; - } - - auto addIndentAndSuffix(std::string const &plain) const -> std::string { - return std::string( indent(), ' ' ) + (m_suffix ? plain + "-" : plain); - } - - public: - explicit iterator( Column const& column ) : m_column( column ) { - assert( m_column.m_width > m_column.m_indent ); - assert( m_column.m_initialIndent == std::string::npos || m_column.m_width > m_column.m_initialIndent ); - calcLength(); - if( m_len == 0 ) - m_stringIndex++; // Empty string - } - - auto operator *() const -> std::string { - assert( m_stringIndex < m_column.m_strings.size() ); - assert( m_pos <= m_end ); - if( m_pos + m_column.m_width < m_end ) - return addIndentAndSuffix(line().substr(m_pos, m_len)); - else - return addIndentAndSuffix(line().substr(m_pos, m_end - m_pos)); - } - - auto operator ++() -> iterator& { - m_pos += m_len; - if( m_pos < line().size() && line()[m_pos] == '\n' ) - m_pos += 1; - else - while( m_pos < line().size() && isWhitespace( line()[m_pos] ) ) - ++m_pos; - - if( m_pos == line().size() ) { - m_pos = 0; - ++m_stringIndex; - } - if( m_stringIndex < m_column.m_strings.size() ) - calcLength(); - return *this; - } - auto operator ++(int) -> iterator { - iterator prev( *this ); - operator++(); - return prev; - } - - auto operator ==( iterator const& other ) const -> bool { - return - m_pos == other.m_pos && - m_stringIndex == other.m_stringIndex && - &m_column == &other.m_column; - } - auto operator !=( iterator const& other ) const -> bool { - return !operator==( other ); - } - }; - using const_iterator = iterator; - - explicit Column( std::string const& text ) { m_strings.push_back( text ); } - - auto width( size_t newWidth ) -> Column& { - assert( newWidth > 0 ); - m_width = newWidth; - return *this; - } - auto indent( size_t newIndent ) -> Column& { - m_indent = newIndent; - return *this; - } - auto initialIndent( size_t newIndent ) -> Column& { - m_initialIndent = newIndent; - return *this; - } - - auto width() const -> size_t { return m_width; } - auto begin() const -> iterator { return iterator( *this ); } - auto end() const -> iterator { return { *this, m_strings.size() }; } - - inline friend std::ostream& operator << ( std::ostream& os, Column const& col ) { - bool first = true; - for( auto line : col ) { - if( first ) - first = false; - else - os << "\n"; - os << line; - } - return os; - } - - auto operator + ( Column const& other ) -> Columns; - - auto toString() const -> std::string { - std::ostringstream oss; - oss << *this; - return oss.str(); - } - }; - - class Spacer : public Column { - - public: - explicit Spacer( size_t spaceWidth ) : Column( "" ) { - width( spaceWidth ); - } - }; - - class Columns { - std::vector<Column> m_columns; - - public: - - class iterator { - friend Columns; - struct EndTag {}; - - std::vector<Column> const& m_columns; - std::vector<Column::iterator> m_iterators; - size_t m_activeIterators; +namespace Catch { +namespace clara { +namespace TextFlow { - iterator( Columns const& columns, EndTag ) - : m_columns( columns.m_columns ), - m_activeIterators( 0 ) - { - m_iterators.reserve( m_columns.size() ); +inline auto isWhitespace(char c) -> bool { + static std::string chars = " \t\n\r"; + return chars.find(c) != std::string::npos; +} +inline auto isBreakableBefore(char c) -> bool { + static std::string chars = "[({<|"; + return chars.find(c) != std::string::npos; +} +inline auto isBreakableAfter(char c) -> bool { + static std::string chars = "])}>.,:;*+-=&/\\"; + return chars.find(c) != std::string::npos; +} - for( auto const& col : m_columns ) - m_iterators.push_back( col.end() ); - } +class Columns; - public: - explicit iterator( Columns const& columns ) - : m_columns( columns.m_columns ), - m_activeIterators( m_columns.size() ) - { - m_iterators.reserve( m_columns.size() ); +class Column { + std::vector<std::string> m_strings; + size_t m_width = CATCH_CLARA_TEXTFLOW_CONFIG_CONSOLE_WIDTH; + size_t m_indent = 0; + size_t m_initialIndent = std::string::npos; - for( auto const& col : m_columns ) - m_iterators.push_back( col.begin() ); - } +public: + class iterator { + friend Column; + + Column const& m_column; + size_t m_stringIndex = 0; + size_t m_pos = 0; + + size_t m_len = 0; + size_t m_end = 0; + bool m_suffix = false; + + iterator(Column const& column, size_t stringIndex) + : m_column(column), + m_stringIndex(stringIndex) {} + + auto line() const -> std::string const& { return m_column.m_strings[m_stringIndex]; } + + auto isBoundary(size_t at) const -> bool { + assert(at > 0); + assert(at <= line().size()); + + return at == line().size() || + (isWhitespace(line()[at]) && !isWhitespace(line()[at - 1])) || + isBreakableBefore(line()[at]) || + isBreakableAfter(line()[at - 1]); + } + + void calcLength() { + assert(m_stringIndex < m_column.m_strings.size()); + + m_suffix = false; + auto width = m_column.m_width - indent(); + m_end = m_pos; + while (m_end < line().size() && line()[m_end] != '\n') + ++m_end; + + if (m_end < m_pos + width) { + m_len = m_end - m_pos; + } else { + size_t len = width; + while (len > 0 && !isBoundary(m_pos + len)) + --len; + while (len > 0 && isWhitespace(line()[m_pos + len - 1])) + --len; + + if (len > 0) { + m_len = len; + } else { + m_suffix = true; + m_len = width - 1; + } + } + } + + auto indent() const -> size_t { + auto initial = m_pos == 0 && m_stringIndex == 0 ? m_column.m_initialIndent : std::string::npos; + return initial == std::string::npos ? m_column.m_indent : initial; + } + + auto addIndentAndSuffix(std::string const &plain) const -> std::string { + return std::string(indent(), ' ') + (m_suffix ? plain + "-" : plain); + } + + public: + using difference_type = std::ptrdiff_t; + using value_type = std::string; + using pointer = value_type * ; + using reference = value_type & ; + using iterator_category = std::forward_iterator_tag; + + explicit iterator(Column const& column) : m_column(column) { + assert(m_column.m_width > m_column.m_indent); + assert(m_column.m_initialIndent == std::string::npos || m_column.m_width > m_column.m_initialIndent); + calcLength(); + if (m_len == 0) + m_stringIndex++; // Empty string + } + + auto operator *() const -> std::string { + assert(m_stringIndex < m_column.m_strings.size()); + assert(m_pos <= m_end); + return addIndentAndSuffix(line().substr(m_pos, m_len)); + } + + auto operator ++() -> iterator& { + m_pos += m_len; + if (m_pos < line().size() && line()[m_pos] == '\n') + m_pos += 1; + else + while (m_pos < line().size() && isWhitespace(line()[m_pos])) + ++m_pos; + + if (m_pos == line().size()) { + m_pos = 0; + ++m_stringIndex; + } + if (m_stringIndex < m_column.m_strings.size()) + calcLength(); + return *this; + } + auto operator ++(int) -> iterator { + iterator prev(*this); + operator++(); + return prev; + } + + auto operator ==(iterator const& other) const -> bool { + return + m_pos == other.m_pos && + m_stringIndex == other.m_stringIndex && + &m_column == &other.m_column; + } + auto operator !=(iterator const& other) const -> bool { + return !operator==(other); + } + }; + using const_iterator = iterator; + + explicit Column(std::string const& text) { m_strings.push_back(text); } + + auto width(size_t newWidth) -> Column& { + assert(newWidth > 0); + m_width = newWidth; + return *this; + } + auto indent(size_t newIndent) -> Column& { + m_indent = newIndent; + return *this; + } + auto initialIndent(size_t newIndent) -> Column& { + m_initialIndent = newIndent; + return *this; + } + + auto width() const -> size_t { return m_width; } + auto begin() const -> iterator { return iterator(*this); } + auto end() const -> iterator { return { *this, m_strings.size() }; } + + inline friend std::ostream& operator << (std::ostream& os, Column const& col) { + bool first = true; + for (auto line : col) { + if (first) + first = false; + else + os << "\n"; + os << line; + } + return os; + } + + auto operator + (Column const& other)->Columns; + + auto toString() const -> std::string { + std::ostringstream oss; + oss << *this; + return oss.str(); + } +}; - auto operator ==( iterator const& other ) const -> bool { - return m_iterators == other.m_iterators; - } - auto operator !=( iterator const& other ) const -> bool { - return m_iterators != other.m_iterators; - } - auto operator *() const -> std::string { - std::string row, padding; +class Spacer : public Column { - for( size_t i = 0; i < m_columns.size(); ++i ) { - auto width = m_columns[i].width(); - if( m_iterators[i] != m_columns[i].end() ) { - std::string col = *m_iterators[i]; - row += padding + col; - if( col.size() < width ) - padding = std::string( width - col.size(), ' ' ); - else - padding = ""; - } - else { - padding += std::string( width, ' ' ); - } - } - return row; - } - auto operator ++() -> iterator& { - for( size_t i = 0; i < m_columns.size(); ++i ) { - if (m_iterators[i] != m_columns[i].end()) - ++m_iterators[i]; - } - return *this; - } - auto operator ++(int) -> iterator { - iterator prev( *this ); - operator++(); - return prev; - } - }; - using const_iterator = iterator; - - auto begin() const -> iterator { return iterator( *this ); } - auto end() const -> iterator { return { *this, iterator::EndTag() }; } +public: + explicit Spacer(size_t spaceWidth) : Column("") { + width(spaceWidth); + } +}; - auto operator += ( Column const& col ) -> Columns& { - m_columns.push_back( col ); - return *this; - } - auto operator + ( Column const& col ) -> Columns { - Columns combined = *this; - combined += col; - return combined; - } +class Columns { + std::vector<Column> m_columns; - inline friend std::ostream& operator << ( std::ostream& os, Columns const& cols ) { +public: - bool first = true; - for( auto line : cols ) { - if( first ) - first = false; - else - os << "\n"; - os << line; - } - return os; - } + class iterator { + friend Columns; + struct EndTag {}; + + std::vector<Column> const& m_columns; + std::vector<Column::iterator> m_iterators; + size_t m_activeIterators; + + iterator(Columns const& columns, EndTag) + : m_columns(columns.m_columns), + m_activeIterators(0) { + m_iterators.reserve(m_columns.size()); + + for (auto const& col : m_columns) + m_iterators.push_back(col.end()); + } + + public: + using difference_type = std::ptrdiff_t; + using value_type = std::string; + using pointer = value_type * ; + using reference = value_type & ; + using iterator_category = std::forward_iterator_tag; + + explicit iterator(Columns const& columns) + : m_columns(columns.m_columns), + m_activeIterators(m_columns.size()) { + m_iterators.reserve(m_columns.size()); + + for (auto const& col : m_columns) + m_iterators.push_back(col.begin()); + } + + auto operator ==(iterator const& other) const -> bool { + return m_iterators == other.m_iterators; + } + auto operator !=(iterator const& other) const -> bool { + return m_iterators != other.m_iterators; + } + auto operator *() const -> std::string { + std::string row, padding; + + for (size_t i = 0; i < m_columns.size(); ++i) { + auto width = m_columns[i].width(); + if (m_iterators[i] != m_columns[i].end()) { + std::string col = *m_iterators[i]; + row += padding + col; + if (col.size() < width) + padding = std::string(width - col.size(), ' '); + else + padding = ""; + } else { + padding += std::string(width, ' '); + } + } + return row; + } + auto operator ++() -> iterator& { + for (size_t i = 0; i < m_columns.size(); ++i) { + if (m_iterators[i] != m_columns[i].end()) + ++m_iterators[i]; + } + return *this; + } + auto operator ++(int) -> iterator { + iterator prev(*this); + operator++(); + return prev; + } + }; + using const_iterator = iterator; + + auto begin() const -> iterator { return iterator(*this); } + auto end() const -> iterator { return { *this, iterator::EndTag() }; } + + auto operator += (Column const& col) -> Columns& { + m_columns.push_back(col); + return *this; + } + auto operator + (Column const& col) -> Columns { + Columns combined = *this; + combined += col; + return combined; + } + + inline friend std::ostream& operator << (std::ostream& os, Columns const& cols) { + + bool first = true; + for (auto line : cols) { + if (first) + first = false; + else + os << "\n"; + os << line; + } + return os; + } + + auto toString() const -> std::string { + std::ostringstream oss; + oss << *this; + return oss.str(); + } +}; - auto toString() const -> std::string { - std::ostringstream oss; - oss << *this; - return oss.str(); - } - }; +inline auto Column::operator + (Column const& other) -> Columns { + Columns cols; + cols += *this; + cols += other; + return cols; +} +} - inline auto Column::operator + ( Column const& other ) -> Columns { - Columns cols; - cols += *this; - cols += other; - return cols; - } -}}} // namespace Catch::clara::TextFlow +} +} // ----------- end of #include from clara_textflow.hpp ----------- // ........... back in clara.hpp +#include <string> #include <memory> #include <set> #include <algorithm> @@ -7119,6 +7324,18 @@ namespace Catch { return ParserResult::runtimeError( "Unrecognised verbosity, '" + verbosity + "'" ); return ParserResult::ok( ParseResultType::Matched ); }; + auto const setReporter = [&]( std::string const& reporter ) { + IReporterRegistry::FactoryMap const& factories = getRegistryHub().getReporterRegistry().getFactories(); + + auto lcReporter = toLower( reporter ); + auto result = factories.find( lcReporter ); + + if( factories.end() != result ) + config.reporterName = lcReporter; + else + return ParserResult::runtimeError( "Unrecognized reporter, '" + reporter + "'. Check available with --list-reporters" ); + return ParserResult::ok( ParseResultType::Matched ); + }; auto cli = ExeName( config.processName ) @@ -7144,7 +7361,7 @@ namespace Catch { | Opt( config.outputFilename, "filename" ) ["-o"]["--out"] ( "output filename" ) - | Opt( config.reporterName, "name" ) + | Opt( setReporter, "name" ) ["-r"]["--reporter"] ( "reporter to use (defaults to console)" ) | Opt( config.name, "name" ) @@ -8292,6 +8509,10 @@ namespace Catch { Catch::LeakDetector::LeakDetector() {} #endif + +Catch::LeakDetector::~LeakDetector() { + Catch::cleanUp(); +} // end catch_leak_detector.cpp // start catch_list.cpp @@ -8315,7 +8536,7 @@ namespace Catch { std::size_t listTags( Config const& config ); - std::size_t listReporters( Config const& /*config*/ ); + std::size_t listReporters(); Option<std::size_t> list( Config const& config ); @@ -8433,7 +8654,7 @@ namespace Catch { return tagCounts.size(); } - std::size_t listReporters( Config const& /*config*/ ) { + std::size_t listReporters() { Catch::cout() << "Available reporters:\n"; IReporterRegistry::FactoryMap const& factories = getRegistryHub().getReporterRegistry().getFactories(); std::size_t maxNameLen = 0; @@ -8464,7 +8685,7 @@ namespace Catch { if( config.listTags() ) listedCount = listedCount.valueOr(0) + listTags( config ); if( config.listReporters() ) - listedCount = listedCount.valueOr(0) + listReporters( config ); + listedCount = listedCount.valueOr(0) + listReporters(); return listedCount; } @@ -8494,6 +8715,14 @@ using Matchers::Impl::MatcherBase; // end catch_matchers.cpp // start catch_matchers_floating.cpp +// start catch_polyfills.hpp + +namespace Catch { + bool isnan(float f); + bool isnan(double d); +} + +// end catch_polyfills.hpp // start catch_to_string.hpp #include <string> @@ -8559,7 +8788,7 @@ template <typename FP> bool almostEqualUlps(FP lhs, FP rhs, int maxUlpDiff) { // Comparison with NaN should always be false. // This way we can rule it out before getting into the ugly details - if (std::isnan(lhs) || std::isnan(rhs)) { + if (Catch::isnan(lhs) || Catch::isnan(rhs)) { return false; } @@ -8767,6 +8996,7 @@ namespace Catch { // end catch_uncaught_exceptions.h #include <cassert> +#include <stack> namespace Catch { @@ -8813,19 +9043,48 @@ namespace Catch { } Capturer::Capturer( StringRef macroName, SourceLineInfo const& lineInfo, ResultWas::OfType resultType, StringRef names ) { - auto start = std::string::npos; - for( size_t pos = 0; pos <= names.size(); ++pos ) { + auto trimmed = [&] (size_t start, size_t end) { + while (names[start] == ',' || isspace(names[start])) { + ++start; + } + while (names[end] == ',' || isspace(names[end])) { + --end; + } + return names.substr(start, end - start + 1); + }; + + size_t start = 0; + std::stack<char> openings; + for (size_t pos = 0; pos < names.size(); ++pos) { char c = names[pos]; - if( pos == names.size() || c == ' ' || c == '\t' || c == ',' || c == ']' ) { - if( start != std::string::npos ) { - m_messages.push_back( MessageInfo( macroName, lineInfo, resultType ) ); - m_messages.back().message = names.substr( start, pos-start) + " := "; - start = std::string::npos; + switch (c) { + case '[': + case '{': + case '(': + // It is basically impossible to disambiguate between + // comparison and start of template args in this context +// case '<': + openings.push(c); + break; + case ']': + case '}': + case ')': +// case '>': + openings.pop(); + break; + case ',': + if (start != pos && openings.size() == 0) { + m_messages.emplace_back(macroName, lineInfo, resultType); + m_messages.back().message = trimmed(start, pos); + m_messages.back().message += " := "; + start = pos; } } - else if( c != '[' && c != ']' && start == std::string::npos ) - start = pos; } + assert(openings.size() == 0 && "Mismatched openings"); + m_messages.emplace_back(macroName, lineInfo, resultType); + m_messages.back().message = trimmed(start, names.size() - 1); + m_messages.back().message += " := "; } Capturer::~Capturer() { if ( !uncaught_exceptions() ){ @@ -8835,7 +9094,7 @@ namespace Catch { } } - void Capturer::captureValue( size_t index, StringRef value ) { + void Capturer::captureValue( size_t index, std::string const& value ) { assert( index < m_messages.size() ); m_messages[index].message += value; m_resultCapture.pushScopedMessage( m_messages[index] ); @@ -9063,6 +9322,31 @@ namespace Catch { #endif #endif // end catch_output_redirect.cpp +// start catch_polyfills.cpp + +#include <cmath> + +namespace Catch { + +#if !defined(CATCH_CONFIG_POLYFILL_ISNAN) + bool isnan(float f) { + return std::isnan(f); + } + bool isnan(double d) { + return std::isnan(d); + } +#else + // For now we only use this for embarcadero + bool isnan(float f) { + return std::_isnan(f); + } + bool isnan(double d) { + return std::_isnan(d); + } +#endif + +} // end namespace Catch +// end catch_polyfills.cpp // start catch_random_number_generator.cpp namespace Catch { @@ -9930,13 +10214,22 @@ namespace Catch { void libIdentify(); int applyCommandLine( int argc, char const * const * argv ); + #if defined(CATCH_CONFIG_WCHAR) && defined(WIN32) && defined(UNICODE) + int applyCommandLine( int argc, wchar_t const * const * argv ); + #endif void useConfigData( ConfigData const& configData ); - int run( int argc, char* argv[] ); - #if defined(CATCH_CONFIG_WCHAR) && defined(WIN32) && defined(UNICODE) - int run( int argc, wchar_t* const argv[] ); - #endif + template<typename CharT> + int run(int argc, CharT const * const argv[]) { + if (m_startupExceptions) + return 1; + int returnCode = applyCommandLine(argc, argv); + if (returnCode == 0) + returnCode = run(); + return returnCode; + } + int run(); clara::Parser const& cli() const; @@ -10017,8 +10310,6 @@ namespace Catch { } Catch::Totals runTests(std::shared_ptr<Config> const& config) { - // FixMe: Add listeners in order first, then add reporters. - auto reporter = makeReporter(config); RunContext context(config, std::move(reporter)); @@ -10148,22 +10439,8 @@ namespace Catch { return 0; } - void Session::useConfigData( ConfigData const& configData ) { - m_configData = configData; - m_config.reset(); - } - - int Session::run( int argc, char* argv[] ) { - if( m_startupExceptions ) - return 1; - int returnCode = applyCommandLine( argc, argv ); - if( returnCode == 0 ) - returnCode = run(); - return returnCode; - } - #if defined(CATCH_CONFIG_WCHAR) && defined(WIN32) && defined(UNICODE) - int Session::run( int argc, wchar_t* const argv[] ) { + int Session::applyCommandLine( int argc, wchar_t const * const * argv ) { char **utf8Argv = new char *[ argc ]; @@ -10175,7 +10452,7 @@ namespace Catch { WideCharToMultiByte( CP_UTF8, 0, argv[i], -1, utf8Argv[i], bufSize, NULL, NULL ); } - int returnCode = run( argc, utf8Argv ); + int returnCode = applyCommandLine( argc, utf8Argv ); for ( int i = 0; i < argc; ++i ) delete [] utf8Argv[ i ]; @@ -10185,6 +10462,12 @@ namespace Catch { return returnCode; } #endif + + void Session::useConfigData( ConfigData const& configData ) { + m_configData = configData; + m_config.reset(); + } + int Session::run() { if( ( m_configData.waitForKeypress & WaitForKeypress::BeforeStart ) != 0 ) { Catch::cout() << "...waiting for enter/ return before starting" << std::endl; @@ -11552,7 +11835,7 @@ namespace Detail { template<typename T> std::string fpToString( T value, int precision ) { - if (std::isnan(value)) { + if (Catch::isnan(value)) { return "nan"; } @@ -11686,7 +11969,7 @@ std::string StringMaker<bool>::convert(bool b) { return b ? "true" : "false"; } -std::string StringMaker<char>::convert(char value) { +std::string StringMaker<signed char>::convert(signed char value) { if (value == '\r') { return "'\\r'"; } else if (value == '\f') { @@ -11703,8 +11986,8 @@ std::string StringMaker<char>::convert(char value) { return chstr; } } -std::string StringMaker<signed char>::convert(signed char c) { - return ::Catch::Detail::stringify(static_cast<char>(c)); +std::string StringMaker<char>::convert(char c) { + return ::Catch::Detail::stringify(static_cast<signed char>(c)); } std::string StringMaker<unsigned char>::convert(unsigned char c) { return ::Catch::Detail::stringify(static_cast<char>(c)); @@ -11836,7 +12119,7 @@ namespace Catch { } Version const& libraryVersion() { - static Version version( 2, 4, 1, "", 0 ); + static Version version( 2, 5, 0, "", 0 ); return version; } @@ -12194,6 +12477,10 @@ namespace Catch { TestEventListenerBase::TestEventListenerBase(ReporterConfig const & _config) :StreamingReporterBase(_config) {} + std::set<Verbosity> TestEventListenerBase::getSupportedVerbosities() { + return { Verbosity::Quiet, Verbosity::Normal, Verbosity::High }; + } + void TestEventListenerBase::assertionStarting(AssertionInfo const &) {} bool TestEventListenerBase::assertionEnded(AssertionStats const &) { @@ -12582,8 +12869,6 @@ public: void print() const { printSourceInfo(); if (stats.totals.assertions.total() > 0) { - if (result.isOk()) - stream << '\n'; printResultType(); printOriginalExpression(); printReconstructedExpression(); @@ -13517,6 +13802,9 @@ namespace Catch { m_xml.startElement( "Catch" ); if( !m_config->name().empty() ) m_xml.writeAttribute( "name", m_config->name() ); + if( m_config->rngSeed() != 0 ) + m_xml.scopedElement( "Randomness" ) + .writeAttribute( "seed", m_config->rngSeed() ); } void XmlReporter::testGroupStarting( GroupInfo const& groupInfo ) { @@ -13792,6 +14080,22 @@ int main (int argc, char * const argv[]) { #define CATCH_ANON_TEST_CASE() INTERNAL_CATCH_TESTCASE() +#ifndef CATCH_CONFIG_TRADITIONAL_MSVC_PREPROCESSOR +#define CATCH_TEMPLATE_TEST_CASE( ... ) INTERNAL_CATCH_TEMPLATE_TEST_CASE( __VA_ARGS__ ) +#define CATCH_TEMPLATE_TEST_CASE_METHOD( className, ... ) INTERNAL_CATCH_TEMPLATE_TEST_CASE_METHOD( className, __VA_ARGS__ ) +#else +#define CATCH_TEMPLATE_TEST_CASE( ... ) INTERNAL_CATCH_EXPAND_VARGS( INTERNAL_CATCH_TEMPLATE_TEST_CASE( __VA_ARGS__ ) ) +#define CATCH_TEMPLATE_TEST_CASE_METHOD( className, ... ) INTERNAL_CATCH_EXPAND_VARGS( INTERNAL_CATCH_TEMPLATE_TEST_CASE_METHOD( className, __VA_ARGS__ ) ) +#endif + +#if !defined(CATCH_CONFIG_RUNTIME_STATIC_REQUIRE) +#define CATCH_STATIC_REQUIRE( ... ) static_assert( __VA_ARGS__ , #__VA_ARGS__ ); CATCH_SUCCEED( #__VA_ARGS__ ) +#define CATCH_STATIC_REQUIRE_FALSE( ... ) static_assert( !(__VA_ARGS__), "!(" #__VA_ARGS__ ")" ); CATCH_SUCCEED( #__VA_ARGS__ ) +#else +#define CATCH_STATIC_REQUIRE( ... ) CATCH_REQUIRE( __VA_ARGS__ ) +#define CATCH_STATIC_REQUIRE_FALSE( ... ) CATCH_REQUIRE_FALSE( __VA_ARGS__ ) +#endif + // "BDD-style" convenience wrappers #define CATCH_SCENARIO( ... ) CATCH_TEST_CASE( "Scenario: " __VA_ARGS__ ) #define CATCH_SCENARIO_METHOD( className, ... ) INTERNAL_CATCH_TEST_CASE_METHOD( className, "Scenario: " __VA_ARGS__ ) @@ -13851,6 +14155,22 @@ int main (int argc, char * const argv[]) { #define SUCCEED( ... ) INTERNAL_CATCH_MSG( "SUCCEED", Catch::ResultWas::Ok, Catch::ResultDisposition::ContinueOnFailure, __VA_ARGS__ ) #define ANON_TEST_CASE() INTERNAL_CATCH_TESTCASE() +#ifndef CATCH_CONFIG_TRADITIONAL_MSVC_PREPROCESSOR +#define TEMPLATE_TEST_CASE( ... ) INTERNAL_CATCH_TEMPLATE_TEST_CASE( __VA_ARGS__ ) +#define TEMPLATE_TEST_CASE_METHOD( className, ... ) INTERNAL_CATCH_TEMPLATE_TEST_CASE_METHOD( className, __VA_ARGS__ ) +#else +#define TEMPLATE_TEST_CASE( ... ) INTERNAL_CATCH_EXPAND_VARGS( INTERNAL_CATCH_TEMPLATE_TEST_CASE( __VA_ARGS__ ) ) +#define TEMPLATE_TEST_CASE_METHOD( className, ... ) INTERNAL_CATCH_EXPAND_VARGS( INTERNAL_CATCH_TEMPLATE_TEST_CASE_METHOD( className, __VA_ARGS__ ) ) +#endif + +#if !defined(CATCH_CONFIG_RUNTIME_STATIC_REQUIRE) +#define STATIC_REQUIRE( ... ) static_assert( __VA_ARGS__, #__VA_ARGS__ ); SUCCEED( #__VA_ARGS__ ) +#define STATIC_REQUIRE_FALSE( ... ) static_assert( !(__VA_ARGS__), "!(" #__VA_ARGS__ ")" ); SUCCEED( "!(" #__VA_ARGS__ ")" ) +#else +#define STATIC_REQUIRE( ... ) REQUIRE( __VA_ARGS__ ) +#define STATIC_REQUIRE_FALSE( ... ) REQUIRE_FALSE( __VA_ARGS__ ) +#endif + #endif #define CATCH_TRANSLATE_EXCEPTION( signature ) INTERNAL_CATCH_TRANSLATE_EXCEPTION( signature ) @@ -13921,6 +14241,14 @@ using Catch::Detail::Approx; #define CATCH_ANON_TEST_CASE() INTERNAL_CATCH_TESTCASE_NO_REGISTRATION(INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_S_T____ )) +#ifndef CATCH_CONFIG_TRADITIONAL_MSVC_PREPROCESSOR +#define CATCH_TEMPLATE_TEST_CASE( ... ) INTERNAL_CATCH_TEMPLATE_TEST_CASE_NO_REGISTRATION(INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_M_P_L_A_T_E____T_E_S_T____ ) ) +#define CATCH_TEMPLATE_TEST_CASE_METHOD( className, ... ) INTERNAL_CATCH_TEMPLATE_TEST_CASE_METHOD_NO_REGISTRATION(INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_M_P_L_A_T_E____T_E_S_T____ ), className ) +#else +#define CATCH_TEMPLATE_TEST_CASE( ... ) INTERNAL_CATCH_EXPAND_VARGS( INTERNAL_CATCH_TEMPLATE_TEST_CASE_NO_REGISTRATION(INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_M_P_L_A_T_E____T_E_S_T____ ) ) ) +#define CATCH_TEMPLATE_TEST_CASE_METHOD( className, ... ) INTERNAL_CATCH_EXPAND_VARGS( INTERNAL_CATCH_TEMPLATE_TEST_CASE_METHOD_NO_REGISTRATION(INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_M_P_L_A_T_E____T_E_S_T____ ), className ) ) +#endif + // "BDD-style" convenience wrappers #define CATCH_SCENARIO( ... ) INTERNAL_CATCH_TESTCASE_NO_REGISTRATION(INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_S_T____ )) #define CATCH_SCENARIO_METHOD( className, ... ) INTERNAL_CATCH_TESTCASE_METHOD_NO_REGISTRATION(INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_S_T____ ), className ) @@ -13931,6 +14259,9 @@ using Catch::Detail::Approx; #define CATCH_THEN( desc ) #define CATCH_AND_THEN( desc ) +#define CATCH_STATIC_REQUIRE( ... ) (void)(0) +#define CATCH_STATIC_REQUIRE_FALSE( ... ) (void)(0) + // If CATCH_CONFIG_PREFIX_ALL is not defined then the CATCH_ prefix is not required #else @@ -13980,6 +14311,17 @@ using Catch::Detail::Approx; #define SUCCEED( ... ) (void)(0) #define ANON_TEST_CASE() INTERNAL_CATCH_TESTCASE_NO_REGISTRATION(INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_S_T____ )) +#ifndef CATCH_CONFIG_TRADITIONAL_MSVC_PREPROCESSOR +#define TEMPLATE_TEST_CASE( ... ) INTERNAL_CATCH_TEMPLATE_TEST_CASE_NO_REGISTRATION(INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_M_P_L_A_T_E____T_E_S_T____ ) ) +#define TEMPLATE_TEST_CASE_METHOD( className, ... ) INTERNAL_CATCH_TEMPLATE_TEST_CASE_METHOD_NO_REGISTRATION(INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_M_P_L_A_T_E____T_E_S_T____ ), className ) +#else +#define TEMPLATE_TEST_CASE( ... ) INTERNAL_CATCH_EXPAND_VARGS( INTERNAL_CATCH_TEMPLATE_TEST_CASE_NO_REGISTRATION(INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_M_P_L_A_T_E____T_E_S_T____ ) ) ) +#define TEMPLATE_TEST_CASE_METHOD( className, ... ) INTERNAL_CATCH_EXPAND_VARGS( INTERNAL_CATCH_TEMPLATE_TEST_CASE_METHOD_NO_REGISTRATION(INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_M_P_L_A_T_E____T_E_S_T____ ), className ) ) +#endif + +#define STATIC_REQUIRE( ... ) (void)(0) +#define STATIC_REQUIRE_FALSE( ... ) (void)(0) + #endif #define CATCH_TRANSLATE_EXCEPTION( signature ) INTERNAL_CATCH_TRANSLATE_EXCEPTION_NO_REG( INTERNAL_CATCH_UNIQUE_NAME( catch_internal_ExceptionTranslator ), signature ) diff --git a/packages/Catch2/test_package/CMakeLists.txt b/packages/Catch2/test_package/CMakeLists.txt deleted file mode 100644 index 339facbf1790ae4b2cdbfdf05863f8c6e1e46b96..0000000000000000000000000000000000000000 --- a/packages/Catch2/test_package/CMakeLists.txt +++ /dev/null @@ -1,7 +0,0 @@ -cmake_minimum_required(VERSION 3.0) -project(CatchTest CXX) - -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup() - -add_executable(${CMAKE_PROJECT_NAME} MainTest.cpp) diff --git a/packages/Catch2/test_package/MainTest.cpp b/packages/Catch2/test_package/MainTest.cpp deleted file mode 100644 index 010feba21d083f8287884549357fb2dcf5200d8f..0000000000000000000000000000000000000000 --- a/packages/Catch2/test_package/MainTest.cpp +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Created by Phil on 22/10/2010. - * Copyright 2010 Two Blue Cubes Ltd - * - * Distributed under the Boost Software License, Version 1.0. (See accompanying - * file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) - */ -#define CATCH_CONFIG_MAIN -#include <catch2/catch.hpp> - -unsigned int Factorial( unsigned int number ) { - return number > 1 ? Factorial(number-1)*number : 1; -} - -TEST_CASE( "Factorials are computed", "[factorial]" ) { - REQUIRE( Factorial(0) == 1 ); - REQUIRE( Factorial(1) == 1 ); - REQUIRE( Factorial(2) == 2 ); - REQUIRE( Factorial(3) == 6 ); - REQUIRE( Factorial(10) == 3628800 ); -} diff --git a/packages/Catch2/test_package/conanfile.py b/packages/Catch2/test_package/conanfile.py deleted file mode 100644 index e8d50f9a8b4dbdcefd7930c60eca8cb5bb01bbd8..0000000000000000000000000000000000000000 --- a/packages/Catch2/test_package/conanfile.py +++ /dev/null @@ -1,21 +0,0 @@ -#!/usr/bin/env python -from os import getenv -from os import path -from conans import ConanFile -from conans import CMake - - -class CatchConanTest(ConanFile): - generators = "cmake" - settings = "os", "compiler", "arch", "build_type" - username = getenv("CONAN_USERNAME", "philsquared") - channel = getenv("CONAN_CHANNEL", "testing") - requires = "Catch/2.4.1@%s/%s" % (username, channel) - - def build(self): - cmake = CMake(self) - cmake.configure(build_dir="./") - cmake.build() - - def test(self): - self.run(path.join("bin", "CatchTest")) diff --git a/packages/Catch2/third_party/clara.hpp b/packages/Catch2/third_party/clara.hpp index 43568cee2af04eff93463e3b37135c7101f8a2fe..6be5a98b14b0b1f4ba555619f6f54658eed9ab25 100644 --- a/packages/Catch2/third_party/clara.hpp +++ b/packages/Catch2/third_party/clara.hpp @@ -5,7 +5,7 @@ // // See https://github.com/philsquared/Clara for more details -// Clara v1.1.4 +// Clara v1.1.5 #ifndef CLARA_HPP_INCLUDED #define CLARA_HPP_INCLUDED @@ -34,8 +34,8 @@ // // A single-header library for wrapping and laying out basic text, by Phil Nash // -// This work is licensed under the BSD 2-Clause license. -// See the accompanying LICENSE file, or the one at https://opensource.org/licenses/BSD-2-Clause +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // // This project is hosted at https://github.com/philsquared/textflowcpp @@ -142,6 +142,12 @@ namespace clara { namespace TextFlow { } public: + using difference_type = std::ptrdiff_t; + using value_type = std::string; + using pointer = value_type*; + using reference = value_type&; + using iterator_category = std::forward_iterator_tag; + explicit iterator( Column const& column ) : m_column( column ) { assert( m_column.m_width > m_column.m_indent ); assert( m_column.m_initialIndent == std::string::npos || m_column.m_width > m_column.m_initialIndent ); @@ -153,10 +159,7 @@ namespace clara { namespace TextFlow { auto operator *() const -> std::string { assert( m_stringIndex < m_column.m_strings.size() ); assert( m_pos <= m_end ); - if( m_pos + m_column.m_width < m_end ) - return addIndentAndSuffix(line().substr(m_pos, m_len)); - else - return addIndentAndSuffix(line().substr(m_pos, m_end - m_pos)); + return addIndentAndSuffix(line().substr(m_pos, m_len)); } auto operator ++() -> iterator& { @@ -266,6 +269,12 @@ namespace clara { namespace TextFlow { } public: + using difference_type = std::ptrdiff_t; + using value_type = std::string; + using pointer = value_type*; + using reference = value_type&; + using iterator_category = std::forward_iterator_tag; + explicit iterator( Columns const& columns ) : m_columns( columns.m_columns ), m_activeIterators( m_columns.size() ) @@ -355,7 +364,7 @@ namespace clara { namespace TextFlow { cols += other; return cols; } -}} // namespace clara::TextFlow +}} #endif // CLARA_TEXTFLOW_HPP_INCLUDED diff --git a/packages/kokkos/.gitrepo b/packages/kokkos/.gitrepo index e20dc392b6aff485647521a06a2d2efd32558a3e..ef0c50a600b3577cd16dabfdfed75efdad75a8e6 100644 --- a/packages/kokkos/.gitrepo +++ b/packages/kokkos/.gitrepo @@ -6,6 +6,7 @@ [subrepo] remote = git@github.com:kokkos/kokkos.git branch = master - commit = d3a941925cbfb71785d8ea68259123ed52d3f9da - parent = e02f01f376b1594c9768e06f70b637965d594da9 - cmdver = 0.3.1 + commit = 9614f72c75aa2131d56900511e5eebae54a7bd8b + parent = 7fc65e3330cc86e88570067a4f99f6d794992ac1 + cmdver = 0.4.0 + method = merge diff --git a/packages/kokkos/.travis.yml b/packages/kokkos/.travis.yml index 2734954add0ab666fe7f0ec18d222ce2bd0b1652..bdeaf4762a6aae32c6b85d1988023670412a1bcd 100644 --- a/packages/kokkos/.travis.yml +++ b/packages/kokkos/.travis.yml @@ -6,18 +6,13 @@ os: - linux - osx -addons: - apt: - sources: - - ubuntu-toolchain-r-test - packages: - - cmake - - clang - compiler: - gcc - clang +cache: + - ccache + env: - THREADING="serial" - THREADING="openmp" @@ -25,22 +20,39 @@ env: # Apple GCC does not support OpenMP. GCC with OpenMP requires Homebrew. # Apple Clang does not support OpenMP. Clang with OpenMP requires Homebrew. -# Clang OpenMP support is not always available. matrix: exclude: - - compiler: clang - env: THREADING="openmp" - os: osx env: THREADING="openmp" - os: osx compiler: gcc +before_script: + - if [[ ${TRAVIS_OS_NAME} == "osx" ]]; then + brew update; + export HOMEBREW_NO_AUTO_UPDATE=1; + brew ls --versions ccache > /dev/null || brew install ccache; + export PATH=/usr/local/opt/ccache/libexec:$PATH; + fi + - ccache -z + script: - export OMP_NUM_THREADS=2 - export OMP_PLACES=threads - export OMP_PROC_BIND=spread + # LD_LIBRARY_PATH workaround to find clang's libomp: https://github.com/travis-ci/travis-ci/issues/8613 + - if [[ ${CC} = clang ]]; then export LD_LIBRARY_PATH=/usr/local/clang/lib${LD_LIBRARY_PATH:+:}$LD_LIBRARY_PATH; fi + # enable ccache for clang on linux and add CCACHE_CPP2 to avoid 'Argument unused during compilation -I...' warning + - if [[ ${TRAVIS_OS_NAME} = linux && ${CC} = clang ]]; then + ln -s /usr/bin/ccache $HOME/bin/clang++; + export CCACHE_CPP2=yes; + GENERATE_OPTS="--gcc-toolchain=/usr"; + fi - mkdir build - cd build - - ../generate_makefile.bash --compiler=$CXX --with-$THREADING --with-options=compiler_warnings + - ../generate_makefile.bash --compiler=$CXX --with-$THREADING --with-options=compiler_warnings ${GENERATE_OPTS} - make - make test + +after_success: + - ccache -s diff --git a/packages/kokkos/CHANGELOG.md b/packages/kokkos/CHANGELOG.md index 145cc62706eea04fab0bb6e3fbcb676ee03b9ef8..5564096ea10469ed4ebf5ce321ddce9f08ebd9ab 100644 --- a/packages/kokkos/CHANGELOG.md +++ b/packages/kokkos/CHANGELOG.md @@ -1,5 +1,68 @@ # Change Log +## [2.7.24](https://github.com/kokkos/kokkos/tree/2.7.24) (2018-11-04) +[Full Changelog](https://github.com/kokkos/kokkos/compare/2.7.00...2.7.24) + +**Implemented enhancements:** + +- DualView: Add non-templated functions for sync, need\_sync, view, modify [\#1858](https://github.com/kokkos/kokkos/issues/1858) +- DualView: Avoid needlessly allocates and initializes modify\_host and modify\_device flag views [\#1831](https://github.com/kokkos/kokkos/issues/1831) +- DualView: Incorrect deduction of "not device type" [\#1659](https://github.com/kokkos/kokkos/issues/1659) +- BuildSystem: Add KOKKOS\_ENABLE\_CXX14 and KOKKOS\_ENABLE\_CXX17 [\#1602](https://github.com/kokkos/kokkos/issues/1602) +- BuildSystem: Installed kokkos\_generated\_settings.cmake contains build directories instead of install directories [\#1838](https://github.com/kokkos/kokkos/issues/1838) +- BuildSystem: KOKKOS\_ARCH: add ticks to printout of improper arch setting [\#1649](https://github.com/kokkos/kokkos/issues/1649) +- BuildSystem: Make core/src/Makefile for Cuda use needed nvcc\_wrapper [\#1296](https://github.com/kokkos/kokkos/issues/1296) +- Build: Support PGI as host compiler for NVCC [\#1828](https://github.com/kokkos/kokkos/issues/1828) +- Build: Many Warnings Fixed e.g.[\#1786](https://github.com/kokkos/kokkos/issues/1786) +- Capability: OffsetView with non-zero begin index [\#567](https://github.com/kokkos/kokkos/issues/567) +- Capability: Reductions into device side view [\#1788](https://github.com/kokkos/kokkos/issues/1788) +- Capability: Add max\_size to Kokkos::Array [\#1760](https://github.com/kokkos/kokkos/issues/1760) +- Capability: View Assignment: LayoutStride -\> LayoutLeft and LayoutStride -\> LayoutRight [\#1594](https://github.com/kokkos/kokkos/issues/1594) +- Capability: Atomic function allow implicit conversion of update argument [\#1571](https://github.com/kokkos/kokkos/issues/1571) +- Capability: Add team\_size\_max with tagged functors [\#663](https://github.com/kokkos/kokkos/issues/663) +- Capability: Fix allignment of views from Kokkos\_ScratchSpace should use different alignment [\#1700](https://github.com/kokkos/kokkos/issues/1700) +- Capabilitiy: create\_mirror\_view\_and\_copy for DynRankView [\#1651](https://github.com/kokkos/kokkos/issues/1651) +- Capability: DeepCopy HBWSpace / HostSpace [\#548](https://github.com/kokkos/kokkos/issues/548) +- ROCm: support team vector scan [\#1645](https://github.com/kokkos/kokkos/issues/1645) +- ROCm: Merge from rocm-hackathon2 [\#1636](https://github.com/kokkos/kokkos/issues/1636) +- ROCm: Add ParallelScanWithTotal [\#1611](https://github.com/kokkos/kokkos/issues/1611) +- ROCm: Implement MDRange in ROCm [\#1314](https://github.com/kokkos/kokkos/issues/1314) +- ROCm: Implement Reducers for Nested Parallelism Levels [\#963](https://github.com/kokkos/kokkos/issues/963) +- ROCm: Add asynchronous deep copy [\#959](https://github.com/kokkos/kokkos/issues/959) +- Tests: Memory pool test seems to allocate 8GB [\#1830](https://github.com/kokkos/kokkos/issues/1830) +- Tests: Add unit\_test for team\_broadcast [\#734](https://github.com/kokkos/kokkos/issues/734) + +**Fixed bugs:** + +- BuildSystem: Makefile.kokkos gets gcc-toolchain wrong if gcc is cached [\#1841](https://github.com/kokkos/kokkos/issues/1841) +- BuildSystem: kokkos\_generated\_settings.cmake placement is inconsistent [\#1771](https://github.com/kokkos/kokkos/issues/1771) +- BuildSystem: Invalid escape sequence \. in kokkos\_functions.cmake [\#1661](https://github.com/kokkos/kokkos/issues/1661) +- BuildSystem: Problem in Kokkos generated cmake file [\#1770](https://github.com/kokkos/kokkos/issues/1770) +- BuildSystem: invalid file names on windows [\#1671](https://github.com/kokkos/kokkos/issues/1671) +- Tests: reducers min/max\_loc test fails randomly due to multiple min values and thus multiple valid locations [\#1681](https://github.com/kokkos/kokkos/issues/1681) +- Tests: cuda.scatterview unit test causes "Bus error" when force\_uvm and enable\_lambda are enabled [\#1852](https://github.com/kokkos/kokkos/issues/1852) +- Tests: cuda.cxx11 unit test fails when force\_uvm and enable\_lambda are enabled [\#1850](https://github.com/kokkos/kokkos/issues/1850) +- Tests: threads.reduce\_device\_view\_range\_policy failing with Cuda/8.0.44 and RDC [\#1836](https://github.com/kokkos/kokkos/issues/1836) +- Build: compile error when compiling Kokkos with hwloc 2.0.1 \(on OSX 10.12.6, with g++ 7.2.0\) [\#1506](https://github.com/kokkos/kokkos/issues/1506) +- Build: dual\_view.view broken with UVM [\#1834](https://github.com/kokkos/kokkos/issues/1834) +- Build: White cuda/9.2 + gcc/7.2 warnings triggering errors [\#1833](https://github.com/kokkos/kokkos/issues/1833) +- Build: warning: enum constant in boolean context [\#1813](https://github.com/kokkos/kokkos/issues/1813) +- Capability: Fix overly conservative max\_team\_size thingy [\#1808](https://github.com/kokkos/kokkos/issues/1808) +- DynRankView: Ctors taking ViewAllocateWithoutInitializing broken [\#1783](https://github.com/kokkos/kokkos/issues/1783) +- Cuda: Apollo cuda.team\_broadcast test fail with clang-6.0 [\#1762](https://github.com/kokkos/kokkos/issues/1762) +- Cuda: Clang spurious test failure in impl\_view\_accessible [\#1753](https://github.com/kokkos/kokkos/issues/1753) +- Cuda: Kokkos::complex\<double\> atomic deadlocks with Clang 6 Cuda build with -O0 [\#1752](https://github.com/kokkos/kokkos/issues/1752) +- Cuda: LayoutStride Test fails for UVM as default memory space [\#1688](https://github.com/kokkos/kokkos/issues/1688) +- Cuda: Scan wrong values on Volta [\#1676](https://github.com/kokkos/kokkos/issues/1676) +- Cuda: Kokkos::deep\_copy error with CudaUVM and Kokkos::Serial spaces [\#1652](https://github.com/kokkos/kokkos/issues/1652) +- Cuda: cudaErrorInvalidConfiguration with debug build [\#1647](https://github.com/kokkos/kokkos/issues/1647) +- Cuda: parallel\_for with TeamPolicy::team\_size\_recommended with launch bounds not working -- reported by Daniel Holladay [\#1283](https://github.com/kokkos/kokkos/issues/1283) +- Cuda: Using KOKKOS\_CLASS\_LAMBDA in a class with Kokkos::Random\_XorShift64\_Pool member data [\#1696](https://github.com/kokkos/kokkos/issues/1696) +- Long Build Times on Darwin [\#1721](https://github.com/kokkos/kokkos/issues/1721) +- Capability: Typo in Kokkos\_Sort.hpp - BinOp3D - wrong comparison [\#1720](https://github.com/kokkos/kokkos/issues/1720) +- Buffer overflow in SharedAllocationRecord in Kokkos\_HostSpace.cpp [\#1673](https://github.com/kokkos/kokkos/issues/1673) +- Serial unit test failure [\#1632](https://github.com/kokkos/kokkos/issues/1632) + ## [2.7.00](https://github.com/kokkos/kokkos/tree/2.7.00) (2018-05-24) [Full Changelog](https://github.com/kokkos/kokkos/compare/2.6.00...2.7.00) diff --git a/packages/kokkos/CMakeLists.txt b/packages/kokkos/CMakeLists.txt index 9e5308f1c3245ea40a01079909cd9639cf22c82f..236f523aec21e30e731937c7d5118ec3d2e2a007 100644 --- a/packages/kokkos/CMakeLists.txt +++ b/packages/kokkos/CMakeLists.txt @@ -11,7 +11,7 @@ IF(NOT KOKKOS_HAS_TRILINOS) # Define Project Name if this is a standalone build IF(NOT DEFINED ${PROJECT_NAME}) - project(Kokkos CXX) + project(Kokkos CXX) ENDIF() # Basic initialization (Used in KOKKOS_SETTINGS) @@ -22,7 +22,7 @@ IF(NOT KOKKOS_HAS_TRILINOS) include(${KOKKOS_SRC_PATH}/cmake/kokkos_functions.cmake) set_kokkos_cxx_compiler() set_kokkos_cxx_standard() - + #------------ GET OPTIONS AND KOKKOS_SETTINGS -------------------------------- # Add Kokkos' modules to CMake's module path. set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${Kokkos_SOURCE_DIR}/cmake/Modules/") @@ -34,7 +34,7 @@ IF(NOT KOKKOS_HAS_TRILINOS) #------------ GENERATE HEADER AND SOURCE FILES ------------------------------- execute_process( - COMMAND ${KOKKOS_SETTINGS} make -f ${KOKKOS_SRC_PATH}/cmake/Makefile.generate_cmake_settings CXX=${CMAKE_CXX_COMPILER} generate_build_settings + COMMAND ${KOKKOS_SETTINGS} make -f ${KOKKOS_SRC_PATH}/cmake/Makefile.generate_cmake_settings CXX=${CMAKE_CXX_COMPILER} PREFIX=${CMAKE_INSTALL_PREFIX} generate_build_settings WORKING_DIRECTORY "${Kokkos_BINARY_DIR}" OUTPUT_FILE ${Kokkos_BINARY_DIR}/core_src_make.out RESULT_VARIABLE GEN_SETTINGS_RESULT @@ -45,6 +45,7 @@ IF(NOT KOKKOS_HAS_TRILINOS) endif() include(${Kokkos_BINARY_DIR}/kokkos_generated_settings.cmake) install(FILES ${Kokkos_BINARY_DIR}/kokkos_generated_settings.cmake DESTINATION lib/cmake/Kokkos) + install(FILES ${Kokkos_BINARY_DIR}/kokkos_generated_settings.cmake DESTINATION ${CMAKE_INSTALL_PREFIX}) string(REPLACE " " ";" KOKKOS_TPL_INCLUDE_DIRS "${KOKKOS_GMAKE_TPL_INCLUDE_DIRS}") string(REPLACE " " ";" KOKKOS_TPL_LIBRARY_DIRS "${KOKKOS_GMAKE_TPL_LIBRARY_DIRS}") string(REPLACE " " ";" KOKKOS_TPL_LIBRARY_NAMES "${KOKKOS_GMAKE_TPL_LIBRARY_NAMES}") diff --git a/packages/kokkos/Makefile.kokkos b/packages/kokkos/Makefile.kokkos index 6fc70cc70aa774274af0f1b22aad15cb06d36ef4..05f3cf7811996868d618decc375b8383b7f3b1de 100644 --- a/packages/kokkos/Makefile.kokkos +++ b/packages/kokkos/Makefile.kokkos @@ -15,12 +15,13 @@ KOKKOS_ARCH ?= "" KOKKOS_DEBUG ?= "no" # Options: hwloc,librt,experimental_memkind KOKKOS_USE_TPLS ?= "" -# Options: c++11,c++1z +# Options: c++11,c++14,c++1y,c++17,c++1z,c++2a KOKKOS_CXX_STANDARD ?= "c++11" # Options: aggressive_vectorization,disable_profiling,disable_deprecated_code,enable_large_mem_tests KOKKOS_OPTIONS ?= "" # Option for setting ETI path KOKKOS_ETI_PATH ?= ${KOKKOS_PATH}/core/src/eti +KOKKOS_CMAKE ?= "no" # Default settings specific options. # Options: force_uvm,use_ldg,rdc,enable_lambda @@ -35,7 +36,11 @@ kokkos_has_string=$(if $(findstring $2,$1),1,0) # Check for general settings. KOKKOS_INTERNAL_ENABLE_DEBUG := $(call kokkos_has_string,$(KOKKOS_DEBUG),yes) KOKKOS_INTERNAL_ENABLE_CXX11 := $(call kokkos_has_string,$(KOKKOS_CXX_STANDARD),c++11) +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) # Check for external libraries. KOKKOS_INTERNAL_USE_HWLOC := $(call kokkos_has_string,$(KOKKOS_USE_TPLS),hwloc) @@ -104,6 +109,18 @@ KOKKOS_INTERNAL_COMPILER_CLANG := $(call kokkos_has_string,$(KOKKOS_CXX_VE KOKKOS_INTERNAL_COMPILER_APPLE_CLANG := $(call kokkos_has_string,$(KOKKOS_CXX_VERSION),apple-darwin) KOKKOS_INTERNAL_COMPILER_HCC := $(call kokkos_has_string,$(KOKKOS_CXX_VERSION),HCC) +# Check Host Compiler if using NVCC through nvcc_wrapper +ifeq ($(KOKKOS_INTERNAL_COMPILER_NVCC), 1) + KOKKOS_INTERNAL_COMPILER_NVCC_WRAPPER := $(strip $(shell echo $(CXX) | grep nvcc_wrapper | wc -l)) + 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 +endif + ifeq ($(KOKKOS_INTERNAL_COMPILER_CLANG), 2) KOKKOS_INTERNAL_COMPILER_CLANG = 1 endif @@ -196,18 +213,34 @@ endif # Set C++11 flags. ifeq ($(KOKKOS_INTERNAL_COMPILER_PGI), 1) KOKKOS_INTERNAL_CXX11_FLAG := --c++11 + KOKKOS_INTERNAL_CXX14_FLAG := --c++14 + #KOKKOS_INTERNAL_CXX17_FLAG := --c++17 else ifeq ($(KOKKOS_INTERNAL_COMPILER_XL), 1) KOKKOS_INTERNAL_CXX11_FLAG := -std=c++11 + #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_CXX11_FLAG := -hstd=c++11 + 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 ifeq ($(KOKKOS_INTERNAL_COMPILER_HCC), 1) KOKKOS_INTERNAL_CXX11_FLAG := else KOKKOS_INTERNAL_CXX11_FLAG := --std=c++11 + 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 endif @@ -330,7 +363,9 @@ endif #CPPFLAGS is now unused KOKKOS_CPPFLAGS = -KOKKOS_CXXFLAGS = -I./ -I$(KOKKOS_PATH)/core/src -I$(KOKKOS_PATH)/containers/src -I$(KOKKOS_PATH)/algorithms/src -I$(KOKKOS_ETI_PATH) +ifneq ($(KOKKOS_CMAKE), yes) + KOKKOS_CXXFLAGS = -I./ -I$(KOKKOS_PATH)/core/src -I$(KOKKOS_PATH)/containers/src -I$(KOKKOS_PATH)/algorithms/src -I$(KOKKOS_ETI_PATH) +endif KOKKOS_TPL_INCLUDE_DIRS = KOKKOS_TPL_LIBRARY_DIRS = KOKKOS_TPL_LIBRARY_NAMES = @@ -341,9 +376,11 @@ endif KOKKOS_LIBS = -ldl KOKKOS_TPL_LIBRARY_NAMES += dl -KOKKOS_LDFLAGS = -L$(shell pwd) -# CXXLDFLAGS is used together with CXXFLAGS in a combined compile/link command -KOKKOS_CXXLDFLAGS = -L$(shell pwd) +ifneq ($(KOKKOS_CMAKE), yes) + KOKKOS_LDFLAGS = -L$(shell pwd) + # CXXLDFLAGS is used together with CXXFLAGS in a combined compile/link command + KOKKOS_CXXLDFLAGS = -L$(shell pwd) +endif KOKKOS_LINK_FLAGS = KOKKOS_SRC = KOKKOS_HEADERS = @@ -371,10 +408,12 @@ tmp := $(call kokkos_append_header,"/* Execution Spaces */") ifeq ($(KOKKOS_INTERNAL_USE_CUDA), 1) tmp := $(call kokkos_append_header,"\#define KOKKOS_ENABLE_CUDA") + tmp := $(call kokkos_append_header,"\#define KOKKOS_COMPILER_CUDA_VERSION $(KOKKOS_INTERNAL_COMPILER_NVCC_VERSION)") endif ifeq ($(KOKKOS_INTERNAL_USE_ROCM), 1) tmp := $(call kokkos_append_header,'\#define KOKKOS_ENABLE_ROCM') + tmp := $(call kokkos_append_header,'\#define KOKKOS_IMPL_ROCM_CLANG_WORKAROUND 1') endif ifeq ($(KOKKOS_INTERNAL_USE_OPENMPTARGET), 1) @@ -432,11 +471,25 @@ ifeq ($(KOKKOS_INTERNAL_ENABLE_CXX11), 1) KOKKOS_CXXFLAGS += $(KOKKOS_INTERNAL_CXX11_FLAG) tmp := $(call kokkos_append_header,"\#define KOKKOS_ENABLE_CXX11") endif - +ifeq ($(KOKKOS_INTERNAL_ENABLE_CXX14), 1) + KOKKOS_CXXFLAGS += $(KOKKOS_INTERNAL_CXX14_FLAG) + tmp := $(call kokkos_append_header,"\#define KOKKOS_ENABLE_CXX14") +endif +ifeq ($(KOKKOS_INTERNAL_ENABLE_CXX1Y), 1) + KOKKOS_CXXFLAGS += $(KOKKOS_INTERNAL_CXX1Y_FLAG) + tmp := $(call kokkos_append_header,"\#define KOKKOS_ENABLE_CXX14") +endif +ifeq ($(KOKKOS_INTERNAL_ENABLE_CXX17), 1) + KOKKOS_CXXFLAGS += $(KOKKOS_INTERNAL_CXX17_FLAG) + tmp := $(call kokkos_append_header,"\#define KOKKOS_ENABLE_CXX17") +endif ifeq ($(KOKKOS_INTERNAL_ENABLE_CXX1Z), 1) KOKKOS_CXXFLAGS += $(KOKKOS_INTERNAL_CXX1Z_FLAG) - tmp := $(call kokkos_append_header,"\#define KOKKOS_ENABLE_CXX11") - tmp := $(call kokkos_append_header,"\#define KOKKOS_ENABLE_CXX1Z") + tmp := $(call kokkos_append_header,"\#define KOKKOS_ENABLE_CXX17") +endif +ifeq ($(KOKKOS_INTERNAL_ENABLE_CXX2A), 1) + KOKKOS_CXXFLAGS += $(KOKKOS_INTERNAL_CXX2A_FLAG) + tmp := $(call kokkos_append_header,"\#define KOKKOS_ENABLE_CXX20") endif ifeq ($(KOKKOS_INTERNAL_ENABLE_DEBUG), 1) @@ -459,7 +512,9 @@ endif ifeq ($(KOKKOS_INTERNAL_USE_HWLOC), 1) ifneq ($(HWLOC_PATH),) - KOKKOS_CXXFLAGS += -I$(HWLOC_PATH)/include + ifneq ($(KOKKOS_CMAKE), yes) + KOKKOS_CXXFLAGS += -I$(HWLOC_PATH)/include + endif KOKKOS_LDFLAGS += -L$(HWLOC_PATH)/lib KOKKOS_CXXLDFLAGS += -L$(HWLOC_PATH)/lib KOKKOS_TPL_INCLUDE_DIRS += $(HWLOC_PATH)/include @@ -478,7 +533,9 @@ endif ifeq ($(KOKKOS_INTERNAL_USE_MEMKIND), 1) ifneq ($(MEMKIND_PATH),) - KOKKOS_CXXFLAGS += -I$(MEMKIND_PATH)/include + ifneq ($(KOKKOS_CMAKE), yes) + KOKKOS_CXXFLAGS += -I$(MEMKIND_PATH)/include + endif KOKKOS_LDFLAGS += -L$(MEMKIND_PATH)/lib KOKKOS_CXXLDFLAGS += -L$(MEMKIND_PATH)/lib KOKKOS_TPL_INCLUDE_DIRS += $(MEMKIND_PATH)/include @@ -971,7 +1028,9 @@ ifeq ($(KOKKOS_INTERNAL_ENABLE_ETI), 1) endif KOKKOS_HEADERS += $(wildcard $(KOKKOS_PATH)/core/src/Cuda/*.hpp) ifneq ($(CUDA_PATH),) - KOKKOS_CXXFLAGS += -I$(CUDA_PATH)/include + ifneq ($(KOKKOS_CMAKE), yes) + KOKKOS_CXXFLAGS += -I$(CUDA_PATH)/include + endif KOKKOS_LDFLAGS += -L$(CUDA_PATH)/lib64 KOKKOS_CXXLDFLAGS += -L$(CUDA_PATH)/lib64 KOKKOS_TPL_INCLUDE_DIRS += $(CUDA_PATH)/include @@ -1026,7 +1085,9 @@ ifeq ($(KOKKOS_INTERNAL_USE_QTHREADS), 1) KOKKOS_SRC += $(wildcard $(KOKKOS_PATH)/core/src/Qthreads/*.cpp) KOKKOS_HEADERS += $(wildcard $(KOKKOS_PATH)/core/src/Qthreads/*.hpp) ifneq ($(QTHREADS_PATH),) - KOKKOS_CXXFLAGS += -I$(QTHREADS_PATH)/include + ifneq ($(KOKKOS_CMAKE), yes) + KOKKOS_CXXFLAGS += -I$(QTHREADS_PATH)/include + endif KOKKOS_LDFLAGS += -L$(QTHREADS_PATH)/lib KOKKOS_CXXLDFLAGS += -L$(QTHREADS_PATH)/lib KOKKOS_TPL_INCLUDE_DIRS += $(QTHREADS_PATH)/include diff --git a/packages/kokkos/README b/packages/kokkos/README index 31d134bf0add74cf9b36571a3649cf5724f48087..4b6d4170e08ccd3b3bdbbc5eacfc055971246abf 100644 --- a/packages/kokkos/README +++ b/packages/kokkos/README @@ -52,44 +52,47 @@ For specifics see the LICENSE file contained in the repository or distribution. * GCC 4.8.4 * GCC 4.9.3 * GCC 5.1.0 - * GCC 5.3.0 + * GCC 5.5.0 * GCC 6.1.0 + * GCC 7.2.0 + * GCC 7.3.0 + * GCC 8.1.0 * Intel 15.0.2 * Intel 16.0.1 - * Intel 17.1.043 + * Intel 17.0.1 * Intel 17.4.196 - * Intel 18.0.128 + * Intel 18.2.128 * Clang 3.6.1 * Clang 3.7.1 * Clang 3.8.1 * Clang 3.9.0 * Clang 4.0.0 - * Clang 4.0.0 for CUDA (CUDA Toolkit 8.0.44) - * Clang 6.0.0 for CUDA (CUDA Toolkit 9.1) - * PGI 17.10 - * NVCC 7.0 for CUDA (with gcc 4.8.4) + * Clang 6.0.0 for CUDA (CUDA Toolkit 9.0) + * Clang 7.0.0 for CUDA (CUDA Toolkit 9.1) + * PGI 18.7 * NVCC 7.5 for CUDA (with gcc 4.8.4) * NVCC 8.0.44 for CUDA (with gcc 5.3.0) * NVCC 9.1 for CUDA (with gcc 6.1.0) ### Primary tested compilers on Power 8 are: - * GCC 5.4.0 (OpenMP,Serial) - * IBM XL 13.1.6 (OpenMP, Serial) - * NVCC 8.0.44 for CUDA (with gcc 5.4.0) - * NVCC 9.0.103 for CUDA (with gcc 6.3.0 and XL 13.1.6) + * GCC 6.4.0 (OpenMP,Serial) + * GCC 7.2.0 (OpenMP,Serial) + * IBM XL 16.1.0 (OpenMP, Serial) + * NVCC 9.2.88 for CUDA (with gcc 7.2.0 and XL 16.1.0) ### Primary tested compilers on Intel KNL are: - * GCC 6.2.0 * Intel 16.4.258 (with gcc 4.7.2) * Intel 17.2.174 (with gcc 4.9.3) - * Intel 18.0.128 (with gcc 4.9.3) + * Intel 18.2.199 (with gcc 4.9.3) -### Primary tested compilers on ARM - * GCC 6.1.0 +### Primary tested compilers on ARM (Cavium ThunderX2) + * GCC 7.2.0 + * ARM/Clang 18.4.0 ### Other compilers working: * X86: - Cygwin 2.1.0 64bit with gcc 4.9.3 + - GCC 8.1.0 (not warning free) ### Known non-working combinations: * Power8: diff --git a/packages/kokkos/algorithms/src/Kokkos_Random.hpp b/packages/kokkos/algorithms/src/Kokkos_Random.hpp index 5f1d88bfffbfa90dd2a68361d8ef17e853a5bc8a..e14471a48aed374e3204f9577d9751b49e209a82 100644 --- a/packages/kokkos/algorithms/src/Kokkos_Random.hpp +++ b/packages/kokkos/algorithms/src/Kokkos_Random.hpp @@ -697,6 +697,7 @@ namespace Kokkos { typedef Random_XorShift64<DeviceType> generator_type; typedef DeviceType device_type; + KOKKOS_INLINE_FUNCTION Random_XorShift64_Pool() { num_states_ = 0; } @@ -709,12 +710,14 @@ namespace Kokkos { #endif } + 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_; @@ -958,6 +961,7 @@ namespace Kokkos { typedef DeviceType device_type; + KOKKOS_INLINE_FUNCTION Random_XorShift1024_Pool() { num_states_ = 0; } @@ -972,6 +976,7 @@ namespace Kokkos { #endif } + KOKKOS_INLINE_FUNCTION Random_XorShift1024_Pool(const Random_XorShift1024_Pool& src): locks_(src.locks_), state_(src.state_), @@ -979,6 +984,7 @@ namespace Kokkos { num_states_(src.num_states_) {} + KOKKOS_INLINE_FUNCTION Random_XorShift1024_Pool operator = (const Random_XorShift1024_Pool& src) { locks_ = src.locks_; state_ = src.state_; diff --git a/packages/kokkos/algorithms/src/Kokkos_Sort.hpp b/packages/kokkos/algorithms/src/Kokkos_Sort.hpp index c952b1e541af767d346ae2fdd2cea6c16c84a3eb..8bdd876723520da4672f3f58659f46d58db1539f 100644 --- a/packages/kokkos/algorithms/src/Kokkos_Sort.hpp +++ b/packages/kokkos/algorithms/src/Kokkos_Sort.hpp @@ -246,8 +246,8 @@ public: { bin_count_atomic = Kokkos::View<int*, Space >("Kokkos::SortImpl::BinSortFunctor::bin_count",bin_op.max_bins()); bin_count_const = bin_count_atomic; - bin_offsets = offset_type("Kokkos::SortImpl::BinSortFunctor::bin_offsets",bin_op.max_bins()); - sort_order = offset_type("PermutationVector",range_end-range_begin); + bin_offsets = offset_type(ViewAllocateWithoutInitializing("Kokkos::SortImpl::BinSortFunctor::bin_offsets"),bin_op.max_bins()); + sort_order = offset_type(ViewAllocateWithoutInitializing("Kokkos::SortImpl::BinSortFunctor::sort_order"),range_end-range_begin); } BinSort( const_key_view_type keys_ @@ -290,7 +290,7 @@ public: #ifdef KOKKOS_ENABLE_DEPRECATED_CODE scratch_view_type - sorted_values("Scratch", + sorted_values(ViewAllocateWithoutInitializing("Kokkos::SortImpl::BinSortFunctor::sorted_values"), len, values.extent(1), values.extent(2), @@ -301,7 +301,7 @@ public: values.extent(7)); #else scratch_view_type - sorted_values("Scratch", + sorted_values(ViewAllocateWithoutInitializing("Kokkos::SortImpl::BinSortFunctor::sorted_values"), values.rank_dynamic > 0 ? len : KOKKOS_IMPL_CTOR_DEFAULT_ARG, values.rank_dynamic > 1 ? values.extent(1) : KOKKOS_IMPL_CTOR_DEFAULT_ARG , values.rank_dynamic > 2 ? values.extent(2) : KOKKOS_IMPL_CTOR_DEFAULT_ARG, @@ -483,7 +483,7 @@ struct BinOp3D { if (keys(i1,0)>keys(i2,0)) return true; else if (keys(i1,0)==keys(i2,0)) { if (keys(i1,1)>keys(i2,1)) return true; - else if (keys(i1,1)==keys(i2,2)) { + else if (keys(i1,1)==keys(i2,1)) { if (keys(i1,2)>keys(i2,2)) return true; } } diff --git a/packages/kokkos/benchmarks/gups/Makefile b/packages/kokkos/benchmarks/gups/Makefile new file mode 100644 index 0000000000000000000000000000000000000000..7176111664c4447a32fb61913e9074cde0116cd8 --- /dev/null +++ b/packages/kokkos/benchmarks/gups/Makefile @@ -0,0 +1,41 @@ +#Set your Kokkos path to something appropriate +KOKKOS_PATH = ${HOME}/git/kokkos-github-repo +KOKKOS_DEVICES = "Cuda" +KOKKOS_ARCH = "Pascal60" +KOKKOS_CUDA_OPTIONS = enable_lambda +#KOKKOS_DEVICES = "OpenMP" +#KOKKOS_ARCH = "Power8" + +SRC = gups-kokkos.cc + +default: build + echo "Start Build" + +CXXFLAGS = -O3 +CXX = ${HOME}/git/kokkos-github-repo/bin/nvcc_wrapper +#CXX = g++ + +LINK = ${CXX} + +LINKFLAGS = +EXE = gups-kokkos + +DEPFLAGS = -M + +OBJ = $(SRC:.cc=.o) +LIB = + +include $(KOKKOS_PATH)/Makefile.kokkos + +build: $(EXE) + +$(EXE): $(OBJ) $(KOKKOS_LINK_DEPENDS) + $(LINK) $(KOKKOS_LDFLAGS) $(LINKFLAGS) $(EXTRA_PATH) $(OBJ) $(KOKKOS_LIBS) $(LIB) -o $(EXE) + +clean: kokkos-clean + rm -f *.o $(EXE) + +# Compilation rules + +%.o:%.cc $(KOKKOS_CPP_DEPENDS) + $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) $(EXTRA_INC) -c $< diff --git a/packages/kokkos/benchmarks/gups/gups-kokkos.cc b/packages/kokkos/benchmarks/gups/gups-kokkos.cc new file mode 100644 index 0000000000000000000000000000000000000000..4602adda7937cc0dfc8939527353f8936961fed3 --- /dev/null +++ b/packages/kokkos/benchmarks/gups/gups-kokkos.cc @@ -0,0 +1,199 @@ +/* +//@HEADER +// ************************************************************************ +// +// Kokkos v. 2.0 +// Copyright (2014) Sandia Corporation +// +// Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, +// the U.S. Government retains certain rights in this software. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// +// 3. Neither the name of the Corporation nor the names of the +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY +// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE +// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// ************************************************************************ +//@HEADER +*/ + +#include "Kokkos_Core.hpp" +#include <cstdio> +#include <cstdlib> +#include <cmath> + +#include <sys/time.h> + +#define HLINE "-------------------------------------------------------------\n" + +#if defined(KOKKOS_ENABLE_CUDA) +typedef Kokkos::View<int64_t*, Kokkos::CudaSpace>::HostMirror GUPSHostArray; +typedef Kokkos::View<int64_t*, Kokkos::CudaSpace> GUPSDeviceArray; +#else +typedef Kokkos::View<int64_t*, Kokkos::HostSpace>::HostMirror GUPSHostArray; +typedef Kokkos::View<int64_t*, Kokkos::HostSpace> GUPSDeviceArray; +#endif + +typedef int GUPSIndex; + +double now() { + struct timeval now; + gettimeofday(&now, NULL); + + return (double) now.tv_sec + ((double) now.tv_usec * 1.0e-6); +} + +void randomize_indices(GUPSHostArray& indices, GUPSDeviceArray& dev_indices, const int64_t dataCount) { + for( GUPSIndex i = 0; i < indices.extent(0); ++i ) { + indices[i] = lrand48() % dataCount; + } + + Kokkos::deep_copy(dev_indices, indices); +} + +void run_gups(GUPSDeviceArray& indices, GUPSDeviceArray& data, const int64_t datum, + const bool performAtomics) { + + if( performAtomics ) { + Kokkos::parallel_for("bench-gups-atomic", indices.extent(0), KOKKOS_LAMBDA(const GUPSIndex i) { + Kokkos::atomic_fetch_xor( &data[indices[i]], datum ); + }); + } else { + Kokkos::parallel_for("bench-gups-non-atomic", indices.extent(0), KOKKOS_LAMBDA(const GUPSIndex i) { + data[indices[i]] ^= datum; + }); + } + + Kokkos::fence(); +} + +int run_benchmark(const GUPSIndex indicesCount, const GUPSIndex dataCount, const int repeats, + const bool useAtomics) { + + printf("Reports fastest timing per kernel\n"); + printf("Creating Views...\n"); + + printf("Memory Sizes:\n"); + printf("- Elements: %15" PRIu64 " (%12.4f MB)\n", static_cast<uint64_t>(dataCount), + 1.0e-6 * ((double) dataCount * (double) sizeof(int64_t))); + printf("- Indices: %15" PRIu64 " (%12.4f MB)\n", static_cast<uint64_t>(indicesCount), + 1.0e-6 * ((double) indicesCount * (double) sizeof(int64_t))); + printf(" - Atomics: %15s\n", (useAtomics ? "Yes" : "No") ); + printf("Benchmark kernels will be performed for %d iterations.\n", repeats); + + printf(HLINE); + + GUPSDeviceArray dev_indices("indices", indicesCount); + GUPSDeviceArray dev_data("data", dataCount); + int64_t datum = -1; + + GUPSHostArray indices = Kokkos::create_mirror_view(dev_indices); + GUPSHostArray data = Kokkos::create_mirror_view(dev_data); + + double gupsTime = 0.0; + + printf("Initializing Views...\n"); + +#if defined(KOKKOS_HAVE_OPENMP) + Kokkos::parallel_for("init-data", Kokkos::RangePolicy<Kokkos::OpenMP>(0, dataCount), +#else + Kokkos::parallel_for("init-data", Kokkos::RangePolicy<Kokkos::Serial>(0, dataCount), +#endif + KOKKOS_LAMBDA(const int i) { + + data[i] = 10101010101; + }); + +#if defined(KOKKOS_HAVE_OPENMP) + Kokkos::parallel_for("init-indices", Kokkos::RangePolicy<Kokkos::OpenMP>(0, indicesCount), +#else + Kokkos::parallel_for("init-indices", Kokkos::RangePolicy<Kokkos::Serial>(0, indicesCount), +#endif + KOKKOS_LAMBDA(const int i) { + + indices[i] = 0; + }); + + Kokkos::deep_copy(dev_data, data); + Kokkos::deep_copy(dev_indices, indices); + double start; + + printf("Starting benchmarking...\n"); + + for( GUPSIndex k = 0; k < repeats; ++k ) { + randomize_indices(indices, dev_indices, data.extent(0)); + + start = now(); + run_gups(dev_indices, dev_data, datum, useAtomics); + gupsTime += now() - start; + } + + Kokkos::deep_copy(indices, dev_indices); + Kokkos::deep_copy(data, dev_data); + + printf(HLINE); + printf("GUP/s Random: %18.6f\n", + (1.0e-9 * ((double) repeats) * (double) dev_indices.extent(0)) / gupsTime); + printf(HLINE); + + return 0; +} + +int main(int argc, char* argv[]) { + + printf(HLINE); + printf("Kokkos GUPS Benchmark\n"); + printf(HLINE); + + srand48(1010101); + + Kokkos::initialize(argc, argv); + + int64_t indices = 8192; + int64_t data = 33554432; + int64_t repeats = 10; + bool useAtomics = false; + + for( int i = 1; i < argc; ++i ) { + if( strcmp( argv[i], "--indices" ) == 0 ) { + indices = std::atoll(argv[i+1]); + ++i; + } else if( strcmp( argv[i], "--data" ) == 0 ) { + data = std::atoll(argv[i+1]); + ++i; + } else if( strcmp( argv[i], "--repeats" ) == 0 ) { + repeats = std::atoll(argv[i+1]); + ++i; + } else if( strcmp( argv[i], "--atomics" ) == 0 ) { + useAtomics = true; + } + } + + const int rc = run_benchmark(indices, data, repeats, useAtomics); + + Kokkos::finalize(); + + return rc; +} diff --git a/packages/kokkos/benchmarks/stream/Makefile b/packages/kokkos/benchmarks/stream/Makefile new file mode 100644 index 0000000000000000000000000000000000000000..04566b322db854878c2eed3864ab6914ea3e81ad --- /dev/null +++ b/packages/kokkos/benchmarks/stream/Makefile @@ -0,0 +1,41 @@ +#Set your Kokkos path to something appropriate +KOKKOS_PATH = ${HOME}/git/kokkos-github-repo +#KOKKOS_DEVICES = "Cuda" +#KOKKOS_ARCH = "Pascal60" +#KOKKOS_CUDA_OPTIONS = enable_lambda +KOKKOS_DEVICES = "OpenMP" +KOKKOS_ARCH = "Power8" + +SRC = stream-kokkos.cc + +default: build + echo "Start Build" + +CXXFLAGS = -O3 +#CXX = ${HOME}/git/kokkos-github-repo/bin/nvcc_wrapper +CXX = g++ + +LINK = ${CXX} + +LINKFLAGS = +EXE = stream-kokkos + +DEPFLAGS = -M + +OBJ = $(SRC:.cc=.o) +LIB = + +include $(KOKKOS_PATH)/Makefile.kokkos + +build: $(EXE) + +$(EXE): $(OBJ) $(KOKKOS_LINK_DEPENDS) + $(LINK) $(KOKKOS_LDFLAGS) $(LINKFLAGS) $(EXTRA_PATH) $(OBJ) $(KOKKOS_LIBS) $(LIB) -o $(EXE) + +clean: kokkos-clean + rm -f *.o $(EXE) + +# Compilation rules + +%.o:%.cc $(KOKKOS_CPP_DEPENDS) + $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) $(EXTRA_INC) -c $< diff --git a/packages/kokkos/benchmarks/stream/stream-kokkos.cc b/packages/kokkos/benchmarks/stream/stream-kokkos.cc new file mode 100644 index 0000000000000000000000000000000000000000..370995432e5833490b5cd7b42331d676ef5b8f63 --- /dev/null +++ b/packages/kokkos/benchmarks/stream/stream-kokkos.cc @@ -0,0 +1,265 @@ +/* +//@HEADER +// ************************************************************************ +// +// Kokkos v. 2.0 +// Copyright (2014) Sandia Corporation +// +// Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, +// the U.S. Government retains certain rights in this software. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// +// 3. Neither the name of the Corporation nor the names of the +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY +// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE +// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// ************************************************************************ +//@HEADER +*/ + +#include "Kokkos_Core.hpp" +#include <cstdio> +#include <cstdlib> +#include <cmath> + +#include <sys/time.h> + +#define STREAM_ARRAY_SIZE 100000000 +#define STREAM_NTIMES 20 + +#define HLINE "-------------------------------------------------------------\n" + +#if defined(KOKKOS_ENABLE_CUDA) +typedef Kokkos::View<double*, Kokkos::CudaSpace>::HostMirror StreamHostArray; +typedef Kokkos::View<double*, Kokkos::CudaSpace> StreamDeviceArray; +#else +typedef Kokkos::View<double*, Kokkos::HostSpace>::HostMirror StreamHostArray; +typedef Kokkos::View<double*, Kokkos::HostSpace> StreamDeviceArray; +#endif + +typedef int StreamIndex; + +double now() { + struct timeval now; + gettimeofday(&now, NULL); + + return (double) now.tv_sec + ((double) now.tv_usec * 1.0e-6); +} + +void perform_copy(StreamDeviceArray& a, StreamDeviceArray& b, StreamDeviceArray& c) { + + Kokkos::parallel_for("copy", a.extent(0), KOKKOS_LAMBDA(const StreamIndex i) { + c[i] = a[i]; + }); + + Kokkos::fence(); +} + +void perform_scale(StreamDeviceArray& a, StreamDeviceArray& b, StreamDeviceArray& c, + const double scalar) { + + Kokkos::parallel_for("copy", a.extent(0), KOKKOS_LAMBDA(const StreamIndex i) { + b[i] = scalar * c[i]; + }); + + Kokkos::fence(); +} + +void perform_add(StreamDeviceArray& a, StreamDeviceArray& b, StreamDeviceArray& c) { + Kokkos::parallel_for("add", a.extent(0), KOKKOS_LAMBDA(const StreamIndex i) { + c[i] = a[i] + b[i]; + }); + + Kokkos::fence(); +} + +void perform_triad(StreamDeviceArray& a, StreamDeviceArray& b, StreamDeviceArray& c, + const double scalar) { + + Kokkos::parallel_for("triad", a.extent(0), KOKKOS_LAMBDA(const StreamIndex i) { + a[i] = b[i] + scalar * c[i]; + }); + + Kokkos::fence(); +} + +int perform_validation(StreamHostArray& a, StreamHostArray& b, StreamHostArray& c, + const StreamIndex arraySize, const double scalar) { + + double ai = 1.0; + double bi = 2.0; + double ci = 0.0; + + for( StreamIndex i = 0; i < arraySize; ++i ) { + ci = ai; + bi = scalar * ci; + ci = ai + bi; + ai = bi + scalar * ci; + }; + + double aError = 0.0; + double bError = 0.0; + double cError = 0.0; + + for( StreamIndex i = 0; i < arraySize; ++i ) { + aError = std::abs( a[i] - ai ); + bError = std::abs( b[i] - bi ); + cError = std::abs( c[i] - ci ); + } + + double aAvgError = aError / (double) arraySize; + double bAvgError = bError / (double) arraySize; + double cAvgError = cError / (double) arraySize; + + const double epsilon = 1.0e-13; + int errorCount = 0; + + if( std::abs( aAvgError / ai ) > epsilon ) { + fprintf(stderr, "Error: validation check on View a failed.\n"); + errorCount++; + } + + if( std::abs( bAvgError / bi ) > epsilon ) { + fprintf(stderr, "Error: validation check on View b failed.\n"); + errorCount++; + } + + if( std::abs( cAvgError / ci ) > epsilon ) { + fprintf(stderr, "Error: validation check on View c failed.\n"); + errorCount++; + } + + if( errorCount == 0 ) { + printf("All solutions checked and verified.\n"); + } + + return errorCount; +} + +int run_benchmark() { + + printf("Reports fastest timing per kernel\n"); + printf("Creating Views...\n"); + + printf("Memory Sizes:\n"); + printf("- Array Size: %" PRIu64 "\n", static_cast<uint64_t>(STREAM_ARRAY_SIZE)); + printf("- Per Array: %12.2f MB\n", 1.0e-6 * (double) STREAM_ARRAY_SIZE * (double) sizeof(double)); + printf("- Total: %12.2f MB\n", 3.0e-6 * (double) STREAM_ARRAY_SIZE * (double) sizeof(double)); + + printf("Benchmark kernels will be performed for %d iterations.\n", STREAM_NTIMES); + + printf(HLINE); + + StreamDeviceArray dev_a("a", STREAM_ARRAY_SIZE); + StreamDeviceArray dev_b("b", STREAM_ARRAY_SIZE); + StreamDeviceArray dev_c("c", STREAM_ARRAY_SIZE); + + StreamHostArray a = Kokkos::create_mirror_view(dev_a); + StreamHostArray b = Kokkos::create_mirror_view(dev_b); + StreamHostArray c = Kokkos::create_mirror_view(dev_c); + + const double scalar = 3.0; + + double copyTime = std::numeric_limits<double>::max(); + double scaleTime = std::numeric_limits<double>::max(); + double addTime = std::numeric_limits<double>::max(); + double triadTime = std::numeric_limits<double>::max(); + + printf("Initializing Views...\n"); + +#if defined(KOKKOS_HAVE_OPENMP) + Kokkos::parallel_for("init", Kokkos::RangePolicy<Kokkos::OpenMP>(0, STREAM_ARRAY_SIZE), +#else + Kokkos::parallel_for("init", Kokkos::RangePolicy<Kokkos::Serial>(0, STREAM_ARRAY_SIZE), +#endif + KOKKOS_LAMBDA(const int i) { + + a[i] = 1.0; + b[i] = 2.0; + c[i] = 0.0; + }); + + // Copy contents of a (from the host) to the dev_a (device) + Kokkos::deep_copy(dev_a, a); + Kokkos::deep_copy(dev_b, b); + Kokkos::deep_copy(dev_c, c); + + double start; + + printf("Starting benchmarking...\n"); + + for( StreamIndex k = 0; k < STREAM_NTIMES; ++k ) { + start = now(); + perform_copy(dev_a, dev_b, dev_c); + copyTime = std::min( copyTime, (now() - start) ); + + start = now(); + perform_scale(dev_a, dev_b, dev_c, scalar); + scaleTime = std::min( scaleTime, (now() - start) ); + + start = now(); + perform_add(dev_a, dev_b, dev_c); + addTime = std::min( addTime, (now() - start) ); + + start = now(); + perform_triad(dev_a, dev_b, dev_c, scalar); + triadTime = std::min( triadTime, (now() - start) ); + } + + Kokkos::deep_copy(a, dev_a); + Kokkos::deep_copy(b, dev_b); + Kokkos::deep_copy(c, dev_c); + + printf("Performing validation...\n"); + int rc = perform_validation(a, b, c, STREAM_ARRAY_SIZE, scalar); + + printf(HLINE); + + printf("Copy %11.2f MB/s\n", + ( 1.0e-06 * 2.0 * (double) sizeof(double) * (double) STREAM_ARRAY_SIZE) / copyTime ); + printf("Scale %11.2f MB/s\n", + ( 1.0e-06 * 2.0 * (double) sizeof(double) * (double) STREAM_ARRAY_SIZE) / scaleTime ); + printf("Add %11.2f MB/s\n", + ( 1.0e-06 * 3.0 * (double) sizeof(double) * (double) STREAM_ARRAY_SIZE) / addTime ); + printf("Triad %11.2f MB/s\n", + ( 1.0e-06 * 3.0 * (double) sizeof(double) * (double) STREAM_ARRAY_SIZE) / triadTime ); + + printf(HLINE); + + return rc; +} + +int main(int argc, char* argv[]) { + + printf(HLINE); + printf("Kokkos STREAM Benchmark\n"); + printf(HLINE); + + Kokkos::initialize(argc, argv); + const int rc = run_benchmark(); + Kokkos::finalize(); + + return rc; +} diff --git a/packages/kokkos/bin/hpcbind b/packages/kokkos/bin/hpcbind index 92f9f81ac90374dcaf4e0d77c230d2f12713f649..b185a9282177321060add2a01e60b35bcc4aae10 100755 --- a/packages/kokkos/bin/hpcbind +++ b/packages/kokkos/bin/hpcbind @@ -125,18 +125,20 @@ function show_help { echo " --openmp-ratio=N/D Ratio of the cpuset to use for OpenMP" echo " Default: 1" echo " --openmp-places=<Op> Op=threads|cores|sockets. Default: threads" - echo " --no-openmp-proc-bind Set OMP_PROC_BIND to false and unset OMP_PLACES" - echo " --force-openmp-num-threads=N" + echo " --openmp-num-threads=N" echo " Override logic for selecting OMP_NUM_THREADS" - echo " --force-openmp-proc-bind=<OP>" + echo " --openmp-proc-bind=<OP>" echo " Override logic for selecting OMP_PROC_BIND" - echo " --no-openmp-nested Set OMP_NESTED to false" + echo " --openmp-nested Set OMP_NESTED to true" + echo " --no-openmp-proc-bind Set OMP_PROC_BIND to false and unset OMP_PLACES" echo " --output-prefix=<P> Save the output to files of the form" echo " P.hpcbind.N, P.stdout.N and P.stderr.N where P is " echo " the prefix and N is the rank (no spaces)" echo " --output-mode=<Op> How console output should be handled." echo " Options are all, rank0, and none. Default: rank0" echo " --lstopo Show bindings in lstopo" + echo " --save-topology=<Xml> Save the topology to the given xml file" + echo " --load-topology=<Xml> Load a previously saved topology from an xml file" echo " -v|--verbose Print bindings and relevant environment variables" echo " -h|--help Show this message" echo "" @@ -189,7 +191,7 @@ HPCBIND_OPENMP_PLACES=${OMP_PLACES:-threads} declare -i HPCBIND_OPENMP_PROC_BIND=1 HPCBIND_OPENMP_FORCE_NUM_THREADS="" HPCBIND_OPENMP_FORCE_PROC_BIND="" -declare -i HPCBIND_OPENMP_NESTED=1 +declare -i HPCBIND_OPENMP_NESTED=0 declare -i HPCBIND_VERBOSE=0 declare -i HPCBIND_LSTOPO=0 @@ -197,6 +199,9 @@ declare -i HPCBIND_LSTOPO=0 HPCBIND_OUTPUT_PREFIX="" HPCBIND_OUTPUT_MODE="rank0" +HPCBIND_OUTPUT_TOPOLOGY="" +HPCBIND_INPUT_TOPOLOGY="" + declare -i HPCBIND_HAS_COMMAND=0 for i in "$@"; do @@ -276,10 +281,22 @@ for i in "$@"; do HPCBIND_OPENMP_NESTED=0 shift ;; + --openmp-nested) + HPCBIND_OPENMP_NESTED=1 + shift + ;; --output-prefix=*) HPCBIND_OUTPUT_PREFIX="${i#*=}" shift ;; + --save-topology=*) + HPCBIND_OUTPUT_TOPOLOGY="${i#*=}" + shift + ;; + --load-topology=*) + HPCBIND_INPUT_TOPOLOGY="${i#*=}" + shift + ;; --output-mode=*) HPCBIND_OUTPUT_MODE="${i#*=}" #convert to lower case @@ -327,24 +344,37 @@ elif [[ ${HPCBIND_QUEUE_RANK} -eq 0 ]]; then HPCBIND_TEE=1 fi +# Save the topology to the given xml file +if [[ "${HPCBIND_OUTPUT_TOPOLOGY}" != "" ]]; then + if [[ ${HPCBIND_QUEUE_RANK} -eq 0 ]]; then + lstopo-no-graphics "${HPCBIND_OUTPUT_TOPOLOGY}" + else + lstopo-no-graphics >/dev/null 2>&1 + fi +fi + +# Load the topology to the given xml file +if [[ "${HPCBIND_INPUT_TOPOLOGY}" != "" ]]; then + if [ -f ${HPCBIND_INPUT_TOPOLOGY} ]; then + export HWLOC_XMLFILE="${HPCBIND_INPUT_TOPOLOGY}" + export HWLOC_THISSYSTEM=1 + fi +fi if [[ "${HPCBIND_OUTPUT_PREFIX}" == "" ]]; then HPCBIND_LOG=/dev/null HPCBIND_ERR=/dev/null HPCBIND_OUT=/dev/null else - if [[ ${HPCBIND_QUEUE_SIZE} -gt 0 ]]; then - HPCBIND_STR_QUEUE_SIZE="${HPCBIND_QUEUE_SIZE}" - HPCBIND_STR_QUEUE_RANK=$(printf %0*d ${#HPCBIND_STR_QUEUE_SIZE} ${HPCBIND_QUEUE_RANK}) - - HPCBIND_LOG="${HPCBIND_OUTPUT_PREFIX}.hpcbind.${HPCBIND_STR_QUEUE_RANK}" - HPCBIND_ERR="${HPCBIND_OUTPUT_PREFIX}.stderr.${HPCBIND_STR_QUEUE_RANK}" - HPCBIND_OUT="${HPCBIND_OUTPUT_PREFIX}.stdout.${HPCBIND_STR_QUEUE_RANK}" - else - HPCBIND_LOG="${HPCBIND_OUTPUT_PREFIX}.hpcbind.${HPCBIND_QUEUE_RANK}" - HPCBIND_ERR="${HPCBIND_OUTPUT_PREFIX}.stderr.${HPCBIND_QUEUE_RANK}" - HPCBIND_OUT="${HPCBIND_OUTPUT_PREFIX}.stdout.${HPCBIND_QUEUE_RANK}" + if [[ ${HPCBIND_QUEUE_SIZE} -le 0 ]]; then + HPCBIND_QUEUE_SIZE=1 fi + HPCBIND_STR_QUEUE_SIZE="${HPCBIND_QUEUE_SIZE}" + HPCBIND_STR_QUEUE_RANK=$(printf %0*d ${#HPCBIND_STR_QUEUE_SIZE} ${HPCBIND_QUEUE_RANK}) + + HPCBIND_LOG="${HPCBIND_OUTPUT_PREFIX}.hpcbind.${HPCBIND_STR_QUEUE_RANK}" + HPCBIND_ERR="${HPCBIND_OUTPUT_PREFIX}.stderr.${HPCBIND_STR_QUEUE_RANK}" + HPCBIND_OUT="${HPCBIND_OUTPUT_PREFIX}.stdout.${HPCBIND_STR_QUEUE_RANK}" > ${HPCBIND_LOG} fi @@ -546,6 +576,8 @@ if [[ ${HPCBIND_TEE} -eq 0 || ${HPCBIND_VERBOSE} -eq 0 ]]; then hostname -s >> ${HPCBIND_LOG} echo "[HPCBIND]" >> ${HPCBIND_LOG} echo "${TMP_ENV}" | grep -E "^HPCBIND_" >> ${HPCBIND_LOG} + echo "[HWLOC]" >> ${HPCBIND_LOG} + echo "${TMP_ENV}" | grep -E "^HWLOC_" >> ${HPCBIND_LOG} echo "[CUDA]" >> ${HPCBIND_LOG} echo "${TMP_ENV}" | grep -E "^CUDA_" >> ${HPCBIND_LOG} echo "[OPENMP]" >> ${HPCBIND_LOG} @@ -568,6 +600,8 @@ else hostname -s > >(tee -a ${HPCBIND_LOG}) echo "[HPCBIND]" > >(tee -a ${HPCBIND_LOG}) echo "${TMP_ENV}" | grep -E "^HPCBIND_" > >(tee -a ${HPCBIND_LOG}) + echo "[HWLOC]" > >(tee -a ${HPCBIND_LOG}) + echo "${TMP_ENV}" | grep -E "^HWLOC_" > >(tee -a ${HPCBIND_LOG}) echo "[CUDA]" > >(tee -a ${HPCBIND_LOG}) echo "${TMP_ENV}" | grep -E "^CUDA_" > >(tee -a ${HPCBIND_LOG}) echo "[OPENMP]" > >(tee -a ${HPCBIND_LOG}) diff --git a/packages/kokkos/bin/nvcc_wrapper b/packages/kokkos/bin/nvcc_wrapper index d339da4fcdfa8029af85073adc068a8686253b8c..f926ae024c7d3d4ee7fd198998644434d81af646 100755 --- a/packages/kokkos/bin/nvcc_wrapper +++ b/packages/kokkos/bin/nvcc_wrapper @@ -74,6 +74,9 @@ dry_run=0 host_only=0 host_only_args="" +# Just run version on host compiler +get_host_version=0 + # Enable workaround for CUDA 6.5 for pragma ident replace_pragma_ident=0 @@ -93,6 +96,9 @@ depfile_separate=0 depfile_output_arg="" depfile_target_arg="" +# Option to remove duplicate libraries and object files +remove_duplicate_link_files=0 + #echo "Arguments: $# $@" while [ $# -gt 0 ] @@ -106,10 +112,18 @@ do --host-only) host_only=1 ;; + #get the host version only + --host-version) + get_host_version=1 + ;; #replace '#pragma ident' with '#ident' this is needed to compile OpenMPI due to a configure script bug and a non standardized behaviour of pragma with macros --replace-pragma-ident) replace_pragma_ident=1 ;; + #remove duplicate link files + --remove-duplicate-link-files) + remove_duplicate_link_files=1 + ;; #handle source files to be compiled as cuda files *.cpp|*.cxx|*.cc|*.C|*.c++|*.cu) cpp_files="$cpp_files $1" @@ -124,7 +138,12 @@ do fi ;; #Handle shared args (valid for both nvcc and the host compiler) - -D*|-I*|-L*|-l*|-g|--help|--version|-E|-M|-shared) + -D*) + unescape_commas=`echo "$1" | sed -e 's/\\\,/,/g'` + arg=`printf "%q" $unescape_commas` + shared_args="$shared_args $arg" + ;; + -I*|-L*|-l*|-g|--help|--version|-E|-M|-shared|-w) shared_args="$shared_args $1" ;; #Handle compilation argument @@ -152,7 +171,7 @@ do shift ;; #Handle known nvcc args - -gencode*|--dryrun|--verbose|--keep|--keep-dir*|-G|--relocatable-device-code*|-lineinfo|-expt-extended-lambda|--resource-usage|-Xptxas*) + --dryrun|--verbose|--keep|--keep-dir*|-G|--relocatable-device-code*|-lineinfo|-expt-extended-lambda|--resource-usage|-Xptxas*) cuda_args="$cuda_args $1" ;; #Handle more known nvcc args @@ -164,8 +183,11 @@ do cuda_args="$cuda_args $1 $2" shift ;; + -rdc=*|-maxrregcount*|--maxrregcount*) + cuda_args="$cuda_args $1" + ;; #Handle c++11 - --std=c++11|-std=c++11|--std=c++14|-std=c++14|--std=c++1z|-std=c++1z) + --std=c++11|-std=c++11|--std=c++14|-std=c++14|--std=c++1y|-std=c++1y|--std=c++17|-std=c++17|--std=c++1z|-std=c++1z) if [ $stdcxx_applied -eq 1 ]; then echo "nvcc_wrapper - *warning* you have set multiple optimization flags (-std=c++1* or --std=c++1*), only the first is used because nvcc can only accept a single std setting" else @@ -205,6 +227,15 @@ do fi shift ;; + #Handle -+ (same as -x c++, specifically used for xl compilers, but mutually exclusive with -x. So replace it with -x c++) + -+) + if [ $first_xcompiler_arg -eq 1 ]; then + xcompiler_args="-x,c++" + first_xcompiler_arg=0 + else + xcompiler_args="$xcompiler_args,-x,c++" + fi + ;; #Handle -ccbin (if its not set we can set it to a default value) -ccbin) cuda_args="$cuda_args $1 $2" @@ -212,18 +243,39 @@ do host_compiler=$2 shift ;; - #Handle -arch argument (if its not set use a default - -arch*) + + #Handle -arch argument (if its not set use a default) this is the version with = sign + -arch*|-gencode*) cuda_args="$cuda_args $1" arch_set=1 ;; + #Handle -code argument (if its not set use a default) this is the version with = sign + -code*) + cuda_args="$cuda_args $1" + ;; + #Handle -arch argument (if its not set use a default) this is the version without = sign + -arch|-gencode) + cuda_args="$cuda_args $1 $2" + arch_set=1 + shift + ;; + #Handle -code argument (if its not set use a default) this is the version without = sign + -code) + cuda_args="$cuda_args $1 $2" + shift + ;; #Handle -Xcudafe argument -Xcudafe) cuda_args="$cuda_args -Xcudafe $2" shift ;; + #Handle -Xlinker argument + -Xlinker) + xlinker_args="$xlinker_args -Xlinker $2" + shift + ;; #Handle args that should be sent to the linker - -Wl*) + -Wl,*) xlinker_args="$xlinker_args -Xlinker ${1:4:${#1}}" host_linker_args="$host_linker_args ${1:4:${#1}}" ;; @@ -256,6 +308,44 @@ do shift done +# Only print host compiler version +if [ $get_host_version -eq 1 ]; then + $host_compiler --version + exit +fi + +#Remove duplicate object files +if [ $remove_duplicate_link_files -eq 1 ]; then +for obj in $object_files +do + object_files_reverse="$obj $object_files_reverse" +done + +object_files_reverse_clean="" +for obj in $object_files_reverse +do + exists=false + for obj2 in $object_files_reverse_clean + do + if [ "$obj" == "$obj2" ] + then + exists=true + echo "Exists: $obj" + fi + done + if [ "$exists" == "false" ] + then + object_files_reverse_clean="$object_files_reverse_clean $obj" + fi +done + +object_files="" +for obj in $object_files_reverse_clean +do + object_files="$obj $object_files" +done +fi + #Add default host compiler if necessary if [ $ccbin_set -ne 1 ]; then cuda_args="$cuda_args -ccbin $host_compiler" @@ -328,10 +418,19 @@ fi #Run compilation command if [ $host_only -eq 1 ]; then + if [ "$NVCC_WRAPPER_SHOW_COMMANDS_BEING_RUN" == "1" ] ; then + echo "$host_command" + fi $host_command elif [ -n "$nvcc_depfile_command" ]; then + if [ "$NVCC_WRAPPER_SHOW_COMMANDS_BEING_RUN" == "1" ] ; then + echo "$nvcc_command && $nvcc_depfile_command" + fi $nvcc_command && $nvcc_depfile_command else + if [ "$NVCC_WRAPPER_SHOW_COMMANDS_BEING_RUN" == "1" ] ; then + echo "$nvcc_command" + fi $nvcc_command fi error_code=$? diff --git a/packages/kokkos/cmake/kokkos_build.cmake b/packages/kokkos/cmake/kokkos_build.cmake index 94dd733ca33ecf4d0ea35957ffcf99b9e1dc00b6..8178483d019f0acc4ac4717d53ca5268b92b0793 100644 --- a/packages/kokkos/cmake/kokkos_build.cmake +++ b/packages/kokkos/cmake/kokkos_build.cmake @@ -235,3 +235,7 @@ install(FILES # Install the export set for use with the install-tree INSTALL(EXPORT KokkosTargets DESTINATION "${INSTALL_CMAKE_DIR}") + +# build and install pkgconfig file +CONFIGURE_FILE(core/src/kokkos.pc.in kokkos.pc @ONLY) +INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/kokkos.pc DESTINATION lib/pkgconfig) diff --git a/packages/kokkos/cmake/kokkos_functions.cmake b/packages/kokkos/cmake/kokkos_functions.cmake index c0c62ccb6a6ce7989a5acfa122bcfbf4d5a34028..bc490115af9ae5b1dfbd4d36f1e0d7256867c627 100644 --- a/packages/kokkos/cmake/kokkos_functions.cmake +++ b/packages/kokkos/cmake/kokkos_functions.cmake @@ -47,7 +47,7 @@ function(set_kokkos_cxx_compiler) OUTPUT_VARIABLE INTERNAL_CXX_COMPILER_VERSION OUTPUT_STRIP_TRAILING_WHITESPACE) - string(REGEX MATCH "[0-9]+\.[0-9]+\.[0-9]+$" + string(REGEX MATCH "[0-9]+\\.[0-9]+\\.[0-9]+$" INTERNAL_CXX_COMPILER_VERSION ${INTERNAL_CXX_COMPILER_VERSION}) endif() diff --git a/packages/kokkos/cmake/kokkos_options.cmake b/packages/kokkos/cmake/kokkos_options.cmake index 80a091bb98b1d57a24b50f0f22e902133062ecee..580d1d322bd2d374273b76adff75ed332e836c94 100644 --- a/packages/kokkos/cmake/kokkos_options.cmake +++ b/packages/kokkos/cmake/kokkos_options.cmake @@ -41,7 +41,6 @@ list(APPEND KOKKOS_INTERNAL_ENABLE_OPTIONS_LIST foreach(opt ${KOKKOS_INTERNAL_ENABLE_OPTIONS_LIST}) string(TOUPPER ${opt} OPT ) IF(DEFINED Kokkos_ENABLE_${opt}) - MESSAGE("Kokkos_ENABLE_${opt} is defined!") IF(DEFINED KOKKOS_ENABLE_${OPT}) IF(NOT ("${KOKKOS_ENABLE_${OPT}}" STREQUAL "${Kokkos_ENABLE_${opt}}")) IF(DEFINED KOKKOS_ENABLE_${OPT}_INTERNAL) @@ -59,7 +58,6 @@ foreach(opt ${KOKKOS_INTERNAL_ENABLE_OPTIONS_LIST}) ENDIF() ELSE() SET(KOKKOS_INTERNAL_ENABLE_${OPT}_DEFAULT ${Kokkos_ENABLE_${opt}}) - MESSAGE("set KOKKOS_INTERNAL_ENABLE_${OPT}_DEFAULT!") ENDIF() ENDIF() endforeach() @@ -81,6 +79,7 @@ list(APPEND KOKKOS_ARCH_LIST ARMv80 # (HOST) ARMv8.0 Compatible CPU ARMv81 # (HOST) ARMv8.1 Compatible CPU ARMv8-ThunderX # (HOST) ARMv8 Cavium ThunderX CPU + ARMv8-TX2 # (HOST) ARMv8 Cavium ThunderX2 CPU WSM # (HOST) Intel Westmere CPU SNB # (HOST) Intel Sandy/Ivy Bridge CPUs HSW # (HOST) Intel Haswell CPUs @@ -123,11 +122,18 @@ list(APPEND KOKKOS_DEVICES_LIST # List of possible TPLs for Kokkos # From Makefile.kokkos: Options: hwloc,librt,experimental_memkind set(KOKKOS_USE_TPLS_LIST) +if(APPLE) +list(APPEND KOKKOS_USE_TPLS_LIST + HWLOC # hwloc + MEMKIND # experimental_memkind + ) +else() list(APPEND KOKKOS_USE_TPLS_LIST HWLOC # hwloc LIBRT # librt MEMKIND # experimental_memkind ) +endif() # Map of cmake variables to Makefile variables set(KOKKOS_INTERNAL_HWLOC hwloc) set(KOKKOS_INTERNAL_LIBRT librt) @@ -172,6 +178,7 @@ set(KOKKOS_INTERNAL_LAMBDA enable_lambda) set(tmpr "\n ") string(REPLACE ";" ${tmpr} KOKKOS_INTERNAL_ARCH_DOCSTR "${KOKKOS_ARCH_LIST}") +set(KOKKOS_INTERNAL_ARCH_DOCSTR "${tmpr}${KOKKOS_INTERNAL_ARCH_DOCSTR}") # This would be useful, but we use Foo_ENABLE mechanisms #string(REPLACE ";" ${tmpr} KOKKOS_INTERNAL_DEVICES_DOCSTR "${KOKKOS_DEVICES_LIST}") #string(REPLACE ";" ${tmpr} KOKKOS_INTERNAL_USE_TPLS_DOCSTR "${KOKKOS_USE_TPLS_LIST}") @@ -269,7 +276,7 @@ set(KOKKOS_ENABLE_PROFILING_LOAD_PRINT ${KOKKOS_INTERNAL_ENABLE_PROFILING_LOAD_P set_kokkos_default_default(DEPRECATED_CODE ON) set(KOKKOS_ENABLE_DEPRECATED_CODE ${KOKKOS_INTERNAL_ENABLE_DEPRECATED_CODE_DEFAULT} CACHE BOOL "Enable deprecated code.") -set_kokkos_default_default(EXPLICIT_INSTANTIATION ON) +set_kokkos_default_default(EXPLICIT_INSTANTIATION OFF) set(KOKKOS_ENABLE_EXPLICIT_INSTANTIATION ${KOKKOS_INTERNAL_ENABLE_EXPLICIT_INSTANTIATION_DEFAULT} CACHE BOOL "Enable explicit template instantiation.") #------------------------------------------------------------------------------- diff --git a/packages/kokkos/cmake/kokkos_settings.cmake b/packages/kokkos/cmake/kokkos_settings.cmake index 21c9d75a96aa52fd349c751aa0c2fa0f12316c91..387ced6d5205105c930d547b83711031453271a2 100644 --- a/packages/kokkos/cmake/kokkos_settings.cmake +++ b/packages/kokkos/cmake/kokkos_settings.cmake @@ -15,16 +15,16 @@ # Ensure that KOKKOS_ARCH is in the ARCH_LIST if (KOKKOS_ARCH MATCHES ",") - message("-- Detected a comma in: KOKKOS_ARCH=${KOKKOS_ARCH}") + message("-- Detected a comma in: KOKKOS_ARCH=`${KOKKOS_ARCH}`") message("-- Although we prefer KOKKOS_ARCH to be semicolon-delimited, we do allow") message("-- comma-delimited values for compatibility with scripts (see github.com/trilinos/Trilinos/issues/2330)") string(REPLACE "," ";" KOKKOS_ARCH "${KOKKOS_ARCH}") - message("-- Commas were changed to semicolons, now KOKKOS_ARCH=${KOKKOS_ARCH}") + message("-- Commas were changed to semicolons, now KOKKOS_ARCH=`${KOKKOS_ARCH}`") endif() foreach(arch ${KOKKOS_ARCH}) list(FIND KOKKOS_ARCH_LIST ${arch} indx) if (indx EQUAL -1) - message(FATAL_ERROR "${arch} is not an accepted value for KOKKOS_ARCH." + message(FATAL_ERROR "`${arch}` is not an accepted value in KOKKOS_ARCH=`${KOKKOS_ARCH}`." " Please pick from these choices: ${KOKKOS_INTERNAL_ARCH_DOCSTR}") endif () endforeach() @@ -130,7 +130,8 @@ string(REPLACE ";" ":" KOKKOS_INTERNAL_ADDTOPATH "${addpathl}") # Set the KOKKOS_SETTINGS String -- this is the primary communication with the # makefile configuration. See Makefile.kokkos -set(KOKKOS_SETTINGS KOKKOS_SRC_PATH=${KOKKOS_SRC_PATH}) +set(KOKKOS_SETTINGS KOKKOS_CMAKE=yes) +set(KOKKOS_SETTINGS ${KOKKOS_SETTINGS} KOKKOS_SRC_PATH=${KOKKOS_SRC_PATH}) set(KOKKOS_SETTINGS ${KOKKOS_SETTINGS} KOKKOS_PATH=${KOKKOS_PATH}) set(KOKKOS_SETTINGS ${KOKKOS_SETTINGS} KOKKOS_INSTALL_PATH=${CMAKE_INSTALL_PREFIX}) @@ -158,7 +159,7 @@ if (NOT "${KOKKOS_INTERNAL_PATHS}" STREQUAL "") set(KOKKOS_SETTINGS ${KOKKOS_SETTINGS} ${KOKKOS_INTERNAL_PATHS}) endif() if (NOT "${KOKKOS_INTERNAL_ADDTOPATH}" STREQUAL "") - set(KOKKOS_SETTINGS ${KOKKOS_SETTINGS} "PATH=\"${KOKKOS_INTERNAL_ADDTOPATH}:$ENV{PATH}\"") + set(KOKKOS_SETTINGS ${KOKKOS_SETTINGS} "PATH=${KOKKOS_INTERNAL_ADDTOPATH}:$ENV{PATH}") endif() if (CMAKE_CXX_STANDARD) diff --git a/packages/kokkos/config/test_all_sandia b/packages/kokkos/config/test_all_sandia index 15e6049afbaf238d132a28335f811576d2d0c72d..d94c38cbc698be3f54e3c82b47faa3561c03f520 100755 --- a/packages/kokkos/config/test_all_sandia +++ b/packages/kokkos/config/test_all_sandia @@ -241,17 +241,16 @@ elif [ "$MACHINE" = "white" ]; then BASE_MODULE_LIST="<COMPILER_NAME>/<COMPILER_VERSION>" IBM_MODULE_LIST="<COMPILER_NAME>/xl/<COMPILER_VERSION>" - CUDA_MODULE_LIST="<COMPILER_NAME>/<COMPILER_VERSION>,gcc/5.4.0" - CUDA_MODULE_LIST2="<COMPILER_NAME>/<COMPILER_VERSION>,gcc/6.3.0,ibm/xl/13.1.6" + CUDA_MODULE_LIST="<COMPILER_NAME>/<COMPILER_VERSION>,gcc/6.4.0,ibm/xl/16.1.0" # Don't do pthread on white. GCC_BUILD_LIST="OpenMP,Serial,OpenMP_Serial" # Format: (compiler module-list build-list exe-name warning-flag) COMPILERS=("gcc/5.4.0 $BASE_MODULE_LIST $IBM_BUILD_LIST g++ $GCC_WARNING_FLAGS" - "ibm/13.1.6 $IBM_MODULE_LIST $IBM_BUILD_LIST xlC $IBM_WARNING_FLAGS" - "cuda/8.0.44 $CUDA_MODULE_LIST $CUDA_IBM_BUILD_LIST ${KOKKOS_PATH}/bin/nvcc_wrapper $CUDA_WARNING_FLAGS" - "cuda/9.0.103 $CUDA_MODULE_LIST2 $CUDA_IBM_BUILD_LIST ${KOKKOS_PATH}/bin/nvcc_wrapper $CUDA_WARNING_FLAGS" + "gcc/6.4.0 $BASE_MODULE_LIST $IBM_BUILD_LIST g++ $GCC_WARNING_FLAGS" + "ibm/16.1.0 $IBM_MODULE_LIST $IBM_BUILD_LIST xlC $IBM_WARNING_FLAGS" + "cuda/9.0.103 $CUDA_MODULE_LIST $CUDA_IBM_BUILD_LIST ${KOKKOS_PATH}/bin/nvcc_wrapper $CUDA_WARNING_FLAGS" ) if [ -z "$ARCH_FLAG" ]; then @@ -362,7 +361,7 @@ elif [ "$MACHINE" = "apollo" ]; then "gcc/5.3.0 $BASE_MODULE_LIST "Serial" g++ $GCC_WARNING_FLAGS" "intel/16.0.1 $BASE_MODULE_LIST "OpenMP" icpc $INTEL_WARNING_FLAGS" "clang/3.9.0 $BASE_MODULE_LIST "Pthread_Serial" clang++ $CLANG_WARNING_FLAGS" - "clang/6.0 $CLANG_MODULE_LIST "Cuda_Pthread" clang++ $CUDA_WARNING_FLAGS" + "clang/6.0 $CLANG_MODULE_LIST "Cuda_Pthread,OpenMP" clang++ $CUDA_WARNING_FLAGS" "cuda/9.1 $CUDA_MODULE_LIST "Cuda_OpenMP" $KOKKOS_PATH/bin/nvcc_wrapper $CUDA_WARNING_FLAGS" ) else diff --git a/packages/kokkos/containers/src/Kokkos_DualView.hpp b/packages/kokkos/containers/src/Kokkos_DualView.hpp index 548e96d251f13224f4b82e13dda1c233fe36a577..adba0c4158f1b06a2df13c31c0ae9592916be243 100644 --- a/packages/kokkos/containers/src/Kokkos_DualView.hpp +++ b/packages/kokkos/containers/src/Kokkos_DualView.hpp @@ -96,6 +96,7 @@ template< class DataType , class Arg3Type = void> class DualView : public ViewTraits< DataType , Arg1Type , Arg2Type, Arg3Type > { +template< class , class , class , class > friend class DualView ; public: //! \name Typedefs for device types and various Kokkos::View specializations. //@{ @@ -182,8 +183,20 @@ public: //! \name Counters to keep track of changes ("modified" flags) //@{ - View<unsigned int,LayoutLeft,typename t_host::execution_space> modified_device; - View<unsigned int,LayoutLeft,typename t_host::execution_space> modified_host; +#ifndef KOKKOS_ENABLE_DEPRECATED_CODE +protected: + // modified_flags[0] -> host + // modified_flags[1] -> device + typedef View<unsigned int[2],LayoutLeft,Kokkos::HostSpace> t_modified_flags; + t_modified_flags modified_flags; + +public: +#else + typedef View<unsigned int[2],LayoutLeft,typename t_host::execution_space> t_modified_flags; + typedef View<unsigned int,LayoutLeft,typename t_host::execution_space> t_modified_flag; + t_modified_flags modified_flags; + t_modified_flag modified_host,modified_device; +#endif //@} //! \name Constructors @@ -194,10 +207,14 @@ public: /// Both device and host View objects are constructed using their /// default constructors. The "modified" flags are both initialized /// to "unmodified." - DualView () : - modified_device (View<unsigned int,LayoutLeft,typename t_host::execution_space> ("DualView::modified_device")), - modified_host (View<unsigned int,LayoutLeft,typename t_host::execution_space> ("DualView::modified_host")) - {} +#ifndef KOKKOS_ENABLE_DEPRECATED_CODE + DualView () = default; +#else + DualView ():modified_flags (t_modified_flags("DualView::modified_flags")) { + modified_host = t_modified_flag(modified_flags,0); + modified_device = t_modified_flag(modified_flags,1); + } +#endif /// \brief Constructor that allocates View objects on both host and device. /// @@ -219,17 +236,24 @@ public: const size_t n7 = KOKKOS_IMPL_CTOR_DEFAULT_ARG) : d_view (label, n0, n1, n2, n3, n4, n5, n6, n7) , h_view (create_mirror_view (d_view)) // without UVM, host View mirrors - , modified_device (View<unsigned int,LayoutLeft,typename t_host::execution_space> ("DualView::modified_device")) - , modified_host (View<unsigned int,LayoutLeft,typename t_host::execution_space> ("DualView::modified_host")) - {} + , modified_flags (t_modified_flags("DualView::modified_flags")) + { +#ifdef KOKKOS_ENABLE_DEPRECATED_CODE + modified_host = t_modified_flag(modified_flags,0); + modified_device = t_modified_flag(modified_flags,1); +#endif + } //! Copy constructor (shallow copy) template<class SS, class LS, class DS, class MS> DualView (const DualView<SS,LS,DS,MS>& src) : d_view (src.d_view), h_view (src.h_view), - modified_device (src.modified_device), - modified_host (src.modified_host) + modified_flags (src.modified_flags) +#ifdef KOKKOS_ENABLE_DEPRECATED_CODE + , modified_host(src.modified_host) + , modified_device(src.modified_device) +#endif {} //! Subview constructor @@ -241,8 +265,11 @@ public: ) : d_view( Kokkos::subview( src.d_view , arg0 , args ... ) ) , h_view( Kokkos::subview( src.h_view , arg0 , args ... ) ) - , modified_device (src.modified_device) - , modified_host (src.modified_host) + , modified_flags (src.modified_flags) +#ifdef KOKKOS_ENABLE_DEPRECATED_CODE + , modified_host(src.modified_host) + , modified_device(src.modified_device) +#endif {} /// \brief Create DualView from existing device and host View objects. @@ -258,8 +285,7 @@ public: DualView (const t_dev& d_view_, const t_host& h_view_) : d_view (d_view_), h_view (h_view_), - modified_device (View<unsigned int,LayoutLeft,typename t_host::execution_space> ("DualView::modified_device")), - modified_host (View<unsigned int,LayoutLeft,typename t_host::execution_space> ("DualView::modified_host")) + modified_flags (t_modified_flags("DualView::modified_flags")) { if ( int(d_view.rank) != int(h_view.rank) || d_view.extent(0) != h_view.extent(0) || @@ -281,6 +307,10 @@ public: d_view.span() != h_view.span() ) { Kokkos::Impl::throw_runtime_exception("DualView constructed with incompatible views"); } +#ifdef KOKKOS_ENABLE_DEPRECATED_CODE + modified_host = t_modified_flag(modified_flags,0); + modified_device = t_modified_flag(modified_flags,1); +#endif } //@} @@ -316,6 +346,30 @@ public: t_dev, t_host>::type& view () const { + #ifndef KOKKOS_ENABLE_DEPRECATED_CODE + constexpr bool device_is_memspace = std::is_same<Device,typename Device::memory_space>::value; + constexpr bool device_is_execspace = std::is_same<Device,typename Device::execution_space>::value; + constexpr bool device_exec_is_t_dev_exec = std::is_same<typename Device::execution_space,typename t_dev::execution_space>::value; + constexpr bool device_mem_is_t_dev_mem = std::is_same<typename Device::memory_space,typename t_dev::memory_space>::value; + constexpr bool device_exec_is_t_host_exec = std::is_same<typename Device::execution_space,typename t_host::execution_space>::value; + constexpr bool device_mem_is_t_host_mem = std::is_same<typename Device::memory_space,typename t_host::memory_space>::value; + constexpr bool device_is_t_host_device = std::is_same<typename Device::execution_space,typename t_host::device_type>::value; + constexpr bool device_is_t_dev_device = std::is_same<typename Device::memory_space,typename t_host::device_type>::value; + + static_assert( + device_is_t_dev_device || device_is_t_host_device || + (device_is_memspace && (device_mem_is_t_dev_mem || device_mem_is_t_host_mem) ) || + (device_is_execspace && (device_exec_is_t_dev_exec || device_exec_is_t_host_exec) ) || + ( + (!device_is_execspace && !device_is_memspace) && ( + (device_mem_is_t_dev_mem || device_mem_is_t_host_mem) || + (device_exec_is_t_dev_exec || device_exec_is_t_host_exec) + ) + ) + , + "Template parameter to .view() must exactly match one of the DualView's device types or one of the execution or memory spaces"); + #endif + return Impl::if_c< std::is_same< typename t_dev::memory_space, @@ -324,6 +378,72 @@ public: t_host >::select (d_view , h_view); } + KOKKOS_INLINE_FUNCTION + t_host view_host() const { + return h_view; + } + + KOKKOS_INLINE_FUNCTION + t_dev view_device() const { + return d_view; + } + + template<class Device> + static int get_device_side() { + constexpr bool device_is_memspace = std::is_same<Device,typename Device::memory_space>::value; + constexpr bool device_is_execspace = std::is_same<Device,typename Device::execution_space>::value; + constexpr bool device_exec_is_t_dev_exec = std::is_same<typename Device::execution_space,typename t_dev::execution_space>::value; + constexpr bool device_mem_is_t_dev_mem = std::is_same<typename Device::memory_space,typename t_dev::memory_space>::value; + constexpr bool device_exec_is_t_host_exec = std::is_same<typename Device::execution_space,typename t_host::execution_space>::value; + constexpr bool device_mem_is_t_host_mem = std::is_same<typename Device::memory_space,typename t_host::memory_space>::value; + constexpr bool device_is_t_host_device = std::is_same<typename Device::execution_space,typename t_host::device_type>::value; + constexpr bool device_is_t_dev_device = std::is_same<typename Device::memory_space,typename t_host::device_type>::value; + + #ifndef KOKKOS_ENABLE_DEPRECATED_CODE + static_assert( + device_is_t_dev_device || device_is_t_host_device || + (device_is_memspace && (device_mem_is_t_dev_mem || device_mem_is_t_host_mem) ) || + (device_is_execspace && (device_exec_is_t_dev_exec || device_exec_is_t_host_exec) ) || + ( + (!device_is_execspace && !device_is_memspace) && ( + (device_mem_is_t_dev_mem || device_mem_is_t_host_mem) || + (device_exec_is_t_dev_exec || device_exec_is_t_host_exec) + ) + ) + , + "Template parameter to .sync() must exactly match one of the DualView's device types or one of the execution or memory spaces"); + #endif + + #ifndef KOKKOS_ENABLE_DEPRECATED_CODE + int dev = -1; + #else + int dev = 0; + #endif + if(device_is_t_dev_device) dev = 1; + else if(device_is_t_host_device) dev = 0; + else { + if(device_is_memspace) { + if(device_mem_is_t_dev_mem) dev = 1; + if(device_mem_is_t_host_mem) dev = 0; + if(device_mem_is_t_host_mem && device_mem_is_t_dev_mem) dev = -1; + } + if(device_is_execspace) { + if(device_exec_is_t_dev_exec) dev = 1; + if(device_exec_is_t_host_exec) dev = 0; + if(device_exec_is_t_host_exec && device_exec_is_t_dev_exec) dev = -1; + } + if(!device_is_execspace && !device_is_memspace) { + if(device_mem_is_t_dev_mem) dev = 1; + if(device_mem_is_t_host_mem) dev = 0; + if(device_mem_is_t_host_mem && device_mem_is_t_dev_mem) dev = -1; + if(device_exec_is_t_dev_exec) dev = 1; + if(device_exec_is_t_host_exec) dev = 0; + if(device_exec_is_t_host_exec && device_exec_is_t_dev_exec) dev = -1; + } + } + return dev; + } + /// \brief Update data on device or host only if data in the other /// space has been marked as modified. /// @@ -347,23 +467,20 @@ public: ( std::is_same< Device , int>::value) , int >::type& = 0) { - const unsigned int dev = - Impl::if_c< - std::is_same< - typename t_dev::memory_space, - typename Device::memory_space>::value , - unsigned int, - unsigned int>::select (1, 0); - - if (dev) { // if Device is the same as DualView's device type - if ((modified_host () > 0) && (modified_host () >= modified_device ())) { + if(modified_flags.data()==NULL) return; + + int dev = get_device_side<Device>(); + + if (dev == 1) { // if Device is the same as DualView's device type + if ((modified_flags(0) > 0) && (modified_flags(0) >= modified_flags(1))) { deep_copy (d_view, h_view); - modified_host() = modified_device() = 0; + modified_flags(0) = modified_flags(1) = 0; } - } else { // hopefully Device is the same as DualView's host type - if ((modified_device () > 0) && (modified_device () >= modified_host ())) { + } + if (dev == 0) { // hopefully Device is the same as DualView's host type + if ((modified_flags(1) > 0) && (modified_flags(1) >= modified_flags(0))) { deep_copy (h_view, d_view); - modified_host() = modified_device() = 0; + modified_flags(0) = modified_flags(1) = 0; } } if(std::is_same<typename t_host::memory_space,typename t_dev::memory_space>::value) { @@ -378,46 +495,71 @@ public: ( std::is_same< Device , int>::value) , int >::type& = 0 ) { - const unsigned int dev = - Impl::if_c< - std::is_same< - typename t_dev::memory_space, - typename Device::memory_space>::value, - unsigned int, - unsigned int>::select (1, 0); - if (dev) { // if Device is the same as DualView's device type - if ((modified_host () > 0) && (modified_host () >= modified_device ())) { + if(modified_flags.data()==NULL) return; + + int dev = get_device_side<Device>(); + + if (dev == 1) { // if Device is the same as DualView's device type + if ((modified_flags(0) > 0) && (modified_flags(0) >= modified_flags(1))) { Impl::throw_runtime_exception("Calling sync on a DualView with a const datatype."); } - } else { // hopefully Device is the same as DualView's host type - if ((modified_device () > 0) && (modified_device () >= modified_host ())) { + } + if (dev == 0){ // hopefully Device is the same as DualView's host type + if ((modified_flags(1) > 0) && (modified_flags(1) >= modified_flags(0))) { Impl::throw_runtime_exception("Calling sync on a DualView with a const datatype."); } } } + void sync_host() { + if( ! std::is_same< typename traits::data_type , typename traits::non_const_data_type>::value ) + Impl::throw_runtime_exception("Calling sync_host on a DualView with a const datatype."); + if(modified_flags.data()==NULL) return; + if(modified_flags(1) > modified_flags(0)) { + deep_copy (h_view, d_view); + modified_flags(1) = modified_flags(0) = 0; + } + } + + void sync_device() { + if( ! std::is_same< typename traits::data_type , typename traits::non_const_data_type>::value ) + Impl::throw_runtime_exception("Calling sync_device on a DualView with a const datatype."); + if(modified_flags.data()==NULL) return; + if(modified_flags(0) > modified_flags(1)) { + deep_copy (d_view, h_view); + modified_flags(1) = modified_flags(0) = 0; + } + } + template<class Device> bool need_sync() const { - const unsigned int dev = - Impl::if_c< - std::is_same< - typename t_dev::memory_space, - typename Device::memory_space>::value , - unsigned int, - unsigned int>::select (1, 0); - - if (dev) { // if Device is the same as DualView's device type - if ((modified_host () > 0) && (modified_host () >= modified_device ())) { + if(modified_flags.data()==NULL) return false; + int dev = get_device_side<Device>(); + + if (dev == 1) { // if Device is the same as DualView's device type + if ((modified_flags(0) > 0) && (modified_flags(0) >= modified_flags(1))) { return true; } - } else { // hopefully Device is the same as DualView's host type - if ((modified_device () > 0) && (modified_device () >= modified_host ())) { + } + if (dev == 0){ // hopefully Device is the same as DualView's host type + if ((modified_flags(1) > 0) && (modified_flags(1) >= modified_flags(0))) { return true; } } return false; } + + inline bool need_sync_host() const { + if(modified_flags.data()==NULL) return false; + return modified_flags(0)<modified_flags(1); + } + + inline bool need_sync_device() const { + if(modified_flags.data()==NULL) return false; + return modified_flags(1)<modified_flags(0); + } + /// \brief Mark data as modified on the given device \c Device. /// /// If \c Device is the same as this DualView's device type, then @@ -425,26 +567,22 @@ public: /// data as modified. template<class Device> void modify () { - const unsigned int dev = - Impl::if_c< - std::is_same< - typename t_dev::memory_space, - typename Device::memory_space>::value, - unsigned int, - unsigned int>::select (1, 0); - - if (dev) { // if Device is the same as DualView's device type + if(modified_flags.data()==NULL) return; + int dev = get_device_side<Device>(); + + if (dev == 1) { // if Device is the same as DualView's device type // Increment the device's modified count. - modified_device () = (modified_device () > modified_host () ? - modified_device () : modified_host ()) + 1; - } else { // hopefully Device is the same as DualView's host type + modified_flags(1) = (modified_flags(1) > modified_flags(0) ? + modified_flags(1) : modified_flags(0)) + 1; + } + if (dev == 0) { // hopefully Device is the same as DualView's host type // Increment the host's modified count. - modified_host () = (modified_device () > modified_host () ? - modified_device () : modified_host ()) + 1; + modified_flags(0) = (modified_flags(1) > modified_flags(0) ? + modified_flags(1) : modified_flags(0)) + 1; } #ifdef KOKKOS_ENABLE_DEBUG_DUALVIEW_MODIFY_CHECK - if (modified_host() && modified_device()) { + if (modified_flags(0) && modified_flags(1)) { std::string msg = "Kokkos::DualView::modify ERROR: "; msg += "Concurrent modification of host and device views "; msg += "in DualView \""; @@ -455,6 +593,45 @@ public: #endif } + inline void modify_host() { + if(modified_flags.data()!=NULL) { + modified_flags(0) = (modified_flags(1) > modified_flags(0) ? + modified_flags(1) : modified_flags(0)) + 1; + #ifdef KOKKOS_ENABLE_DEBUG_DUALVIEW_MODIFY_CHECK + if (modified_flags(0) && modified_flags(1)) { + std::string msg = "Kokkos::DualView::modify_host ERROR: "; + msg += "Concurrent modification of host and device views "; + msg += "in DualView \""; + msg += d_view.label(); + msg += "\"\n"; + Kokkos::abort(msg.c_str()); + } + #endif + } + } + + inline void modify_device() { + if(modified_flags.data()!=NULL) { + modified_flags(1) = (modified_flags(1) > modified_flags(0) ? + modified_flags(1) : modified_flags(0)) + 1; + #ifdef KOKKOS_ENABLE_DEBUG_DUALVIEW_MODIFY_CHECK + if (modified_flags(0) && modified_flags(1)) { + std::string msg = "Kokkos::DualView::modify_device ERROR: "; + msg += "Concurrent modification of host and device views "; + msg += "in DualView \""; + msg += d_view.label(); + msg += "\"\n"; + Kokkos::abort(msg.c_str()); + } + #endif + } + } + + inline void clear_sync_state() { + if(modified_flags.data()!=NULL) + modified_flags(1) = modified_flags(0) = 0; + } + //@} //! \name Methods for reallocating or resizing the View objects. //@{ @@ -476,7 +653,10 @@ public: h_view = create_mirror_view( d_view ); /* Reset dirty flags */ - modified_device() = modified_host() = 0; + if(modified_flags.data()==NULL) { + modified_flags = t_modified_flags("DualView::modified_flags"); + } else + modified_flags(1) = modified_flags(0) = 0; } /// \brief Resize both views, copying old contents into new if necessary. @@ -491,13 +671,16 @@ public: const size_t n5 = KOKKOS_IMPL_CTOR_DEFAULT_ARG , const size_t n6 = KOKKOS_IMPL_CTOR_DEFAULT_ARG , const size_t n7 = KOKKOS_IMPL_CTOR_DEFAULT_ARG ) { - if(modified_device() >= modified_host()) { + if(modified_flags.data()==NULL) { + modified_flags = t_modified_flags("DualView::modified_flags"); + } + if(modified_flags(1) >= modified_flags(0)) { /* Resize on Device */ ::Kokkos::resize(d_view,n0,n1,n2,n3,n4,n5,n6,n7); h_view = create_mirror_view( d_view ); /* Mark Device copy as modified */ - modified_device() = modified_device()+1; + modified_flags(1) = modified_flags(1)+1; } else { /* Realloc on Device */ @@ -525,7 +708,7 @@ public: d_view = create_mirror_view( typename t_dev::execution_space(), h_view ); /* Mark Host copy as modified */ - modified_host() = modified_host()+1; + modified_flags(0) = modified_flags(0)+1; } } @@ -649,7 +832,10 @@ void deep_copy (DualView<DT,DL,DD,DM> dst, // trust me, this must not be a reference const DualView<ST,SL,SD,SM>& src ) { - if (src.modified_device () >= src.modified_host ()) { + if(src.modified_flags.data()==NULL || dst.modified_flags.data()==NULL) { + return deep_copy(dst.d_view, src.d_view); + } + if (src.modified_flags(1) >= src.modified_flags(0)) { deep_copy (dst.d_view, src.d_view); dst.template modify<typename DualView<DT,DL,DD,DM>::device_type> (); } else { @@ -666,7 +852,10 @@ deep_copy (const ExecutionSpace& exec , DualView<DT,DL,DD,DM> dst, // trust me, this must not be a reference const DualView<ST,SL,SD,SM>& src ) { - if (src.modified_device () >= src.modified_host ()) { + if(src.modified_flags.data()==NULL || dst.modified_flags.data()==NULL) { + return deep_copy(exec, dst.d_view, src.d_view); + } + if (src.modified_flags(1) >= src.modified_flags(0)) { deep_copy (exec, dst.d_view, src.d_view); dst.template modify<typename DualView<DT,DL,DD,DM>::device_type> (); } else { diff --git a/packages/kokkos/containers/src/Kokkos_DynRankView.hpp b/packages/kokkos/containers/src/Kokkos_DynRankView.hpp index b30009a999e108235a1318431df08fd3115ec965..8be2c49a31171a085785abb38ecbcb33495bcd9a 100644 --- a/packages/kokkos/containers/src/Kokkos_DynRankView.hpp +++ b/packages/kokkos/containers/src/Kokkos_DynRankView.hpp @@ -64,7 +64,7 @@ namespace Impl { template <typename Specialize> struct DynRankDimTraits { - enum : size_t{unspecified =KOKKOS_INVALID_INDEX}; + enum : size_t{unspecified = KOKKOS_INVALID_INDEX}; // Compute the rank of the view from the nonzero dimension arguments. KOKKOS_INLINE_FUNCTION @@ -384,8 +384,8 @@ public: // Removed dimension checks... typedef typename DstType::offset_type dst_offset_type ; - dst.m_map.m_offset = dst_offset_type(std::integral_constant<unsigned,0>() , src.layout() ); //Check this for integer input1 for padding, etc - dst.m_map.m_handle = Kokkos::Impl::ViewDataHandle< DstTraits >::assign( src.m_map.m_handle , src.m_track ); + dst.m_map.m_impl_offset = dst_offset_type(std::integral_constant<unsigned,0>() , src.layout() ); //Check this for integer input1 for padding, etc + dst.m_map.m_impl_handle = Kokkos::Impl::ViewDataHandle< DstTraits >::assign( src.m_map.m_impl_handle , src.m_track ); dst.m_track.assign( src.m_track , DstTraits::is_managed ); dst.m_rank = src.Rank ; } @@ -565,10 +565,14 @@ public: //---------------------------------------- // Allow specializations to query their specialized map - +#ifdef KOKKOS_ENABLE_DEPRECATED_CODE KOKKOS_INLINE_FUNCTION const Kokkos::Impl::ViewMapping< traits , void > & implementation_map() const { return m_map ; } +#endif + KOKKOS_INLINE_FUNCTION + const Kokkos::Impl::ViewMapping< traits , void > & + impl_map() const { return m_map ; } //---------------------------------------- @@ -624,7 +628,7 @@ public: reference_type operator()() const { KOKKOS_IMPL_VIEW_OPERATOR_VERIFY( (0 , this->rank(), m_track, m_map) ) - return implementation_map().reference(); + return impl_map().reference(); //return m_map.reference(0,0,0,0,0,0,0); } @@ -647,7 +651,7 @@ public: typename std::enable_if< !std::is_same<typename drvtraits::value_type, typename drvtraits::scalar_array_type>::value && std::is_integral<iType>::value, reference_type>::type operator[](const iType & i0) const { -// auto map = implementation_map(); +// auto map = impl_map(); const size_t dim_scalar = m_map.dimension_scalar(); const size_t bytes = this->span() / dim_scalar; @@ -785,7 +789,7 @@ public: reference_type access() const { KOKKOS_IMPL_VIEW_OPERATOR_VERIFY( (0 , this->rank(), m_track, m_map) ) - return implementation_map().reference(); + return impl_map().reference(); //return m_map.reference(0,0,0,0,0,0,0); } @@ -1004,7 +1008,7 @@ public: //---------------------------------------- // Allocation according to allocation properties and array layout - // unused arg_layout dimensions must be set toKOKKOS_INVALID_INDEX so that rank deduction can properly take place + // unused arg_layout dimensions must be set to KOKKOS_INVALID_INDEX so that rank deduction can properly take place template< class ... P > explicit inline DynRankView( const Kokkos::Impl::ViewCtorProp< P ... > & arg_prop @@ -1179,7 +1183,7 @@ public: : DynRankView( Kokkos::Impl::ViewCtorProp< std::string >( arg_label ) , typename traits::array_layout ( arg_N0 , arg_N1 , arg_N2 , arg_N3 , arg_N4 , arg_N5 , arg_N6 , arg_N7 ) - ) + ) {} // For backward compatibility @@ -1189,8 +1193,7 @@ public: , const typename traits::array_layout & arg_layout ) : DynRankView( Kokkos::Impl::ViewCtorProp< std::string , Kokkos::Impl::WithoutInitializing_t >( arg_prop.label , Kokkos::WithoutInitializing ) - - , Impl::DynRankDimTraits<typename traits::specialize>::createLayout(arg_layout) + , arg_layout ) {} @@ -1205,7 +1208,9 @@ public: , const size_t arg_N6 =KOKKOS_INVALID_INDEX , const size_t arg_N7 =KOKKOS_INVALID_INDEX ) - : DynRankView(Kokkos::Impl::ViewCtorProp< std::string , Kokkos::Impl::WithoutInitializing_t >( arg_prop.label , Kokkos::WithoutInitializing ), arg_N0, arg_N1, arg_N2, arg_N3, arg_N4, arg_N5, arg_N6, arg_N7 ) + : DynRankView(Kokkos::Impl::ViewCtorProp< std::string , Kokkos::Impl::WithoutInitializing_t >( arg_prop.label , Kokkos::WithoutInitializing ) + , typename traits::array_layout(arg_N0, arg_N1, arg_N2, arg_N3, arg_N4, arg_N5, arg_N6, arg_N7) + ) {} //---------------------------------------- @@ -1445,30 +1450,30 @@ public: ret_type dst ; const SubviewExtents< 7 , rank > extents = - ExtentGenerator< Args ... >::generator( src.m_map.m_offset.m_dim , args... ) ; + ExtentGenerator< Args ... >::generator( src.m_map.m_impl_offset.m_dim , args... ) ; - dst_offset_type tempdst( src.m_map.m_offset , extents ) ; + dst_offset_type tempdst( src.m_map.m_impl_offset , extents ) ; dst.m_track = src.m_track ; - dst.m_map.m_offset.m_dim.N0 = tempdst.m_dim.N0 ; - dst.m_map.m_offset.m_dim.N1 = tempdst.m_dim.N1 ; - dst.m_map.m_offset.m_dim.N2 = tempdst.m_dim.N2 ; - dst.m_map.m_offset.m_dim.N3 = tempdst.m_dim.N3 ; - dst.m_map.m_offset.m_dim.N4 = tempdst.m_dim.N4 ; - dst.m_map.m_offset.m_dim.N5 = tempdst.m_dim.N5 ; - dst.m_map.m_offset.m_dim.N6 = tempdst.m_dim.N6 ; - - dst.m_map.m_offset.m_stride.S0 = tempdst.m_stride.S0 ; - dst.m_map.m_offset.m_stride.S1 = tempdst.m_stride.S1 ; - dst.m_map.m_offset.m_stride.S2 = tempdst.m_stride.S2 ; - dst.m_map.m_offset.m_stride.S3 = tempdst.m_stride.S3 ; - dst.m_map.m_offset.m_stride.S4 = tempdst.m_stride.S4 ; - dst.m_map.m_offset.m_stride.S5 = tempdst.m_stride.S5 ; - dst.m_map.m_offset.m_stride.S6 = tempdst.m_stride.S6 ; - - dst.m_map.m_handle = dst_handle_type( src.m_map.m_handle + - src.m_map.m_offset( extents.domain_offset(0) + dst.m_map.m_impl_offset.m_dim.N0 = tempdst.m_dim.N0 ; + dst.m_map.m_impl_offset.m_dim.N1 = tempdst.m_dim.N1 ; + dst.m_map.m_impl_offset.m_dim.N2 = tempdst.m_dim.N2 ; + dst.m_map.m_impl_offset.m_dim.N3 = tempdst.m_dim.N3 ; + dst.m_map.m_impl_offset.m_dim.N4 = tempdst.m_dim.N4 ; + dst.m_map.m_impl_offset.m_dim.N5 = tempdst.m_dim.N5 ; + dst.m_map.m_impl_offset.m_dim.N6 = tempdst.m_dim.N6 ; + + dst.m_map.m_impl_offset.m_stride.S0 = tempdst.m_stride.S0 ; + dst.m_map.m_impl_offset.m_stride.S1 = tempdst.m_stride.S1 ; + dst.m_map.m_impl_offset.m_stride.S2 = tempdst.m_stride.S2 ; + dst.m_map.m_impl_offset.m_stride.S3 = tempdst.m_stride.S3 ; + dst.m_map.m_impl_offset.m_stride.S4 = tempdst.m_stride.S4 ; + dst.m_map.m_impl_offset.m_stride.S5 = tempdst.m_stride.S5 ; + dst.m_map.m_impl_offset.m_stride.S6 = tempdst.m_stride.S6 ; + + dst.m_map.m_impl_handle = dst_handle_type( src.m_map.m_impl_handle + + src.m_map.m_impl_offset( extents.domain_offset(0) , extents.domain_offset(1) , extents.domain_offset(2) , extents.domain_offset(3) @@ -1896,6 +1901,7 @@ inline typename DynRankView<T,P...>::HostMirror create_mirror( const DynRankView<T,P...> & src , typename std::enable_if< + std::is_same< typename ViewTraits<T,P...>::specialize , void >::value && ! std::is_same< typename Kokkos::ViewTraits<T,P...>::array_layout , Kokkos::LayoutStride >::value >::type * = 0 @@ -1914,6 +1920,7 @@ inline typename DynRankView<T,P...>::HostMirror create_mirror( const DynRankView<T,P...> & src , typename std::enable_if< + std::is_same< typename ViewTraits<T,P...>::specialize , void >::value && std::is_same< typename Kokkos::ViewTraits<T,P...>::array_layout , Kokkos::LayoutStride >::value >::type * = 0 @@ -1929,7 +1936,11 @@ create_mirror( const DynRankView<T,P...> & src // Create a mirror in a new space (specialization for different space) template<class Space, class T, class ... P> -typename Impl::MirrorDRVType<Space,T,P ...>::view_type create_mirror(const Space& , const Kokkos::DynRankView<T,P...> & src) { +typename Impl::MirrorDRVType<Space,T,P ...>::view_type +create_mirror(const Space& , const Kokkos::DynRankView<T,P...> & src + , typename std::enable_if< + std::is_same< typename ViewTraits<T,P...>::specialize , void >::value + >::type * = 0) { return typename Impl::MirrorDRVType<Space,T,P ...>::view_type(src.label(), Impl::reconstructLayout(src.layout(), src.rank()) ); } @@ -1985,6 +1996,29 @@ create_mirror_view(const Space& , const Kokkos::DynRankView<T,P...> & src return typename Impl::MirrorDRViewType<Space,T,P ...>::view_type(src.label(), Impl::reconstructLayout(src.layout(), src.rank()) ); } +// Create a mirror view and deep_copy in a new space (specialization for same space) +template<class Space, class T, class ... P> +typename Impl::MirrorDRViewType<Space,T,P ...>::view_type +create_mirror_view_and_copy(const Space& , const Kokkos::DynRankView<T,P...> & src + , std::string const& name = "" + , typename std::enable_if<Impl::MirrorDRViewType<Space,T,P ...>::is_same_memspace>::type* = 0 ) { + (void)name; + return src; +} + +// Create a mirror view and deep_copy in a new space (specialization for different space) +template<class Space, class T, class ... P> +typename Impl::MirrorDRViewType<Space,T,P ...>::view_type +create_mirror_view_and_copy(const Space& , const Kokkos::DynRankView<T,P...> & src + , std::string const& name = "" + , typename std::enable_if<!Impl::MirrorDRViewType<Space,T,P ...>::is_same_memspace>::type* = 0 ) { + using Mirror = typename Impl::MirrorDRViewType<Space,T,P ...>::view_type; + std::string label = name.empty() ? src.label() : name; + auto mirror = Mirror( Kokkos::ViewAllocateWithoutInitializing(label), Impl::reconstructLayout(src.layout(), src.rank()) ); + deep_copy(mirror, src); + return mirror; +} + } //end Kokkos diff --git a/packages/kokkos/containers/src/Kokkos_OffsetView.hpp b/packages/kokkos/containers/src/Kokkos_OffsetView.hpp new file mode 100644 index 0000000000000000000000000000000000000000..b614764ee787c778eec2b87f2c27bcb33290e265 --- /dev/null +++ b/packages/kokkos/containers/src/Kokkos_OffsetView.hpp @@ -0,0 +1,1895 @@ +/* + * Kokkos_OffsetView.hpp + * + * Created on: Apr 23, 2018 + * Author: swbova + */ + +#ifndef KOKKOS_OFFSETVIEW_HPP_ +#define KOKKOS_OFFSETVIEW_HPP_ + + +#include <Kokkos_Core.hpp> + +#include <Kokkos_View.hpp> + +namespace Kokkos { + + namespace Experimental { + //---------------------------------------------------------------------------- + //---------------------------------------------------------------------------- + + template< class DataType , class ... Properties > + class OffsetView ; + + template< class > struct is_offset_view : public std::false_type {}; + + template< class D, class ... P > + struct is_offset_view< OffsetView<D,P...> > : public std::true_type {}; + + template< class D, class ... P > + struct is_offset_view< const OffsetView<D,P...> > : public std::true_type {}; + +#define KOKKOS_INVALID_OFFSET int64_t(0) +#define KOKKOS_INVALID_INDEX_RANGE {KOKKOS_INVALID_OFFSET, KOKKOS_INVALID_OFFSET} + + template <typename iType, typename std::enable_if< std::is_integral<iType>::value && + std::is_signed<iType>::value, iType >::type = 0> + using IndexRange = Kokkos::Array<iType, 2>; + + + using index_list_type = std::initializer_list<int64_t>; + + + // template <typename iType, + // typename std::enable_if< std::is_integral<iType>::value && + // std::is_signed<iType>::value, iType >::type = 0> using min_index_type = std::initializer_list<iType>; + + namespace Impl { + + template<class ViewType> + struct GetOffsetViewTypeFromViewType { + + typedef OffsetView<typename ViewType::data_type,typename ViewType::array_layout, + typename ViewType::device_type,typename ViewType::memory_traits> type; + + }; + + template< unsigned , class MapType, class BeginsType > + KOKKOS_INLINE_FUNCTION + bool offsetview_verify_operator_bounds( const MapType &, const BeginsType & ) + { return true ; } + + template< unsigned R , class MapType , class BeginsType, class iType , class ... Args > + KOKKOS_INLINE_FUNCTION + bool offsetview_verify_operator_bounds + ( const MapType & map + , const BeginsType & begins + , const iType & i + , Args ... args + ) + { + + const bool legalIndex = ( int64_t(i) >= begins[R] ) && + ( int64_t(i) <= int64_t(begins[R] + map.extent(R) - 1) ); + return legalIndex + && offsetview_verify_operator_bounds<R+1>( map , begins, args ... ); + } + template< unsigned , class MapType, class BeginsType > + inline + void offsetview_error_operator_bounds( char * , int , const MapType & , const BeginsType &) + {} + + template< unsigned R , class MapType , class BeginsType , class iType , class ... Args > + inline + void offsetview_error_operator_bounds + ( char * buf + , int len + , const MapType & map + , const BeginsType begins + , const iType & i + , Args ... args + ) + { + const int64_t b = begins[R]; + const int64_t e = b + map.extent(R) - 1; + const int n = + snprintf(buf,len," %ld <= %ld <= %ld %c" + , static_cast<unsigned long>(b) + , static_cast<unsigned long>(i) + , static_cast<unsigned long>(e) + , ( sizeof...(Args) ? ',' : ')' ) + ); + offsetview_error_operator_bounds<R+1>(buf+n,len-n,map,begins,args...); + } + + template< class MemorySpace , class MapType , class BeginsType, class ... Args > + KOKKOS_INLINE_FUNCTION + void offsetview_verify_operator_bounds + ( Kokkos::Impl::SharedAllocationTracker const & tracker + , const MapType & map , const BeginsType & begins, Args ... args ) + { + if ( ! offsetview_verify_operator_bounds<0>( map , begins, args ... ) ) { +#if defined( KOKKOS_ACTIVE_EXECUTION_MEMORY_SPACE_HOST ) + enum { LEN = 1024 }; + char buffer[ LEN ]; + const std::string label = tracker.template get_label<MemorySpace>(); + int n = snprintf(buffer,LEN,"OffsetView bounds error of view labeled %s (",label.c_str()); + offsetview_error_operator_bounds<0>( buffer + n , LEN - n , map ,begins, args ... ); + Kokkos::Impl::throw_runtime_exception(std::string(buffer)); +#else + /* Check #1: is there a SharedAllocationRecord? + (we won't use it, but if its not there then there isn't + a corresponding SharedAllocationHeader containing a label). + This check should cover the case of Views that don't + have the Unmanaged trait but were initialized by pointer. */ + if (tracker.has_record()) { + Kokkos::Impl::operator_bounds_error_on_device<MapType>( + map, Kokkos::Impl::has_printable_label_typedef<MapType>()); + } else { + Kokkos::abort("OffsetView bounds error"); + } +#endif + } + } + +#ifdef KOKKOS_ACTIVE_EXECUTION_MEMORY_SPACE_HOST + KOKKOS_INLINE_FUNCTION + void runtime_check_rank_host(const size_t rank_dynamic, const size_t rank, + const index_list_type minIndices, const std::string & label) + { + bool isBad = false; + std::string message = "Kokkos::Experimental::OffsetView ERROR: for OffsetView labeled '" + label + "':"; + if (rank_dynamic != rank) { + message += "The full rank must be the same as the dynamic rank. full rank = "; + message += std::to_string(rank) + " dynamic rank = " + std::to_string(rank_dynamic) + "\n"; + isBad = true; + } + + size_t numOffsets = 0; + for(size_t i = 0; i < minIndices.size(); ++i ){ + if( minIndices.begin()[i] != -KOKKOS_INVALID_OFFSET) numOffsets++; + } + if (numOffsets != rank_dynamic) { + message += "The number of offsets provided ( " + std::to_string(numOffsets) + + " ) must equal the dynamic rank ( " + std::to_string(rank_dynamic) + " )."; + isBad = true; + } + + if(isBad) Kokkos::abort(message.c_str()); + } +#endif + + KOKKOS_INLINE_FUNCTION + void runtime_check_rank_device(const size_t rank_dynamic, const size_t rank, + const index_list_type minIndices) + { + if (rank_dynamic != rank) { + Kokkos::abort("The full rank of an OffsetView must be the same as the dynamic rank."); + } + size_t numOffsets = 0; + for(size_t i = 0; i < minIndices.size(); ++i ){ + if( minIndices.begin()[i] != -KOKKOS_INVALID_OFFSET) numOffsets++; + } + if (numOffsets != rank) { + Kokkos::abort("The number of offsets provided to an OffsetView constructor must equal the dynamic rank."); + } + + } + } + + template< class DataType , class ... Properties > + class OffsetView : public ViewTraits< DataType , Properties ... > { + public: + + typedef ViewTraits< DataType , Properties ... > traits ; + + + + private: + + template< class , class ... > friend class OffsetView ; + template< class , class ... > friend class View ; //FIXME delete this line + template< class , class ... > friend class Kokkos::Impl::ViewMapping ; + + + typedef Kokkos::Impl::ViewMapping< traits , void > map_type ; + typedef Kokkos::Impl::SharedAllocationTracker track_type ; + public: + enum { Rank = map_type::Rank }; + typedef Kokkos::Array<int64_t, Rank> begins_type ; + + + template <typename iType, typename std::enable_if< std::is_integral<iType>::value, iType>::type = 0> + KOKKOS_INLINE_FUNCTION + int64_t begin(const iType dimension) const { + return dimension < Rank ? m_begins[dimension] : 0; + } + + KOKKOS_INLINE_FUNCTION + begins_type begins() const { return m_begins;} + + template <typename iType, typename std::enable_if< std::is_integral<iType>::value, iType>::type = 0> + KOKKOS_INLINE_FUNCTION + int64_t end(const iType dimension) const {return begin(dimension) + m_map.extent(dimension);} + + + private: + track_type m_track ; + map_type m_map ; + begins_type m_begins; + + public: + //---------------------------------------- + /** \brief Compatible view of array of scalar types */ + typedef OffsetView< typename traits::scalar_array_type , + typename traits::array_layout , + typename traits::device_type , + typename traits::memory_traits > + array_type ; + + /** \brief Compatible view of const data type */ + typedef OffsetView< typename traits::const_data_type , + typename traits::array_layout , + typename traits::device_type , + typename traits::memory_traits > + const_type ; + + /** \brief Compatible view of non-const data type */ + typedef OffsetView< typename traits::non_const_data_type , + typename traits::array_layout , + typename traits::device_type , + typename traits::memory_traits > + non_const_type ; + + /** \brief Compatible HostMirror view */ + typedef OffsetView< typename traits::non_const_data_type , + typename traits::array_layout , + typename traits::host_mirror_space > + HostMirror ; + + //---------------------------------------- + // Domain rank and extents + + /** \brief rank() to be implemented + */ + //KOKKOS_INLINE_FUNCTION + //static + //constexpr unsigned rank() { return map_type::Rank; } + + template< typename iType > + KOKKOS_INLINE_FUNCTION constexpr + typename std::enable_if< std::is_integral<iType>::value , size_t >::type + extent( const iType & r ) const + { return m_map.extent(r); } + + template< typename iType > + KOKKOS_INLINE_FUNCTION constexpr + typename std::enable_if< std::is_integral<iType>::value , int >::type + extent_int( const iType & r ) const + { return static_cast<int>(m_map.extent(r)); } + + KOKKOS_INLINE_FUNCTION constexpr + typename traits::array_layout layout() const + { return m_map.layout(); } + + + KOKKOS_INLINE_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(); } + + template< typename iType > + KOKKOS_INLINE_FUNCTION constexpr + typename std::enable_if< std::is_integral<iType>::value , size_t >::type + stride(iType r) const { + return (r == 0 ? m_map.stride_0() : + (r == 1 ? m_map.stride_1() : + (r == 2 ? m_map.stride_2() : + (r == 3 ? m_map.stride_3() : + (r == 4 ? m_map.stride_4() : + (r == 5 ? m_map.stride_5() : + (r == 6 ? m_map.stride_6() : + m_map.stride_7()))))))); + } + + template< typename iType > + KOKKOS_INLINE_FUNCTION void stride( iType * const s ) const { m_map.stride(s); } + + //---------------------------------------- + // Range span is the span which contains all members. + + typedef typename map_type::reference_type reference_type ; + typedef typename map_type::pointer_type pointer_type ; + + enum { reference_type_is_lvalue_reference = std::is_lvalue_reference< reference_type >::value }; + + KOKKOS_INLINE_FUNCTION constexpr size_t span() const { return m_map.span(); } + KOKKOS_INLINE_FUNCTION bool span_is_contiguous() const { return m_map.span_is_contiguous(); } + KOKKOS_INLINE_FUNCTION constexpr pointer_type data() const { return m_map.data(); } + + //---------------------------------------- + // Allow specializations to query their specialized map + + KOKKOS_INLINE_FUNCTION + const Kokkos::Impl::ViewMapping< traits , void > & + implementation_map() const { return m_map ; } + + //---------------------------------------- + + private: + + enum { + is_layout_left = std::is_same< typename traits::array_layout + , Kokkos::LayoutLeft >::value , + + is_layout_right = std::is_same< typename traits::array_layout + , Kokkos::LayoutRight >::value , + + is_layout_stride = std::is_same< typename traits::array_layout + , Kokkos::LayoutStride >::value , + + is_default_map = + std::is_same< typename traits::specialize , void >::value && + ( is_layout_left || is_layout_right || is_layout_stride ) + }; + + template< class Space , bool = Kokkos::Impl::MemorySpaceAccess< Space , typename traits::memory_space >::accessible > struct verify_space + { KOKKOS_FORCEINLINE_FUNCTION static void check() {} }; + + template< class Space > struct verify_space<Space,false> + { KOKKOS_FORCEINLINE_FUNCTION static void check() + { Kokkos::abort("Kokkos::View ERROR: attempt to access inaccessible memory space"); + }; + }; + +#if defined( KOKKOS_ENABLE_DEBUG_BOUNDS_CHECK ) + +#define KOKKOS_IMPL_OFFSETVIEW_OPERATOR_VERIFY( ARG ) \ + OffsetView::template verify_space< Kokkos::Impl::ActiveExecutionMemorySpace >::check(); \ + Kokkos::Experimental::Impl::offsetview_verify_operator_bounds< typename traits::memory_space > ARG ; + +#else + +#define KOKKOS_IMPL_OFFSETVIEW_OPERATOR_VERIFY( ARG ) \ + OffsetView::template verify_space< Kokkos::Impl::ActiveExecutionMemorySpace >::check(); + +#endif + public: + + //------------------------------ + // Rank 0 operator() + + KOKKOS_FORCEINLINE_FUNCTION + reference_type + operator()() const + { + return m_map.reference(); + } + //------------------------------ + // Rank 1 operator() + + + template< typename I0> + KOKKOS_FORCEINLINE_FUNCTION + typename std::enable_if< + ( Kokkos::Impl::are_integral<I0>::value + && ( 1 == Rank ) + && ! is_default_map + ), reference_type >::type + operator()( const I0 & i0) const + { + + KOKKOS_IMPL_OFFSETVIEW_OPERATOR_VERIFY( (m_track,m_map, m_begins, i0) ) + const size_t j0 = i0 - m_begins[0]; + return m_map.reference(j0); + } + + template< typename I0> + KOKKOS_FORCEINLINE_FUNCTION + typename std::enable_if< + ( Kokkos::Impl::are_integral<I0>::value + && ( 1 == Rank ) + && is_default_map + && ! is_layout_stride + ), reference_type >::type + operator()( const I0 & i0 ) const + { + KOKKOS_IMPL_OFFSETVIEW_OPERATOR_VERIFY( (m_track,m_map, m_begins, i0) ) + const size_t j0 = i0 - m_begins[0]; + return m_map.m_impl_handle[ j0 ]; + } + + template< typename I0 > + KOKKOS_FORCEINLINE_FUNCTION + typename std::enable_if< + ( Kokkos::Impl::are_integral<I0>::value + && ( 1 == Rank ) + && is_default_map + && is_layout_stride + ), reference_type >::type + operator()( const I0 & i0) const + { + KOKKOS_IMPL_OFFSETVIEW_OPERATOR_VERIFY( (m_track,m_map, m_begins, i0) ) + const size_t j0 = i0 - m_begins[0]; + return m_map.m_impl_handle[ m_map.m_impl_offset.m_stride.S0 * j0 ]; + } + //------------------------------ + // Rank 1 operator[] + + template< typename I0 > + KOKKOS_FORCEINLINE_FUNCTION + typename std::enable_if< + ( Kokkos::Impl::are_integral<I0>::value + && ( 1 == Rank ) + && ! is_default_map + ), reference_type >::type + operator[]( const I0 & i0 ) const + { + KOKKOS_IMPL_OFFSETVIEW_OPERATOR_VERIFY( (m_track,m_map, m_begins, i0) ) + const size_t j0 = i0 - m_begins[0]; + return m_map.reference(j0); + } + + template< typename I0 > + KOKKOS_FORCEINLINE_FUNCTION + typename std::enable_if< + ( Kokkos::Impl::are_integral<I0>::value + && ( 1 == Rank ) + && is_default_map + && ! is_layout_stride + ), reference_type >::type + operator[]( const I0 & i0 ) const + { + KOKKOS_IMPL_OFFSETVIEW_OPERATOR_VERIFY( (m_track,m_map, m_begins, i0) ) + const size_t j0 = i0 - m_begins[0]; + return m_map.m_impl_handle[ j0 ]; + } + + template< typename I0 > + KOKKOS_FORCEINLINE_FUNCTION + typename std::enable_if< + ( Kokkos::Impl::are_integral<I0>::value + && ( 1 == Rank ) + && is_default_map + && is_layout_stride + ), reference_type >::type + operator[]( const I0 & i0 ) const + { + KOKKOS_IMPL_OFFSETVIEW_OPERATOR_VERIFY( (m_track,m_map, m_begins, i0) ) + const size_t j0 = i0 - m_begins[0]; + return m_map.m_impl_handle[ m_map.m_impl_offset.m_stride.S0 * j0 ]; + } + + + //------------------------------ + // Rank 2 + + template< typename I0 , typename I1 > + KOKKOS_FORCEINLINE_FUNCTION + typename std::enable_if< + ( Kokkos::Impl::are_integral<I0,I1>::value + && ( 2 == Rank ) + && ! is_default_map + ), reference_type >::type + operator()( const I0 & i0 , const I1 & i1) const + { + KOKKOS_IMPL_OFFSETVIEW_OPERATOR_VERIFY( (m_track,m_map, m_begins, i0,i1) ) + const size_t j0 = i0 - m_begins[0]; + const size_t j1 = i1 - m_begins[1]; + return m_map.reference(j0,j1); + } + + template< typename I0 , typename I1 > + KOKKOS_FORCEINLINE_FUNCTION + typename std::enable_if< + ( Kokkos::Impl::are_integral<I0,I1>::value + && ( 2 == Rank ) + && is_default_map + && is_layout_left && ( traits::rank_dynamic == 0 ) + ), reference_type >::type + operator()( const I0 & i0 , const I1 & i1) const + { + KOKKOS_IMPL_OFFSETVIEW_OPERATOR_VERIFY( (m_track,m_map, m_begins, i0,i1) ) + const size_t j0 = i0 - m_begins[0]; + const size_t j1 = i1 - m_begins[1]; + return m_map.m_impl_handle[ j0 + m_map.m_impl_offset.m_dim.N0 * j1 ]; + } + + template< typename I0 , typename I1> + KOKKOS_FORCEINLINE_FUNCTION + typename std::enable_if< + ( Kokkos::Impl::are_integral<I0,I1>::value + && ( 2 == Rank ) + && is_default_map + && is_layout_left && ( traits::rank_dynamic != 0 ) + ), reference_type >::type + operator()( const I0 & i0 , const I1 & i1) const + { + KOKKOS_IMPL_OFFSETVIEW_OPERATOR_VERIFY( (m_track,m_map, m_begins, i0,i1) ) + const size_t j0 = i0 - m_begins[0]; + const size_t j1 = i1 - m_begins[1]; + return m_map.m_impl_handle[ j0 + m_map.m_impl_offset.m_stride * j1 ]; + } + + template< typename I0 , typename I1 > + KOKKOS_FORCEINLINE_FUNCTION + typename std::enable_if< + ( Kokkos::Impl::are_integral<I0,I1>::value + && ( 2 == Rank ) + && is_default_map + && is_layout_right && ( traits::rank_dynamic == 0 ) + ), reference_type >::type + operator()( const I0 & i0 , const I1 & i1 ) const + { + KOKKOS_IMPL_OFFSETVIEW_OPERATOR_VERIFY( (m_track,m_map, m_begins, i0,i1) ) + const size_t j0 = i0 - m_begins[0]; + const size_t j1 = i1 - m_begins[1]; + return m_map.m_impl_handle[ j1 + m_map.m_impl_offset.m_dim.N1 * j0 ]; + } + + template< typename I0 , typename I1 > + KOKKOS_FORCEINLINE_FUNCTION + typename std::enable_if< + ( Kokkos::Impl::are_integral<I0,I1>::value + && ( 2 == Rank ) + && is_default_map + && is_layout_right && ( traits::rank_dynamic != 0 ) + ), reference_type >::type + operator()( const I0 & i0 , const I1 & i1 ) const + { + KOKKOS_IMPL_OFFSETVIEW_OPERATOR_VERIFY( (m_track,m_map, m_begins, i0,i1) ) + const size_t j0 = i0 - m_begins[0]; + const size_t j1 = i1 - m_begins[1]; + return m_map.m_impl_handle[ j1 + m_map.m_impl_offset.m_stride * j0 ]; + } + + template< typename I0 , typename I1> + KOKKOS_FORCEINLINE_FUNCTION + typename std::enable_if< + ( Kokkos::Impl::are_integral<I0,I1>::value + && ( 2 == Rank ) + && is_default_map + && is_layout_stride + ), reference_type >::type + operator()( const I0 & i0 , const I1 & i1 ) const + { + KOKKOS_IMPL_OFFSETVIEW_OPERATOR_VERIFY( (m_track,m_map, m_begins, i0,i1) ) + const size_t j0 = i0 - m_begins[0]; + const size_t j1 = i1 - m_begins[1]; + return m_map.m_impl_handle[ j0 * m_map.m_impl_offset.m_stride.S0 + + j1 * m_map.m_impl_offset.m_stride.S1 ]; + } + + //------------------------------ + // Rank 3 + + template< typename I0 , typename I1 , typename I2 > + KOKKOS_FORCEINLINE_FUNCTION + typename std::enable_if< + ( Kokkos::Impl::are_integral<I0,I1,I2>::value + && ( 3 == Rank ) + && is_default_map + ), reference_type >::type + operator()( const I0 & i0 , const I1 & i1 , const I2 & i2) const + { + KOKKOS_IMPL_OFFSETVIEW_OPERATOR_VERIFY( (m_track,m_map, m_begins, i0,i1, i2) ) + const size_t j0 = i0 - m_begins[0]; + const size_t j1 = i1 - m_begins[1]; + const size_t j2 = i2 - m_begins[2]; + return m_map.m_impl_handle[ m_map.m_impl_offset(j0, j1, j2) ]; + } + + template< typename I0 , typename I1 , typename I2> + KOKKOS_FORCEINLINE_FUNCTION + typename std::enable_if< + ( Kokkos::Impl::are_integral<I0,I1,I2>::value + && ( 3 == Rank ) + && ! is_default_map + ), reference_type >::type + operator()( const I0 & i0 , const I1 & i1 , const I2 & i2) const + { + KOKKOS_IMPL_OFFSETVIEW_OPERATOR_VERIFY( (m_track,m_map,m_begins, i0,i1, i2) ) + const size_t j0 = i0 - m_begins[0]; + const size_t j1 = i1 - m_begins[1]; + const size_t j2 = i2 - m_begins[2]; + return m_map.reference(j0, j1, j2); + } + + //------------------------------ + // Rank 4 + + template< typename I0 , typename I1 , typename I2 , typename I3> + KOKKOS_FORCEINLINE_FUNCTION + typename std::enable_if< + ( Kokkos::Impl::are_integral<I0,I1,I2,I3>::value + && ( 4 == Rank ) + && is_default_map + ), reference_type >::type + operator()( const I0 & i0 , const I1 & i1 , const I2 & i2 , const I3 & i3) const + { + KOKKOS_IMPL_OFFSETVIEW_OPERATOR_VERIFY( (m_track,m_map, m_begins, i0,i1, i2, i3) ) + const size_t j0 = i0 - m_begins[0]; + const size_t j1 = i1 - m_begins[1]; + const size_t j2 = i2 - m_begins[2]; + const size_t j3 = i3 - m_begins[3]; + return m_map.m_impl_handle[ m_map.m_impl_offset(j0,j1,j2,j3) ]; + } + + template< typename I0 , typename I1 , typename I2 , typename I3 > + KOKKOS_FORCEINLINE_FUNCTION + typename std::enable_if< + ( Kokkos::Impl::are_integral<I0,I1,I2,I3>::value + && ( 4 == Rank ) + && ! is_default_map + ), reference_type >::type + operator()( const I0 & i0 , const I1 & i1 , const I2 & i2 , const I3 & i3) const + { + KOKKOS_IMPL_OFFSETVIEW_OPERATOR_VERIFY( (m_track,m_map, m_begins, i0,i1, i2, i3) ) + const size_t j0 = i0 - m_begins[0]; + const size_t j1 = i1 - m_begins[1]; + const size_t j2 = i2 - m_begins[2]; + const size_t j3 = i3 - m_begins[3]; + return m_map.reference(j0,j1,j2,j3); + } + + //------------------------------ + // Rank 5 + + template< typename I0 , typename I1 , typename I2 , typename I3 + , typename I4> + KOKKOS_FORCEINLINE_FUNCTION + typename std::enable_if< + ( Kokkos::Impl::are_integral<I0,I1,I2,I3,I4>::value + && ( 5 == Rank ) + && is_default_map + ), reference_type >::type + operator()( const I0 & i0 , const I1 & i1 , const I2 & i2 , const I3 & i3 + , const I4 & i4 ) const + { + KOKKOS_IMPL_OFFSETVIEW_OPERATOR_VERIFY( (m_track,m_map, m_begins, i0,i1, i2, i3, i4) ) + const size_t j0 = i0 - m_begins[0]; + const size_t j1 = i1 - m_begins[1]; + const size_t j2 = i2 - m_begins[2]; + const size_t j3 = i3 - m_begins[3]; + const size_t j4 = i4 - m_begins[4]; + return m_map.m_impl_handle[ m_map.m_impl_offset(j0, j1,j2, j3, j4) ]; + } + + template< typename I0 , typename I1 , typename I2 , typename I3 + , typename I4> + KOKKOS_FORCEINLINE_FUNCTION + typename std::enable_if< + ( Kokkos::Impl::are_integral<I0,I1,I2,I3,I4>::value + && ( 5 == Rank ) + && ! is_default_map + ), reference_type >::type + operator()( const I0 & i0 , const I1 & i1 , const I2 & i2 , const I3 & i3 + , const I4 & i4) const + { + KOKKOS_IMPL_OFFSETVIEW_OPERATOR_VERIFY( (m_track,m_map, m_begins, i0,i1, i2, i3, i4) ) + const size_t j0 = i0 - m_begins[0]; + const size_t j1 = i1 - m_begins[1]; + const size_t j2 = i2 - m_begins[2]; + const size_t j3 = i3 - m_begins[3]; + const size_t j4 = i4 - m_begins[4]; + return m_map.reference(j0,j1,j2,j3,j4); + } + + //------------------------------ + // Rank 6 + + template< typename I0 , typename I1 , typename I2 , typename I3 + , typename I4 , typename I5 > + KOKKOS_FORCEINLINE_FUNCTION + typename std::enable_if< + ( Kokkos::Impl::are_integral<I0,I1,I2,I3,I4,I5>::value + && ( 6 == Rank ) + && is_default_map + ), reference_type >::type + operator()( const I0 & i0 , const I1 & i1 , const I2 & i2 , const I3 & i3 + , const I4 & i4 , const I5 & i5 ) const + { + KOKKOS_IMPL_OFFSETVIEW_OPERATOR_VERIFY( (m_track,m_map,m_begins, i0,i1, i2, i3, i4, i5) ) + const size_t j0 = i0 - m_begins[0]; + const size_t j1 = i1 - m_begins[1]; + const size_t j2 = i2 - m_begins[2]; + const size_t j3 = i3 - m_begins[3]; + const size_t j4 = i4 - m_begins[4]; + const size_t j5 = i5 - m_begins[5]; + return m_map.m_impl_handle[ m_map.m_impl_offset(j0,j1,j2,j3,j4,j5) ]; + } + + template< typename I0 , typename I1 , typename I2 , typename I3 + , typename I4 , typename I5> + KOKKOS_FORCEINLINE_FUNCTION + typename std::enable_if< + ( Kokkos::Impl::are_integral<I0,I1,I2,I3,I4,I5>::value + && ( 6 == Rank ) + && ! is_default_map + ), reference_type >::type + operator()( const I0 & i0 , const I1 & i1 , const I2 & i2 , const I3 & i3 + , const I4 & i4 , const I5 & i5) const + { + KOKKOS_IMPL_OFFSETVIEW_OPERATOR_VERIFY( (m_track,m_map,m_begins, i0,i1, i2, i3, i4, i5) ) + const size_t j0 = i0 - m_begins[0]; + const size_t j1 = i1 - m_begins[1]; + const size_t j2 = i2 - m_begins[2]; + const size_t j3 = i3 - m_begins[3]; + const size_t j4 = i4 - m_begins[4]; + const size_t j5 = i5 - m_begins[5]; + return m_map.reference(j0,j1,j2,j3,j4,j5); + } + + //------------------------------ + // Rank 7 + + template< typename I0 , typename I1 , typename I2 , typename I3 + , typename I4 , typename I5 , typename I6> + KOKKOS_FORCEINLINE_FUNCTION + typename std::enable_if< + ( Kokkos::Impl::are_integral<I0,I1,I2,I3,I4,I5,I6>::value + && ( 7 == Rank ) + && is_default_map + ), reference_type >::type + operator()( const I0 & i0 , const I1 & i1 , const I2 & i2 , const I3 & i3 + , const I4 & i4 , const I5 & i5 , const I6 & i6) const + { + KOKKOS_IMPL_OFFSETVIEW_OPERATOR_VERIFY( (m_track,m_map,m_begins, i0,i1, i2, i3, i4, i5, i6) ) + const size_t j0 = i0 - m_begins[0]; + const size_t j1 = i1 - m_begins[1]; + const size_t j2 = i2 - m_begins[2]; + const size_t j3 = i3 - m_begins[3]; + const size_t j4 = i4 - m_begins[4]; + const size_t j5 = i5 - m_begins[5]; + const size_t j6 = i6 - m_begins[6]; + return m_map.m_impl_handle[ m_map.m_impl_offset(j0,j1,j2,j3,j4,j5,j6) ]; + } + + template< typename I0 , typename I1 , typename I2 , typename I3 + , typename I4 , typename I5 , typename I6 > + KOKKOS_FORCEINLINE_FUNCTION + typename std::enable_if< + ( Kokkos::Impl::are_integral<I0,I1,I2,I3,I4,I5,I6>::value + && ( 7 == Rank ) + && ! is_default_map + ), reference_type >::type + operator()( const I0 & i0 , const I1 & i1 , const I2 & i2 , const I3 & i3 + , const I4 & i4 , const I5 & i5 , const I6 & i6) const + { + KOKKOS_IMPL_OFFSETVIEW_OPERATOR_VERIFY( (m_track,m_map,m_begins, i0,i1, i2, i3, i4, i5, i6) ) + const size_t j0 = i0 - m_begins[0]; + const size_t j1 = i1 - m_begins[1]; + const size_t j2 = i2 - m_begins[2]; + const size_t j3 = i3 - m_begins[3]; + const size_t j4 = i4 - m_begins[4]; + const size_t j5 = i5 - m_begins[5]; + const size_t j6 = i6 - m_begins[6]; + return m_map.reference(j0,j1,j2,j3,j4,j5,j6); + } + + //------------------------------ + // Rank 8 + + template< typename I0 , typename I1 , typename I2 , typename I3 + , typename I4 , typename I5 , typename I6 , typename I7 > + KOKKOS_FORCEINLINE_FUNCTION + typename std::enable_if< + ( Kokkos::Impl::are_integral<I0,I1,I2,I3,I4,I5,I6,I7>::value + && ( 8 == Rank ) + && is_default_map + ), reference_type >::type + operator()( const I0 & i0 , const I1 & i1 , const I2 & i2 , const I3 & i3 + , const I4 & i4 , const I5 & i5 , const I6 & i6 , const I7 & i7) const + { + KOKKOS_IMPL_OFFSETVIEW_OPERATOR_VERIFY( (m_track,m_map,m_begins, i0,i1, i2, i3, i4, i5, i6, i7) ) + const size_t j0 = i0 - m_begins[0]; + const size_t j1 = i1 - m_begins[1]; + const size_t j2 = i2 - m_begins[2]; + const size_t j3 = i3 - m_begins[3]; + const size_t j4 = i4 - m_begins[4]; + const size_t j5 = i5 - m_begins[5]; + const size_t j6 = i6 - m_begins[6]; + const size_t j7 = i7 - m_begins[7]; + return m_map.m_impl_handle[ m_map.m_impl_offset(j0,j1,j2,j3,j4,j5,j6,j7) ]; + } + + template< typename I0 , typename I1 , typename I2 , typename I3 + , typename I4 , typename I5 , typename I6 , typename I7> + KOKKOS_FORCEINLINE_FUNCTION + typename std::enable_if< + ( Kokkos::Impl::are_integral<I0,I1,I2,I3,I4,I5,I6,I7>::value + && ( 8 == Rank ) + && ! is_default_map + ), reference_type >::type + operator()( const I0 & i0 , const I1 & i1 , const I2 & i2 , const I3 & i3 + , const I4 & i4 , const I5 & i5 , const I6 & i6 , const I7 & i7 ) const + { + KOKKOS_IMPL_OFFSETVIEW_OPERATOR_VERIFY( (m_track,m_map,m_begins, i0,i1, i2, i3, i4, i5, i6, i7) ) + const size_t j0 = i0 - m_begins[0]; + const size_t j1 = i1 - m_begins[1]; + const size_t j2 = i2 - m_begins[2]; + const size_t j3 = i3 - m_begins[3]; + const size_t j4 = i4 - m_begins[4]; + const size_t j5 = i5 - m_begins[5]; + const size_t j6 = i6 - m_begins[6]; + const size_t j7 = i7 - m_begins[7]; + return m_map.reference(j0,j1,j2,j3,j4,j5,j6,j7); + } + + +#undef KOKKOS_IMPL_OFFSETVIEW_OPERATOR_VERIFY + + //---------------------------------------- + // Standard destructor, constructors, and assignment operators + + KOKKOS_INLINE_FUNCTION + ~OffsetView() {} + + KOKKOS_INLINE_FUNCTION + OffsetView() : m_track(), m_map() { + + for(size_t i = 0; i < Rank; ++i) m_begins[i] = KOKKOS_INVALID_INDEX; + } + + KOKKOS_INLINE_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 + 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 + OffsetView & operator = ( const OffsetView & rhs ) { + m_track = rhs.m_track ; + m_map = rhs.m_map ; + m_begins = rhs.m_begins; + return *this ; + } + + KOKKOS_INLINE_FUNCTION + OffsetView & operator = ( OffsetView && rhs ) { + m_track = std::move(rhs.m_track) ; + m_map = std::move(rhs.m_map) ; + m_begins = std::move(rhs.m_begins) ; + return *this ; + } + + //interoperability with View + private: + typedef View< typename traits::scalar_array_type , + typename traits::array_layout , + typename traits::device_type , + typename traits::memory_traits > view_type; + public: + + KOKKOS_INLINE_FUNCTION + view_type view() const { + + view_type v(m_track, m_map); + return v ; + } + + template<class RT, class ... RP> + KOKKOS_INLINE_FUNCTION + OffsetView( const View<RT, RP...> & aview) : + m_track(aview.impl_track()), m_map(){ + + typedef typename OffsetView<RT,RP...>::traits SrcTraits ; + typedef Kokkos::Impl::ViewMapping< traits , SrcTraits , void > Mapping ; + static_assert( Mapping::is_assignable , "Incompatible OffsetView copy construction" ); + Mapping::assign( m_map , aview.impl_map() , m_track ); + + for (int i = 0; i < aview.Rank; ++i) { + m_begins[i] = 0; + } + } + + template<class RT, class ... RP> + KOKKOS_INLINE_FUNCTION + OffsetView( const View<RT, RP...> & aview + ,const index_list_type & minIndices) : + m_track(aview.impl_track()), m_map(){ + + typedef typename OffsetView<RT,RP...>::traits SrcTraits ; + typedef Kokkos::Impl::ViewMapping< traits , SrcTraits , void > Mapping ; + static_assert( Mapping::is_assignable , "Incompatible OffsetView copy construction" ); + Mapping::assign( m_map , aview.impl_map() , m_track ); + +#ifdef KOKKOS_ACTIVE_EXECUTION_MEMORY_SPACE_HOST + Kokkos::Experimental::Impl::runtime_check_rank_host(traits::rank_dynamic, Rank, minIndices, label()); +#else + Kokkos::Experimental::Impl::runtime_check_rank_device(traits::rank_dynamic, Rank, minIndices); + +#endif + + for (size_t i = 0; i < minIndices.size(); ++i) { + m_begins[i] = minIndices.begin()[i]; + } + } + template<class RT, class ... RP> + KOKKOS_INLINE_FUNCTION + OffsetView( const View<RT, RP...> & aview + ,const begins_type & beg) : + m_track(aview.impl_track()), m_map(), m_begins(beg){ + + typedef typename OffsetView<RT,RP...>::traits SrcTraits ; + typedef Kokkos::Impl::ViewMapping< traits , SrcTraits , void > Mapping ; + static_assert( Mapping::is_assignable , "Incompatible OffsetView copy construction" ); + Mapping::assign( m_map , aview.impl_map() , m_track ); + + + //#ifdef KOKKOS_ACTIVE_EXECUTION_MEMORY_SPACE_HOST + // Kokkos::Experimental::Impl::runtime_check_rank_host(traits::rank_dynamic, Rank, minIndices, label()); + //#else + // Kokkos::Experimental::Impl::runtime_check_rank_device(traits::rank_dynamic, Rank, minIndices); + // + //#endif + + } + + // may assign unmanaged from managed. + + + template< class RT , class ... RP > + KOKKOS_INLINE_FUNCTION + OffsetView( const OffsetView<RT,RP...> & rhs ) + : m_track( rhs.m_track , traits::is_managed ) + , m_map() + , m_begins(rhs.m_begins) + { + typedef typename OffsetView<RT,RP...>::traits SrcTraits ; + typedef Kokkos::Impl::ViewMapping< traits , SrcTraits , void > Mapping ; + static_assert( Mapping::is_assignable , "Incompatible OffsetView copy construction" ); + Mapping::assign( m_map , rhs.m_map , rhs.m_track ); //swb what about assign? + } + + + //---------------------------------------- + // Allocation tracking properties + KOKKOS_INLINE_FUNCTION + int use_count() const + { return m_track.use_count(); } + + inline + const std::string label() const + { return m_track.template get_label< typename traits::memory_space >(); } + + + template< typename Label> + explicit inline + OffsetView( const Label & arg_label + ,typename std::enable_if<Kokkos::Impl::is_view_label<Label>::value , const index_list_type >::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 + + ) : OffsetView( Kokkos::Impl::ViewCtorProp< std::string >( arg_label ), + typename traits::array_layout + ( range0.begin()[1] - range0.begin()[0] + 1, range1.begin()[1] - range1.begin()[0] + 1 , + range2.begin()[1] - range2.begin()[0] + 1, range3.begin()[1] - range3.begin()[0] + 1, + range4.begin()[1] - range4.begin()[0] + 1, range5.begin()[1] - range5.begin()[0] + 1 , + range6.begin()[1] - range6.begin()[0] + 1, range7.begin()[1] - range7.begin()[0] + 1 ), + {range0.begin()[0], range1.begin()[0], range2.begin()[0], range3.begin()[0], range4.begin()[0], + range5.begin()[0], range6.begin()[0], range7.begin()[0] }) + { + + } + + + + template<class ... P > + explicit KOKKOS_INLINE_FUNCTION + OffsetView( const Kokkos::Impl::ViewCtorProp< P ... > & arg_prop + ,typename std::enable_if< Kokkos::Impl::ViewCtorProp< P... >::has_pointer , typename traits::array_layout >::type const & arg_layout + ,const index_list_type minIndices + ) + : m_track() // No memory tracking + , m_map( arg_prop , arg_layout ) + { + + + for (size_t i = 0; i < minIndices.size(); ++i) { + m_begins[i] = minIndices.begin()[i]; + } + static_assert( + std::is_same< pointer_type + , typename Kokkos::Impl::ViewCtorProp< P... >::pointer_type + >::value , + "When constructing OffsetView to wrap user memory, you must supply matching pointer type" ); + } + + template<class ... P > + explicit inline + OffsetView( const Kokkos::Impl::ViewCtorProp< P ... > & arg_prop + , typename std::enable_if< ! Kokkos::Impl::ViewCtorProp< P... >::has_pointer , typename traits::array_layout>::type const & arg_layout + ,const index_list_type minIndices + ) + : m_track() + , m_map() + + { + + for(size_t i = 0; i < Rank; ++i) + m_begins[i] = minIndices.begin()[i]; + + // Append layout and spaces if not input + typedef Kokkos::Impl::ViewCtorProp< P ... > alloc_prop_input ; + + // use 'std::integral_constant<unsigned,I>' for non-types + // to avoid duplicate class error. + typedef Kokkos::Impl::ViewCtorProp + < P ..., typename std::conditional < alloc_prop_input::has_label + , std::integral_constant<unsigned,0>, typename std::string >::type + , typename std::conditional + < alloc_prop_input::has_memory_space + , std::integral_constant<unsigned,1> + , typename traits::device_type::memory_space + >::type + , typename std::conditional + < alloc_prop_input::has_execution_space + , std::integral_constant<unsigned,2> + , typename traits::device_type::execution_space + >::type + > alloc_prop ; + + static_assert( traits::is_managed + , "OffsetView allocation constructor requires managed memory" ); + + if ( alloc_prop::initialize && +#ifdef KOKKOS_ENABLE_DEPRECATED_CODE + ! alloc_prop::execution_space::is_initialized() +#else + ! alloc_prop::execution_space::impl_is_initialized() +#endif + ) { + // If initializing view data then + // the execution space must be initialized. + Kokkos::Impl::throw_runtime_exception("Constructing OffsetView and initializing data with uninitialized execution space"); + } + + // Copy the input allocation properties with possibly defaulted properties + alloc_prop prop( arg_prop ); + + //------------------------------------------------------------ +#if defined( KOKKOS_ENABLE_CUDA ) + // If allocating in CudaUVMSpace must fence before and after + // the allocation to protect against possible concurrent access + // on the CPU and the GPU. + // Fence using the trait's executon space (which will be Kokkos::Cuda) + // to avoid incomplete type errors from usng Kokkos::Cuda directly. + if ( std::is_same< Kokkos::CudaUVMSpace , typename traits::device_type::memory_space >::value ) { + traits::device_type::memory_space::execution_space::fence(); + } +#endif + //------------------------------------------------------------ + + Kokkos::Impl::SharedAllocationRecord<> * + record = m_map.allocate_shared( prop , arg_layout ); + + //------------------------------------------------------------ +#if defined( KOKKOS_ENABLE_CUDA ) + if ( std::is_same< Kokkos::CudaUVMSpace , typename traits::device_type::memory_space >::value ) { + traits::device_type::memory_space::execution_space::fence(); + } +#endif + //------------------------------------------------------------ + + // Setup and initialization complete, start tracking + m_track.assign_allocated_record_to_uninitialized( record ); + +#ifdef KOKKOS_ACTIVE_EXECUTION_MEMORY_SPACE_HOST + Kokkos::Experimental::Impl::runtime_check_rank_host(traits::rank_dynamic, Rank, minIndices, label()); +#else + Kokkos::Experimental::Impl::runtime_check_rank_device(traits::rank_dynamic, Rank, minIndices); + +#endif + + } + + + }; + + + + /** \brief Temporary free function rank() + * until rank() is implemented + * in the View + */ + template < typename D , class ... P > + KOKKOS_INLINE_FUNCTION + constexpr unsigned rank( const OffsetView<D , P...> & V ) { return V.Rank; } //Temporary until added to view + + //---------------------------------------------------------------------------- + //---------------------------------------------------------------------------- + namespace Impl { + + template< class T > + KOKKOS_INLINE_FUNCTION + typename std::enable_if< std::is_integral<T>::value, T>::type + shift_input(const T arg, const int64_t offset) + { + return arg - offset; + } + + KOKKOS_INLINE_FUNCTION + Kokkos::Impl::ALL_t + shift_input(const Kokkos::Impl::ALL_t arg, const int64_t offset) + { + return arg; + } + + template< class T > + KOKKOS_INLINE_FUNCTION + typename std::enable_if< std::is_integral<T>::value, Kokkos::pair<T,T> >::type + shift_input(const Kokkos::pair<T, T> arg, const int64_t offset) + { + + return Kokkos::make_pair<T,T>(arg.first - offset, arg.second - offset); + + } + template< class T > + inline + typename std::enable_if< std::is_integral<T>::value, std::pair<T,T> >::type + shift_input(const std::pair<T, T> arg, const int64_t offset) + { + + return std::make_pair<T,T>(arg.first - offset, arg.second - offset); + + } + + template <size_t N, class Arg, class A> + KOKKOS_INLINE_FUNCTION + void + map_arg_to_new_begin(const size_t i, + Kokkos::Array<int64_t, N> &subviewBegins, typename std::enable_if< N != 0, const Arg>::type shiftedArg, + const Arg arg, const A viewBegins, size_t & counter) { + + if( !std::is_integral<Arg>::value) { + subviewBegins[counter] = shiftedArg == arg ? viewBegins[i] : 0; + counter++; + } + } + + template <size_t N, class Arg, class A> + KOKKOS_INLINE_FUNCTION + void + map_arg_to_new_begin(const size_t i, + Kokkos::Array<int64_t, N> &subviewBegins, typename std::enable_if< N == 0, const Arg>::type shiftedArg, + const Arg arg, const A viewBegins, size_t & counter) { + + } + + + template< class D, class ... P , class T > + KOKKOS_INLINE_FUNCTION + typename Kokkos::Experimental::Impl::GetOffsetViewTypeFromViewType<typename Kokkos::Impl::ViewMapping + < void /* deduce subview type from source view traits */ + , ViewTraits< D , P... > + , T + >::type >::type + subview_offset(const OffsetView< D, P... > & src, T arg) { + + auto theView = src.view(); + auto begins = src.begins(); + + T shiftedArg = shift_input(arg, begins[0]); + + constexpr size_t rank = Kokkos::Impl::ViewMapping + < void /* deduce subview type from source view traits */ + , ViewTraits< D , P... > + , T>::type::Rank; + + auto theSubview = Kokkos::subview( theView , shiftedArg); + + Kokkos::Array<int64_t, rank> subviewBegins; + size_t counter = 0; + Kokkos::Experimental::Impl::map_arg_to_new_begin(0, subviewBegins, shiftedArg, arg, begins, counter); + + typename Kokkos::Experimental::Impl::GetOffsetViewTypeFromViewType<typename Kokkos::Impl::ViewMapping< + void /* deduce subview type from source view traits */ + , ViewTraits< D , P... > , T >::type >::type offsetView(theSubview, subviewBegins); + + return offsetView; + + } + + template< class D, class ... P , class T0, class T1 > + KOKKOS_INLINE_FUNCTION + typename Kokkos::Experimental::Impl::GetOffsetViewTypeFromViewType<typename Kokkos::Impl::ViewMapping + < void /* deduce subview type from source view traits */ + , ViewTraits< D , P... > + , T0, T1 + >::type >::type + subview_offset(const Kokkos::Experimental::OffsetView< D, P... > & src, T0 arg0, T1 arg1) { + + auto theView = src.view(); + auto begins = src.begins(); + + T0 shiftedArg0 = shift_input(arg0, begins[0]); + T1 shiftedArg1 = shift_input(arg1, begins[1]); + + auto theSubview = Kokkos::subview(theView , shiftedArg0, shiftedArg1); + constexpr size_t rank = Kokkos::Impl::ViewMapping + < void /* deduce subview type from source view traits */ + , ViewTraits< D , P... > + , T0, T1>::type::Rank; + + Kokkos::Array<int64_t, rank> subviewBegins; + size_t counter = 0; + Kokkos::Experimental::Impl::map_arg_to_new_begin(0, subviewBegins, shiftedArg0, arg0, begins, counter); + Kokkos::Experimental::Impl::map_arg_to_new_begin(1, subviewBegins, shiftedArg1, arg1, begins, counter); + + typename Kokkos::Experimental::Impl::GetOffsetViewTypeFromViewType<typename Kokkos::Impl::ViewMapping< + void /* deduce subview type from source view traits */ + , ViewTraits< D , P... > , T0, T1 >::type >::type offsetView(theSubview, subviewBegins); + + return offsetView; + + } + + template< class D, class ... P , class T0, class T1, class T2 > + KOKKOS_INLINE_FUNCTION + typename Kokkos::Experimental::Impl::GetOffsetViewTypeFromViewType<typename Kokkos::Impl::ViewMapping + < void /* deduce subview type from source view traits */ + , ViewTraits< D , P... > + , T0, T1, T2 + >::type >::type + subview_offset(const OffsetView< D, P... > & src, T0 arg0, T1 arg1, T2 arg2) { + + auto theView = src.view(); + auto begins = src.begins(); + + T0 shiftedArg0 = shift_input(arg0, begins[0]); + T1 shiftedArg1 = shift_input(arg1, begins[1]); + T2 shiftedArg2 = shift_input(arg2, begins[2]); + + auto theSubview = Kokkos::subview( theView , shiftedArg0, shiftedArg1, shiftedArg2); + + constexpr size_t rank = Kokkos::Impl::ViewMapping + < void /* deduce subview type from source view traits */ + , ViewTraits< D , P... > + , T0, T1, T2>::type::Rank; + + Kokkos::Array<int64_t, rank> subviewBegins; + + size_t counter = 0; + Kokkos::Experimental::Impl::map_arg_to_new_begin(0, subviewBegins, shiftedArg0, arg0, begins, counter); + Kokkos::Experimental::Impl::map_arg_to_new_begin(1, subviewBegins, shiftedArg1, arg1, begins, counter); + Kokkos::Experimental::Impl::map_arg_to_new_begin(2, subviewBegins, shiftedArg2, arg2, begins, counter); + + typename Kokkos::Experimental::Impl::GetOffsetViewTypeFromViewType<typename Kokkos::Impl::ViewMapping< + void /* deduce subview type from source view traits */ + , ViewTraits< D , P... > , T0, T1, T2 >::type >::type offsetView(theSubview, subviewBegins); + + return offsetView; + } + + template< class D, class ... P , class T0, class T1, class T2, class T3 > + KOKKOS_INLINE_FUNCTION + typename Kokkos::Experimental::Impl::GetOffsetViewTypeFromViewType<typename Kokkos::Impl::ViewMapping + < void /* deduce subview type from source view traits */ + , ViewTraits< D , P... > + , T0, T1, T2, T3 + >::type >::type + subview_offset(const OffsetView< D, P... > & src, T0 arg0, T1 arg1, T2 arg2, T3 arg3) { + + auto theView = src.view(); + auto begins = src.begins(); + + T0 shiftedArg0 = shift_input(arg0, begins[0]); + T1 shiftedArg1 = shift_input(arg1, begins[1]); + T2 shiftedArg2 = shift_input(arg2, begins[2]); + T3 shiftedArg3 = shift_input(arg3, begins[3]); + + auto theSubview = Kokkos::subview( theView , shiftedArg0, shiftedArg1, shiftedArg2, shiftedArg3); + + constexpr size_t rank = Kokkos::Impl::ViewMapping + < void /* deduce subview type from source view traits */ + , ViewTraits< D , P... > + , T0, T1, T2, T3>::type::Rank; + Kokkos::Array<int64_t, rank> subviewBegins; + + size_t counter = 0; + Kokkos::Experimental::Impl::map_arg_to_new_begin(0, subviewBegins, shiftedArg0, arg0, begins, counter); + Kokkos::Experimental::Impl::map_arg_to_new_begin(1, subviewBegins, shiftedArg1, arg1, begins, counter); + Kokkos::Experimental::Impl::map_arg_to_new_begin(2, subviewBegins, shiftedArg2, arg2, begins, counter); + Kokkos::Experimental::Impl::map_arg_to_new_begin(3, subviewBegins, shiftedArg3, arg3, begins, counter); + + typename Kokkos::Experimental::Impl::GetOffsetViewTypeFromViewType<typename Kokkos::Impl::ViewMapping< + void /* deduce subview type from source view traits */ + , ViewTraits< D , P... > , T0, T1, T2, T3 >::type >::type offsetView(theSubview, subviewBegins); + + return offsetView; + } + + template< class D, class ... P , class T0, class T1, class T2, class T3, class T4 > + KOKKOS_INLINE_FUNCTION + typename Kokkos::Experimental::Impl::GetOffsetViewTypeFromViewType<typename Kokkos::Impl::ViewMapping + < void /* deduce subview type from source view traits */ + , ViewTraits< D , P... > + , T0, T1, T2, T3, T4 + >::type >::type + subview_offset(const OffsetView< D, P... > & src, T0 arg0, T1 arg1, T2 arg2, T3 arg3, T4 arg4) { + + auto theView = src.view(); + auto begins = src.begins(); + + T0 shiftedArg0 = shift_input(arg0, begins[0]); + T1 shiftedArg1 = shift_input(arg1, begins[1]); + T2 shiftedArg2 = shift_input(arg2, begins[2]); + T3 shiftedArg3 = shift_input(arg3, begins[3]); + T4 shiftedArg4 = shift_input(arg4, begins[4]); + + auto theSubview = Kokkos::subview( theView , shiftedArg0, shiftedArg1, shiftedArg2, shiftedArg3, shiftedArg4); + + constexpr size_t rank = Kokkos::Impl::ViewMapping + < void /* deduce subview type from source view traits */ + , ViewTraits< D , P... > + , T0, T1, T2, T3, T4>::type::Rank; + Kokkos::Array<int64_t, rank> subviewBegins; + + size_t counter = 0; + Kokkos::Experimental::Impl::map_arg_to_new_begin(0, subviewBegins, shiftedArg0, arg0, begins, counter); + Kokkos::Experimental::Impl::map_arg_to_new_begin(1, subviewBegins, shiftedArg1, arg1, begins, counter); + Kokkos::Experimental::Impl::map_arg_to_new_begin(2, subviewBegins, shiftedArg2, arg2, begins, counter); + Kokkos::Experimental::Impl::map_arg_to_new_begin(3, subviewBegins, shiftedArg3, arg3, begins, counter); + Kokkos::Experimental::Impl::map_arg_to_new_begin(4, subviewBegins, shiftedArg4, arg4, begins, counter); + + typename Kokkos::Experimental::Impl::GetOffsetViewTypeFromViewType<typename Kokkos::Impl::ViewMapping< + void /* deduce subview type from source view traits */ + , ViewTraits< D , P... > , T0, T1, T2, T3, T4 >::type >::type offsetView(theSubview, subviewBegins); + + return offsetView; + } + + template< class D, class ... P , class T0, class T1, class T2, class T3, class T4, + class T5 > + KOKKOS_INLINE_FUNCTION + typename Kokkos::Experimental::Impl::GetOffsetViewTypeFromViewType<typename Kokkos::Impl::ViewMapping + < void /* deduce subview type from source view traits */ + , ViewTraits< D , P... > + , T0, T1, T2, T3, T4, T5 + >::type >::type + subview_offset(const OffsetView< D, P... > & src, T0 arg0, T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5) { + + auto theView = src.view(); + auto begins = src.begins(); + + T0 shiftedArg0 = shift_input(arg0, begins[0]); + T1 shiftedArg1 = shift_input(arg1, begins[1]); + T2 shiftedArg2 = shift_input(arg2, begins[2]); + T3 shiftedArg3 = shift_input(arg3, begins[3]); + T4 shiftedArg4 = shift_input(arg4, begins[4]); + T5 shiftedArg5 = shift_input(arg5, begins[5]); + + auto theSubview = Kokkos::subview( theView , shiftedArg0, shiftedArg1, shiftedArg2, shiftedArg3, shiftedArg4, shiftedArg5); + + constexpr size_t rank = Kokkos::Impl::ViewMapping + < void /* deduce subview type from source view traits */ + , ViewTraits< D , P... > + , T0, T1, T2, T3, T4, T5>::type::Rank; + + Kokkos::Array<int64_t, rank> subviewBegins; + + size_t counter = 0; + Kokkos::Experimental::Impl::map_arg_to_new_begin(0, subviewBegins, shiftedArg0, arg0, begins, counter); + Kokkos::Experimental::Impl::map_arg_to_new_begin(1, subviewBegins, shiftedArg1, arg1, begins, counter); + Kokkos::Experimental::Impl::map_arg_to_new_begin(2, subviewBegins, shiftedArg2, arg2, begins, counter); + Kokkos::Experimental::Impl::map_arg_to_new_begin(3, subviewBegins, shiftedArg3, arg3, begins, counter); + Kokkos::Experimental::Impl::map_arg_to_new_begin(4, subviewBegins, shiftedArg4, arg4, begins, counter); + Kokkos::Experimental::Impl::map_arg_to_new_begin(5, subviewBegins, shiftedArg5, arg5, begins, counter); + + typename Kokkos::Experimental::Impl::GetOffsetViewTypeFromViewType<typename Kokkos::Impl::ViewMapping< + void /* deduce subview type from source view traits */ + , ViewTraits< D , P... > , T0, T1, T2, T3, T4, T5 >::type >::type offsetView(theSubview, subviewBegins); + + return offsetView; + } + template< class D, class ... P , class T0, class T1, class T2, class T3, class T4, + class T5, class T6> + KOKKOS_INLINE_FUNCTION + typename Kokkos::Experimental::Impl::GetOffsetViewTypeFromViewType<typename Kokkos::Impl::ViewMapping + < void /* deduce subview type from source view traits */ + , ViewTraits< D , P... > + , T0, T1, T2, T3, T4, T5, T6 + >::type >::type + subview_offset(const OffsetView< D, P... > & src, T0 arg0, T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5, + T6 arg6) { + + auto theView = src.view(); + auto begins = src.begins(); + + T0 shiftedArg0 = shift_input(arg0, begins[0]); + T1 shiftedArg1 = shift_input(arg1, begins[1]); + T2 shiftedArg2 = shift_input(arg2, begins[2]); + T3 shiftedArg3 = shift_input(arg3, begins[3]); + T4 shiftedArg4 = shift_input(arg4, begins[4]); + T5 shiftedArg5 = shift_input(arg5, begins[5]); + T6 shiftedArg6 = shift_input(arg6, begins[6]); + + auto theSubview = Kokkos::subview( theView , shiftedArg0, shiftedArg1, shiftedArg2, shiftedArg3, shiftedArg4, shiftedArg5, + shiftedArg6); + + constexpr size_t rank = Kokkos::Impl::ViewMapping + < void /* deduce subview type from source view traits */ + , ViewTraits< D , P... > + , T0, T1, T2, T3, T4, T5, T6>::type::Rank; + + Kokkos::Array<int64_t, rank> subviewBegins; + + size_t counter = 0; + Kokkos::Experimental::Impl::map_arg_to_new_begin(0, subviewBegins, shiftedArg0, arg0, begins, counter); + Kokkos::Experimental::Impl::map_arg_to_new_begin(1, subviewBegins, shiftedArg1, arg1, begins, counter); + Kokkos::Experimental::Impl::map_arg_to_new_begin(2, subviewBegins, shiftedArg2, arg2, begins, counter); + Kokkos::Experimental::Impl::map_arg_to_new_begin(3, subviewBegins, shiftedArg3, arg3, begins, counter); + Kokkos::Experimental::Impl::map_arg_to_new_begin(4, subviewBegins, shiftedArg4, arg4, begins, counter); + Kokkos::Experimental::Impl::map_arg_to_new_begin(5, subviewBegins, shiftedArg5, arg5, begins, counter); + Kokkos::Experimental::Impl::map_arg_to_new_begin(6, subviewBegins, shiftedArg6, arg6, begins, counter); + + typename Kokkos::Experimental::Impl::GetOffsetViewTypeFromViewType<typename Kokkos::Impl::ViewMapping< + void /* deduce subview type from source view traits */ + , ViewTraits< D , P... > , T0, T1, T2, T3, T4, T5, + T6 >::type >::type offsetView(theSubview, subviewBegins); + + return offsetView; + } + + template< class D, class ... P , class T0, class T1, class T2, class T3, class T4, + class T5, class T6, class T7> + KOKKOS_INLINE_FUNCTION + typename Kokkos::Experimental::Impl::GetOffsetViewTypeFromViewType<typename Kokkos::Impl::ViewMapping + < void /* deduce subview type from source view traits */ + , ViewTraits< D , P... > + , T0, T1, T2, T3, T4, T5, T6, T7 + >::type >::type + subview_offset(const OffsetView< D, P... > & src, T0 arg0, T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5, + T6 arg6, T7 arg7) { + + auto theView = src.view(); + auto begins = src.begins(); + + T0 shiftedArg0 = shift_input(arg0, begins[0]); + T1 shiftedArg1 = shift_input(arg1, begins[1]); + T2 shiftedArg2 = shift_input(arg2, begins[2]); + T3 shiftedArg3 = shift_input(arg3, begins[3]); + T4 shiftedArg4 = shift_input(arg4, begins[4]); + T5 shiftedArg5 = shift_input(arg5, begins[5]); + T6 shiftedArg6 = shift_input(arg6, begins[6]); + T7 shiftedArg7 = shift_input(arg7, begins[7]); + + auto theSubview = Kokkos::subview( theView , shiftedArg0, shiftedArg1, shiftedArg2, shiftedArg3, shiftedArg4, shiftedArg5, + shiftedArg6, shiftedArg7); + + constexpr size_t rank = Kokkos::Impl::ViewMapping + < void /* deduce subview type from source view traits */ + , ViewTraits< D , P... > + , T0, T1, T2, T3, T4, T5, T6, T7>::type::Rank; + + Kokkos::Array<int64_t, rank> subviewBegins; + + size_t counter = 0; + Kokkos::Experimental::Impl::map_arg_to_new_begin(0, subviewBegins, shiftedArg0, arg0, begins, counter); + Kokkos::Experimental::Impl::map_arg_to_new_begin(1, subviewBegins, shiftedArg1, arg1, begins, counter); + Kokkos::Experimental::Impl::map_arg_to_new_begin(2, subviewBegins, shiftedArg2, arg2, begins, counter); + Kokkos::Experimental::Impl::map_arg_to_new_begin(3, subviewBegins, shiftedArg3, arg3, begins, counter); + Kokkos::Experimental::Impl::map_arg_to_new_begin(4, subviewBegins, shiftedArg4, arg4, begins, counter); + Kokkos::Experimental::Impl::map_arg_to_new_begin(5, subviewBegins, shiftedArg5, arg5, begins, counter); + Kokkos::Experimental::Impl::map_arg_to_new_begin(6, subviewBegins, shiftedArg6, arg6, begins, counter); + Kokkos::Experimental::Impl::map_arg_to_new_begin(7, subviewBegins, shiftedArg7, arg7, begins, counter); + + typename Kokkos::Experimental::Impl::GetOffsetViewTypeFromViewType<typename Kokkos::Impl::ViewMapping< + void /* deduce subview type from source view traits */ + , ViewTraits< D , P... > , T0, T1, T2, T3, T4, T5, + T6, T7 >::type >::type offsetView(theSubview, subviewBegins); + + return offsetView; + } + } + + template< class D, class ... P , class ... Args > + KOKKOS_INLINE_FUNCTION + typename Kokkos::Experimental::Impl::GetOffsetViewTypeFromViewType<typename Kokkos::Impl::ViewMapping + < void /* deduce subview type from source view traits */ + , ViewTraits< D , P... > + , Args ... + >::type >::type + subview( const OffsetView< D, P... > & src , Args ... args ) + { + static_assert( OffsetView< D , P... >::Rank == sizeof...(Args) , + "subview requires one argument for each source OffsetView rank" ); + + + return Kokkos::Experimental::Impl::subview_offset(src, args...); + + + } + + } +} +//---------------------------------------------------------------------------- +//---------------------------------------------------------------------------- + +namespace Kokkos { + namespace Experimental { + template< class LT , class ... LP , class RT , class ... RP > + KOKKOS_INLINE_FUNCTION + bool operator == ( const OffsetView<LT,LP...> & lhs , + const OffsetView<RT,RP...> & rhs ) + { + // Same data, layout, dimensions + typedef ViewTraits<LT,LP...> lhs_traits ; + typedef ViewTraits<RT,RP...> rhs_traits ; + + return + std::is_same< typename lhs_traits::const_value_type , + typename rhs_traits::const_value_type >::value && + std::is_same< typename lhs_traits::array_layout , + typename rhs_traits::array_layout >::value && + std::is_same< typename lhs_traits::memory_space , + typename rhs_traits::memory_space >::value && + unsigned(lhs_traits::rank) == unsigned(rhs_traits::rank) && + lhs.data() == rhs.data() && + lhs.span() == rhs.span() && + lhs.extent(0) == rhs.extent(0) && + lhs.extent(1) == rhs.extent(1) && + lhs.extent(2) == rhs.extent(2) && + lhs.extent(3) == rhs.extent(3) && + lhs.extent(4) == rhs.extent(4) && + lhs.extent(5) == rhs.extent(5) && + lhs.extent(6) == rhs.extent(6) && + lhs.extent(7) == rhs.extent(7) && + lhs.begin(0) == rhs.begin(0) && + lhs.begin(1) == rhs.begin(1) && + lhs.begin(2) == rhs.begin(2) && + lhs.begin(3) == rhs.begin(3) && + lhs.begin(4) == rhs.begin(4) && + lhs.begin(5) == rhs.begin(5) && + lhs.begin(6) == rhs.begin(6) && + lhs.begin(7) == rhs.begin(7) + ; + } + + template< class LT , class ... LP , class RT , class ... RP > + KOKKOS_INLINE_FUNCTION + bool operator != ( const OffsetView<LT,LP...> & lhs , + const OffsetView<RT,RP...> & rhs ) + { + return ! ( operator==(lhs,rhs) ); + } + + template< class LT , class ... LP , class RT , class ... RP > + KOKKOS_INLINE_FUNCTION + bool operator == ( const View<LT,LP...> & lhs , + const OffsetView<RT,RP...> & rhs ) + { + // Same data, layout, dimensions + typedef ViewTraits<LT,LP...> lhs_traits ; + typedef ViewTraits<RT,RP...> rhs_traits ; + + return + std::is_same< typename lhs_traits::const_value_type , + typename rhs_traits::const_value_type >::value && + std::is_same< typename lhs_traits::array_layout , + typename rhs_traits::array_layout >::value && + std::is_same< typename lhs_traits::memory_space , + typename rhs_traits::memory_space >::value && + unsigned(lhs_traits::rank) == unsigned(rhs_traits::rank) && + lhs.data() == rhs.data() && + lhs.span() == rhs.span() && + lhs.extent(0) == rhs.extent(0) && + lhs.extent(1) == rhs.extent(1) && + lhs.extent(2) == rhs.extent(2) && + lhs.extent(3) == rhs.extent(3) && + lhs.extent(4) == rhs.extent(4) && + lhs.extent(5) == rhs.extent(5) && + lhs.extent(6) == rhs.extent(6) && + lhs.extent(7) == rhs.extent(7) + ; + } + + template< class LT , class ... LP , class RT , class ... RP > + KOKKOS_INLINE_FUNCTION + bool operator == ( const OffsetView<LT,LP...> & lhs , + const View<RT,RP...> & rhs ) + { return rhs == lhs;} + + } +} /* namespace Kokkos */ + +//---------------------------------------------------------------------------- +//---------------------------------------------------------------------------- + + +namespace Kokkos { + namespace Experimental { + template< class DT , class ... DP > + inline + void deep_copy + ( const OffsetView<DT,DP...> & dst + , typename ViewTraits<DT,DP...>::const_value_type & value + , typename std::enable_if< + std::is_same< typename ViewTraits<DT,DP...>::specialize , void >::value + >::type * = 0 ) + { + static_assert( + std::is_same< typename ViewTraits<DT,DP...>::non_const_value_type , + typename ViewTraits<DT,DP...>::value_type >::value + , "deep_copy requires non-const type" ); + + auto dstView = dst.view(); + Kokkos::deep_copy( dstView , value ); + + } + + template< class DT , class ... DP , class ST , class ... SP > + inline + void deep_copy + ( const OffsetView<DT,DP...> & dst + , const OffsetView<ST,SP...> & value + , typename std::enable_if< + std::is_same< typename ViewTraits<DT,DP...>::specialize , void >::value + >::type * = 0 ) + { + static_assert( + std::is_same< typename ViewTraits<DT,DP...>::value_type , + typename ViewTraits<ST,SP...>::non_const_value_type >::value + , "deep_copy requires matching non-const destination type" ); + + auto dstView = dst.view(); + Kokkos::deep_copy( dstView , value.view() ); + + } + template< class DT , class ... DP , class ST , class ... SP > + inline + void deep_copy + ( const OffsetView<DT,DP...> & dst + , const View<ST,SP...> & value + , typename std::enable_if< + std::is_same< typename ViewTraits<DT,DP...>::specialize , void >::value + >::type * = 0 ) + { + static_assert( + std::is_same< typename ViewTraits<DT,DP...>::value_type , + typename ViewTraits<ST,SP...>::non_const_value_type >::value + , "deep_copy requires matching non-const destination type" ); + + auto dstView = dst.view(); + Kokkos::deep_copy( dstView , value); + + } + + template< class DT , class ... DP , class ST , class ... SP > + inline + void deep_copy + ( const View<DT,DP...> & dst + , const OffsetView<ST,SP...> & value + , typename std::enable_if< + std::is_same< typename ViewTraits<DT,DP...>::specialize , void >::value + >::type * = 0 ) + { + static_assert( + std::is_same< typename ViewTraits<DT,DP...>::value_type , + typename ViewTraits<ST,SP...>::non_const_value_type >::value + , "deep_copy requires matching non-const destination type" ); + + Kokkos::deep_copy( dst , value.view() ); + + } + namespace Impl { + + // Deduce Mirror Types + template<class Space, class T, class ... P> + struct MirrorOffsetViewType { + // The incoming view_type + typedef typename Kokkos::Experimental::OffsetView<T,P...> src_view_type; + // The memory space for the mirror view + typedef typename Space::memory_space memory_space; + // Check whether it is the same memory space + enum { is_same_memspace = std::is_same<memory_space,typename src_view_type::memory_space>::value }; + // The array_layout + typedef typename src_view_type::array_layout array_layout; + // The data type (we probably want it non-const since otherwise we can't even deep_copy to it. + typedef typename src_view_type::non_const_data_type data_type; + // The destination view type if it is not the same memory space + typedef Kokkos::Experimental::OffsetView<data_type,array_layout,Space> dest_view_type; + // If it is the same memory_space return the existsing view_type + // This will also keep the unmanaged trait if necessary + typedef typename std::conditional<is_same_memspace,src_view_type,dest_view_type>::type view_type; + }; + + template<class Space, class T, class ... P> + struct MirrorOffsetType { + // The incoming view_type + typedef typename Kokkos::Experimental::OffsetView<T,P...> src_view_type; + // The memory space for the mirror view + typedef typename Space::memory_space memory_space; + // Check whether it is the same memory space + enum { is_same_memspace = std::is_same<memory_space,typename src_view_type::memory_space>::value }; + // The array_layout + typedef typename src_view_type::array_layout array_layout; + // The data type (we probably want it non-const since otherwise we can't even deep_copy to it. + typedef typename src_view_type::non_const_data_type data_type; + // The destination view type if it is not the same memory space + typedef Kokkos::Experimental::OffsetView<data_type,array_layout,Space> view_type; + }; + + } + + template< class T , class ... P > + inline + typename Kokkos::Experimental::OffsetView<T,P...>::HostMirror + create_mirror( const Kokkos::Experimental::OffsetView<T,P...> & src + , typename std::enable_if< + ! std::is_same< typename Kokkos::ViewTraits<T,P...>::array_layout + , Kokkos::LayoutStride >::value + >::type * = 0 + ) + { + typedef OffsetView<T,P...> src_type ; + typedef typename src_type::HostMirror dst_type ; + + return dst_type( Kokkos::Impl::ViewCtorProp< std::string >(std::string( src.label() ).append("_mirror") ), + typename Kokkos::ViewTraits<T,P...>::array_layout + ( src.extent(0), src.extent(1), src.extent(2), src.extent(3), src.extent(4), + src.extent(5), src.extent(6), src.extent(7) ), + { src.begin(0), src.begin(1), src.begin(2), src.begin(3), src.begin(4), + src.begin(5), src.begin(6), src.begin(7) }); + } + + template< class T , class ... P > + inline + typename Kokkos::Experimental::OffsetView<T,P...>::HostMirror + create_mirror( const Kokkos::Experimental::OffsetView<T,P...> & src + , typename std::enable_if< + std::is_same< typename Kokkos::ViewTraits<T,P...>::array_layout + , Kokkos::LayoutStride >::value + >::type * = 0 + ) + { + typedef OffsetView<T,P...> src_type ; + typedef typename src_type::HostMirror dst_type ; + + 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(); + + return dst_type( std::string( src.label() ).append("_mirror") , layout, + { src.begin(0), src.begin(1), src.begin(2), src.begin(3), src.begin(4), + src.begin(5), src.begin(6), src.begin(7) } ); + } + + + // Create a mirror in a new space (specialization for different space) + template<class Space, class T, class ... P> + typename Kokkos::Experimental::Impl::MirrorOffsetType<Space,T,P ...>::view_type + create_mirror(const Space& , const Kokkos::Experimental::OffsetView<T,P...> & src) { + return typename Kokkos::Experimental::Impl::MirrorOffsetType<Space,T,P ...>::view_type(src.label(),src.layout(), + { src.begin(0), src.begin(1), src.begin(2), src.begin(3), src.begin(4), + src.begin(5), src.begin(6), src.begin(7) } ); + } + + + template< class T , class ... P > + inline + typename Kokkos::Experimental::OffsetView< T, P... >::HostMirror + create_mirror_view( const typename Kokkos::Experimental::OffsetView< T,P... > & src + , typename std::enable_if<( + std::is_same< typename Kokkos::Experimental::OffsetView<T,P...>::memory_space + , typename Kokkos::Experimental::OffsetView<T,P...>::HostMirror::memory_space + >::value + && + std::is_same< typename Kokkos::Experimental::OffsetView<T,P...>::data_type + , typename Kokkos::Experimental::OffsetView<T,P...>::HostMirror::data_type + >::value + )>::type * = 0 + ) + { + return src ; + } + + template< class T , class ... P > + inline + typename Kokkos::Experimental::OffsetView<T,P...>::HostMirror + create_mirror_view( const Kokkos::Experimental::OffsetView<T,P...> & src + , typename std::enable_if< ! ( + std::is_same< typename Kokkos::Experimental::OffsetView<T,P...>::memory_space + , typename Kokkos::Experimental::OffsetView<T,P...>::HostMirror::memory_space + >::value + && + std::is_same< typename Kokkos::Experimental::OffsetView<T,P...>::data_type + , typename Kokkos::Experimental::OffsetView<T,P...>::HostMirror::data_type + >::value + )>::type * = 0 + ) + { + return Kokkos::Experimental::create_mirror( src ); + } + + // Create a mirror view in a new space (specialization for same space) + template<class Space, class T, class ... P> + typename Kokkos::Experimental::Impl::MirrorOffsetViewType<Space,T,P ...>::view_type + create_mirror_view(const Space& , const Kokkos::Experimental::OffsetView<T,P...> & src + , typename std::enable_if<Impl::MirrorOffsetViewType<Space,T,P ...>::is_same_memspace>::type* = 0 ) { + return src; + } + + // Create a mirror view in a new space (specialization for different space) + template<class Space, class T, class ... P> + typename Kokkos::Experimental::Impl::MirrorOffsetViewType<Space,T,P ...>::view_type + create_mirror_view(const Space& , const Kokkos::Experimental::OffsetView<T,P...> & src + , typename std::enable_if<!Impl::MirrorOffsetViewType<Space,T,P ...>::is_same_memspace>::type* = 0 ) { + return typename Kokkos::Experimental::Impl::MirrorOffsetViewType<Space,T,P ...>::view_type(src.label(),src.layout(), + { src.begin(0), src.begin(1), src.begin(2), src.begin(3), src.begin(4), + src.begin(5), src.begin(6), src.begin(7) } ); + } + // + // // Create a mirror view and deep_copy in a new space (specialization for same space) + // template<class Space, class T, class ... P> + // typename Kokkos::Experimental::Impl::MirrorViewType<Space,T,P ...>::view_type + // create_mirror_view_and_copy(const Space& , const Kokkos::Experimental::OffsetView<T,P...> & src + // , std::string const& name = "" + // , typename std::enable_if<Impl::MirrorViewType<Space,T,P ...>::is_same_memspace>::type* = 0 ) { + // (void)name; + // return src; + // } + // + // // Create a mirror view and deep_copy in a new space (specialization for different space) + // template<class Space, class T, class ... P> + // typename Kokkos::Experimental::Impl::MirrorViewType<Space,T,P ...>::view_type + // create_mirror_view_and_copy(const Space& , const Kokkos::Experimental::OffsetView<T,P...> & src + // , std::string const& name = "" + // , typename std::enable_if<!Impl::MirrorViewType<Space,T,P ...>::is_same_memspace>::type* = 0 ) { + // using Mirror = typename Kokkos::Experimental::Impl::MirrorViewType<Space,T,P ...>::view_type; + // std::string label = name.empty() ? src.label() : name; + // auto mirror = Mirror(ViewAllocateWithoutInitializing(label), src.layout(), + // { src.begin(0), src.begin(1), src.begin(2), src.begin(3), src.begin(4), + // src.begin(5), src.begin(6), src.begin(7) }); + // deep_copy(mirror, src); + // return mirror; + // } + + } +} /* namespace Kokkos */ + + +//---------------------------------------------------------------------------- +//---------------------------------------------------------------------------- + + +#endif /* KOKKOS_OFFSETVIEW_HPP_ */ diff --git a/packages/kokkos/containers/src/Kokkos_StaticCrsGraph.hpp b/packages/kokkos/containers/src/Kokkos_StaticCrsGraph.hpp index c522d85c5b4847de2a327eae9e665bb3fa79d29e..f63ce4b880268fb7e0ebdfa073b16485118bb337 100644 --- a/packages/kokkos/containers/src/Kokkos_StaticCrsGraph.hpp +++ b/packages/kokkos/containers/src/Kokkos_StaticCrsGraph.hpp @@ -47,7 +47,9 @@ #include <string> #include <vector> -#include <Kokkos_Core.hpp> +#include <Kokkos_View.hpp> +#include <Kokkos_Parallel.hpp> +#include <Kokkos_Parallel_Reduce.hpp> namespace Kokkos { diff --git a/packages/kokkos/containers/src/Kokkos_Vector.hpp b/packages/kokkos/containers/src/Kokkos_Vector.hpp index 8204ba776e7f1c7b18e78e545e1724924c843427..76c515941e8d0a04bb2491bceec5caf14de56ec3 100644 --- a/packages/kokkos/containers/src/Kokkos_Vector.hpp +++ b/packages/kokkos/containers/src/Kokkos_Vector.hpp @@ -86,14 +86,13 @@ public: vector():DV() { _size = 0; _extra_storage = 1.1; - DV::modified_host() = 1; } vector(int n, Scalar val=Scalar()):DualView<Scalar*,LayoutLeft,Arg1Type>("Vector",size_t(n*(1.1))) { _size = n; _extra_storage = 1.1; - DV::modified_host() = 1; + DV::modified_flags(0) = 1; assign(n,val); } @@ -119,16 +118,16 @@ public: /* Assign value either on host or on device */ - if( DV::modified_host() >= DV::modified_device() ) { + if( DV::template need_sync<typename DV::t_dev::device_type>() ) { set_functor_host f(DV::h_view,val); parallel_for(n,f); DV::t_host::execution_space::fence(); - DV::modified_host()++; + DV::template modify<typename DV::t_host::device_type>(); } else { set_functor f(DV::d_view,val); parallel_for(n,f); DV::t_dev::execution_space::fence(); - DV::modified_device()++; + DV::template modify<typename DV::t_dev::device_type>(); } } @@ -137,7 +136,8 @@ public: } void push_back(Scalar val) { - DV::modified_host()++; + DV::template sync<typename DV::t_host::device_type>(); + DV::template modify<typename DV::t_host::device_type>(); if(_size == span()) { size_t new_size = _size*_extra_storage; if(new_size == _size) new_size++; @@ -247,10 +247,10 @@ public: } void on_host() { - DV::modified_host() = DV::modified_device() + 1; + DV::template modify<typename DV::t_host::device_type>(); } void on_device() { - DV::modified_device() = DV::modified_host() + 1; + DV::template modify<typename DV::t_dev::device_type>(); } void set_overallocation(float extra) { diff --git a/packages/kokkos/containers/unit_tests/CMakeLists.txt b/packages/kokkos/containers/unit_tests/CMakeLists.txt index 3dbe79183ad84c27cf4487347c5e82d2816dd052..0f94afec8c2aba5cee8a69bd8fcd0b7d661fd6ef 100644 --- a/packages/kokkos/containers/unit_tests/CMakeLists.txt +++ b/packages/kokkos/containers/unit_tests/CMakeLists.txt @@ -23,6 +23,7 @@ TRIBITS_ADD_EXECUTABLE_AND_TEST( threads/TestThreads_DynRankViewAPI_rank12345.cpp threads/TestThreads_DynRankViewAPI_rank67.cpp threads/TestThreads_ErrorReporter.cpp + threads/TestThreads_OffsetView.cpp threads/TestThreads_ScatterView.cpp threads/TestThreads_StaticCrsGraph.cpp threads/TestThreads_UnorderedMap.cpp @@ -47,6 +48,7 @@ TRIBITS_ADD_EXECUTABLE_AND_TEST( serial/TestSerial_DynRankViewAPI_rank12345.cpp serial/TestSerial_DynRankViewAPI_rank67.cpp serial/TestSerial_ErrorReporter.cpp + serial/TestSerial_OffsetView.cpp serial/TestSerial_ScatterView.cpp serial/TestSerial_StaticCrsGraph.cpp serial/TestSerial_UnorderedMap.cpp @@ -71,6 +73,7 @@ TRIBITS_ADD_EXECUTABLE_AND_TEST( openmp/TestOpenMP_DynRankViewAPI_rank12345.cpp openmp/TestOpenMP_DynRankViewAPI_rank67.cpp openmp/TestOpenMP_ErrorReporter.cpp + openmp/TestOpenMP_OffsetView.cpp openmp/TestOpenMP_ScatterView.cpp openmp/TestOpenMP_StaticCrsGraph.cpp openmp/TestOpenMP_UnorderedMap.cpp @@ -95,6 +98,7 @@ TRIBITS_ADD_EXECUTABLE_AND_TEST( cuda/TestCuda_DynRankViewAPI_rank12345.cpp cuda/TestCuda_DynRankViewAPI_rank67.cpp cuda/TestCuda_ErrorReporter.cpp + cuda/TestCuda_OffsetView.cpp cuda/TestCuda_ScatterView.cpp cuda/TestCuda_StaticCrsGraph.cpp cuda/TestCuda_UnorderedMap.cpp diff --git a/packages/kokkos/containers/unit_tests/Makefile b/packages/kokkos/containers/unit_tests/Makefile index 52d5d61aa9a5836de28535226479baafeab35786..c0e5d2820cf8a23a42759c522db5f2d70a6aa2a7 100644 --- a/packages/kokkos/containers/unit_tests/Makefile +++ b/packages/kokkos/containers/unit_tests/Makefile @@ -39,6 +39,7 @@ ifeq ($(KOKKOS_INTERNAL_USE_CUDA), 1) OBJ_CUDA += TestCuda_DynRankViewAPI_rank12345.o OBJ_CUDA += TestCuda_DynRankViewAPI_rank67.o OBJ_CUDA += TestCuda_ErrorReporter.o + OBJ_CUDA += TestCuda_OffsetView.o OBJ_CUDA += TestCuda_ScatterView.o OBJ_CUDA += TestCuda_StaticCrsGraph.o OBJ_CUDA += TestCuda_UnorderedMap.o @@ -57,6 +58,7 @@ ifeq ($(KOKKOS_INTERNAL_USE_ROCM), 1) OBJ_ROCM += TestROCm_DynRankViewAPI_rank12345.o OBJ_ROCM += TestROCm_DynRankViewAPI_rank67.o OBJ_ROCM += TestROCm_ErrorReporter.o + OBJ_ROCM += TestROCm_OffsetView.o OBJ_ROCM += TestROCm_ScatterView.o OBJ_ROCM += TestROCm_StaticCrsGraph.o OBJ_ROCM += TestROCm_UnorderedMap.o @@ -75,6 +77,7 @@ ifeq ($(KOKKOS_INTERNAL_USE_PTHREADS), 1) OBJ_THREADS += TestThreads_DynRankViewAPI_rank12345.o OBJ_THREADS += TestThreads_DynRankViewAPI_rank67.o OBJ_THREADS += TestThreads_ErrorReporter.o + OBJ_THREADS += TestThreads_OffsetView.o OBJ_THREADS += TestThreads_ScatterView.o OBJ_THREADS += TestThreads_StaticCrsGraph.o OBJ_THREADS += TestThreads_UnorderedMap.o @@ -93,6 +96,7 @@ ifeq ($(KOKKOS_INTERNAL_USE_OPENMP), 1) OBJ_OPENMP += TestOpenMP_DynRankViewAPI_rank12345.o OBJ_OPENMP += TestOpenMP_DynRankViewAPI_rank67.o OBJ_OPENMP += TestOpenMP_ErrorReporter.o + OBJ_OPENMP += TestOpenMP_OffsetView.o OBJ_OPENMP += TestOpenMP_ScatterView.o OBJ_OPENMP += TestOpenMP_StaticCrsGraph.o OBJ_OPENMP += TestOpenMP_UnorderedMap.o @@ -111,6 +115,7 @@ ifeq ($(KOKKOS_INTERNAL_USE_SERIAL), 1) OBJ_SERIAL += TestSerial_DynRankViewAPI_rank12345.o OBJ_SERIAL += TestSerial_DynRankViewAPI_rank67.o OBJ_SERIAL += TestSerial_ErrorReporter.o + OBJ_SERIAL += TestSerial_OffsetView.o OBJ_SERIAL += TestSerial_ScatterView.o OBJ_SERIAL += TestSerial_StaticCrsGraph.o OBJ_SERIAL += TestSerial_UnorderedMap.o diff --git a/packages/kokkos/containers/unit_tests/TestDynViewAPI.hpp b/packages/kokkos/containers/unit_tests/TestDynViewAPI.hpp index 8c073710e29c2ca18c5786714c78196d1c7ed253..6684a55452934a0d460279f34513bd1b20211ed5 100644 --- a/packages/kokkos/containers/unit_tests/TestDynViewAPI.hpp +++ b/packages/kokkos/containers/unit_tests/TestDynViewAPI.hpp @@ -729,6 +729,7 @@ public: static void run_tests() { run_test_resize_realloc(); run_test_mirror(); + run_test_mirror_and_copy(); run_test_scalar(); run_test(); run_test_const(); @@ -885,6 +886,69 @@ public: } } + static void run_test_mirror_and_copy() + { + // LayoutLeft + { + Kokkos::DynRankView< double, Kokkos::LayoutLeft, Kokkos::HostSpace > a_org( "A", 10 ); + a_org(5) = 42.0; + Kokkos::DynRankView< double, Kokkos::LayoutLeft, Kokkos::HostSpace > a_h = a_org; + auto a_h2 = Kokkos::create_mirror_view_and_copy( Kokkos::HostSpace(), a_h ); + auto a_d = Kokkos::create_mirror_view_and_copy( DeviceType(), a_h ); + auto a_h3 = Kokkos::create_mirror_view_and_copy( Kokkos::HostSpace(), a_d ); + + int equal_ptr_h_h2 = a_h.data() == a_h2.data() ? 1 : 0; + int equal_ptr_h_d = a_h.data() == a_d.data() ? 1 : 0; + int equal_ptr_h2_d = a_h2.data() == a_d.data() ? 1 : 0; + int equal_ptr_h3_d = a_h3.data() == a_d.data() ? 1 : 0; + + int is_same_memspace = std::is_same< Kokkos::HostSpace, typename DeviceType::memory_space >::value ? 1 : 0; + ASSERT_EQ( equal_ptr_h_h2, 1 ); + ASSERT_EQ( equal_ptr_h_d, is_same_memspace ); + ASSERT_EQ( equal_ptr_h2_d, is_same_memspace ); + ASSERT_EQ( equal_ptr_h3_d, is_same_memspace ); + + ASSERT_EQ( a_h.extent(0), a_h3.extent(0) ); + ASSERT_EQ( a_h.extent(0), a_h2.extent(0) ); + ASSERT_EQ( a_h.extent(0), a_d .extent(0) ); + ASSERT_EQ( a_h.extent(0), a_h3.extent(0) ); + ASSERT_EQ( a_h.rank(), a_org.rank() ); + ASSERT_EQ( a_h.rank(), a_h2.rank() ); + ASSERT_EQ( a_h.rank(), a_h3.rank() ); + ASSERT_EQ( a_h.rank(), a_d.rank() ); + ASSERT_EQ( a_org(5), a_h3(5) ); + } + // LayoutRight + { + Kokkos::DynRankView< double, Kokkos::LayoutRight, Kokkos::HostSpace > a_org( "A", 10 ); + a_org(5) = 42.0; + Kokkos::DynRankView< double, Kokkos::LayoutRight, Kokkos::HostSpace > a_h = a_org; + auto a_h2 = Kokkos::create_mirror_view_and_copy( Kokkos::HostSpace(), a_h ); + auto a_d = Kokkos::create_mirror_view_and_copy( DeviceType(), a_h ); + auto a_h3 = Kokkos::create_mirror_view_and_copy( Kokkos::HostSpace(), a_d ); + + int equal_ptr_h_h2 = a_h.data() == a_h2.data() ? 1 : 0; + int equal_ptr_h_d = a_h.data() == a_d.data() ? 1 : 0; + int equal_ptr_h2_d = a_h2.data() == a_d.data() ? 1 : 0; + int equal_ptr_h3_d = a_h3.data() == a_d.data() ? 1 : 0; + + int is_same_memspace = std::is_same< Kokkos::HostSpace, typename DeviceType::memory_space >::value ? 1 : 0; + ASSERT_EQ( equal_ptr_h_h2, 1 ); + ASSERT_EQ( equal_ptr_h_d, is_same_memspace ); + ASSERT_EQ( equal_ptr_h2_d, is_same_memspace ); + ASSERT_EQ( equal_ptr_h3_d, is_same_memspace ); + + ASSERT_EQ( a_h.extent(0), a_h3.extent(0) ); + ASSERT_EQ( a_h.extent(0), a_h2.extent(0) ); + ASSERT_EQ( a_h.extent(0), a_d .extent(0) ); + ASSERT_EQ( a_h.rank(), a_org.rank() ); + ASSERT_EQ( a_h.rank(), a_h2.rank() ); + ASSERT_EQ( a_h.rank(), a_h3.rank() ); + ASSERT_EQ( a_h.rank(), a_d.rank() ); + ASSERT_EQ( a_org(5), a_h3(5) ); + } + } + static void run_test_scalar() { typedef typename dView0::HostMirror hView0 ; //HostMirror of DynRankView is a DynRankView diff --git a/packages/kokkos/containers/unit_tests/TestOffsetView.hpp b/packages/kokkos/containers/unit_tests/TestOffsetView.hpp new file mode 100644 index 0000000000000000000000000000000000000000..6965199d4550aeb31d958a081243631de9893d22 --- /dev/null +++ b/packages/kokkos/containers/unit_tests/TestOffsetView.hpp @@ -0,0 +1,426 @@ +//@HEADER +// ************************************************************************ +// +// Kokkos v. 2.0 +// Copyright (2014) Sandia Corporation +// +// Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, +// the U.S. Government retains certain rights in this software. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// +// 3. Neither the name of the Corporation nor the names of the +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY +// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE +// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) +// +// ************************************************************************ +//@HEADER + +/* + * FIXME the OffsetView class is really not very well tested. + */ +#ifndef CONTAINERS_UNIT_TESTS_TESTOFFSETVIEW_HPP_ +#define CONTAINERS_UNIT_TESTS_TESTOFFSETVIEW_HPP_ + + + +#include <gtest/gtest.h> +#include <iostream> +#include <cstdlib> +#include <cstdio> +#include <impl/Kokkos_Timer.hpp> +#include <Kokkos_OffsetView.hpp> +#include <KokkosExp_MDRangePolicy.hpp> + +using std::endl; +using std::cout; + +namespace Test{ + + template <typename Scalar, typename Device> + void test_offsetview_construction(unsigned int size) + { + + typedef Kokkos::Experimental::OffsetView<Scalar**, Device> offset_view_type; + typedef Kokkos::View<Scalar**, Device> view_type; + + Kokkos::Experimental::index_list_type range0 = {-1, 3}; + Kokkos::Experimental::index_list_type range1 = {-2, 2}; + + offset_view_type ov("firstOV", range0, range1); + + ASSERT_EQ("firstOV", ov.label()); + ASSERT_EQ(2, ov.Rank); + + ASSERT_EQ(ov.begin(0), -1); + ASSERT_EQ(ov.end(0), 4); + + ASSERT_EQ(ov.begin(1), -2); + ASSERT_EQ(ov.end(1), 3); + + ASSERT_EQ(ov.extent(0), 5); + ASSERT_EQ(ov.extent(1), 5); + + const int ovmin0 = ov.begin(0); + const int ovend0 = ov.end(0); + const int ovmin1 = ov.begin(1); + const int ovend1 = ov.end(1); + +#if defined(KOKKOS_ENABLE_CUDA_LAMBDA) || !defined(KOKKOS_ENABLE_CUDA) + { + Kokkos::Experimental::OffsetView<Scalar*, Device> offsetV1("OneDOffsetView", range0); + + Kokkos::RangePolicy<Device, int> rangePolicy1(offsetV1.begin(0), offsetV1.end(0)); + Kokkos::parallel_for(rangePolicy1, KOKKOS_LAMBDA (const int i){ + offsetV1(i) = 1; + } + ); + Kokkos::fence(); + + int OVResult = 0; + Kokkos::parallel_reduce(rangePolicy1, KOKKOS_LAMBDA(const int i, int & updateMe){ + updateMe += offsetV1(i); + }, OVResult); + + Kokkos::fence(); + ASSERT_EQ(OVResult, offsetV1.end(0) - offsetV1.begin(0)) << "found wrong number of elements in OffsetView that was summed."; + + } + { //test deep copy of scalar const value into mirro + const int constVal = 6; + typename offset_view_type::HostMirror hostOffsetView = + Kokkos::Experimental::create_mirror_view(ov); + + Kokkos::Experimental::deep_copy(hostOffsetView, constVal); + + for(int i = hostOffsetView.begin(0); i < hostOffsetView.end(0); ++i) { + for(int j = hostOffsetView.begin(1); j < hostOffsetView.end(1); ++j) { + ASSERT_EQ(hostOffsetView(i,j), constVal) << "Bad data found in OffsetView"; + } + } + } + + typedef Kokkos::MDRangePolicy<Device, Kokkos::Rank<2>, Kokkos::IndexType<int> > range_type; + typedef typename range_type::point_type point_type; + + range_type rangePolicy2D(point_type{ {ovmin0, ovmin1 } }, + point_type{ { ovend0, ovend1 } }); + + const int constValue = 9; + Kokkos::parallel_for(rangePolicy2D, KOKKOS_LAMBDA (const int i, const int j) { + ov(i,j) = constValue; + } + ); + + //test offsetview to offsetviewmirror deep copy + typename offset_view_type::HostMirror hostOffsetView = + Kokkos::Experimental::create_mirror_view(ov); + + Kokkos::Experimental::deep_copy(hostOffsetView, ov); + + for(int i = hostOffsetView.begin(0); i < hostOffsetView.end(0); ++i) { + for(int j = hostOffsetView.begin(1); j < hostOffsetView.end(1); ++j) { + ASSERT_EQ(hostOffsetView(i,j), constValue) << "Bad data found in OffsetView"; + } + } + + int OVResult = 0; + Kokkos::parallel_reduce(rangePolicy2D, KOKKOS_LAMBDA(const int i, const int j, int & updateMe){ + updateMe += ov(i, j); + }, OVResult); + + int answer = 0; + for(int i = ov.begin(0); i < ov.end(0); ++i) { + for(int j = ov.begin(1); j < ov.end(1); ++j) { + answer += constValue; + } + } + + ASSERT_EQ(OVResult, answer) << "Bad data found in OffsetView"; +#endif + + { + offset_view_type ovCopy(ov); + ASSERT_EQ(ovCopy==ov, true) << + "Copy constructor or equivalence operator broken"; + } + + { + offset_view_type ovAssigned = ov; + ASSERT_EQ(ovAssigned==ov, true) << + "Assignment operator or equivalence operator broken"; + } + + { //construct OffsetView from a View plus begins array + const int extent0 = 100; + const int extent1 = 200; + const int extent2 = 300; + Kokkos::View<Scalar***, Device> view3D("view3D", extent0, extent1, extent2); + + Kokkos::deep_copy(view3D, 1); + + Kokkos::Array<int64_t,3> begins = {{-10, -20, -30}}; + Kokkos::Experimental::OffsetView<Scalar***, Device> offsetView3D(view3D, begins); + + typedef Kokkos::MDRangePolicy<Device, Kokkos::Rank<3>, Kokkos::IndexType<int64_t> > range3_type; + typedef typename range3_type::point_type point3_type; + + range3_type rangePolicy3DZero(point3_type{ {0, 0, 0 } }, + point3_type{ { extent0, extent1, extent2 } }); + +#if defined(KOKKOS_ENABLE_CUDA_LAMBDA) || !defined(KOKKOS_ENABLE_CUDA) + int view3DSum = 0; + Kokkos::parallel_reduce(rangePolicy3DZero, KOKKOS_LAMBDA(const int i, const int j, int k, int & updateMe){ + updateMe += view3D(i, j, k); + }, view3DSum); + + range3_type rangePolicy3D(point3_type{ {begins[0], begins[1], begins[2] } }, + point3_type{ { begins[0] + extent0, begins[1] + extent1, begins[2] + extent2 } }); + int offsetView3DSum = 0; + + Kokkos::parallel_reduce(rangePolicy3D, KOKKOS_LAMBDA(const int i, const int j, int k, int & updateMe){ + updateMe += offsetView3D(i, j, k); + }, offsetView3DSum); + + ASSERT_EQ(view3DSum, offsetView3DSum) << "construction of OffsetView from View and begins array broken."; +#endif + } + view_type viewFromOV = ov.view(); + + ASSERT_EQ(viewFromOV == ov, true) << + "OffsetView::view() or equivalence operator View == OffsetView broken"; + + { + offset_view_type ovFromV(viewFromOV, {-1, -2}); + + ASSERT_EQ(ovFromV == viewFromOV , true) << + "Construction of OffsetView from View or equivalence operator OffsetView == View broken"; + } + { + offset_view_type ovFromV = viewFromOV; + ASSERT_EQ(ovFromV == viewFromOV , true) << + "Construction of OffsetView from View by assignment (implicit conversion) or equivalence operator OffsetView == View broken"; + } + + {// test offsetview to view deep copy + view_type aView("aView", ov.extent(0), ov.extent(1)); + Kokkos::Experimental::deep_copy(aView, ov); + +#if defined(KOKKOS_ENABLE_CUDA_LAMBDA) || !defined(KOKKOS_ENABLE_CUDA) + int sum = 0; + Kokkos::parallel_reduce(rangePolicy2D, KOKKOS_LAMBDA(const int i, const int j, int & updateMe){ + updateMe += ov(i, j) - aView(i- ov.begin(0), j-ov.begin(1)); + }, sum); + + ASSERT_EQ(sum, 0) << "deep_copy(view, offsetView) broken."; +#endif + } + + {// test view to offsetview deep copy + view_type aView("aView", ov.extent(0), ov.extent(1)); + + Kokkos::deep_copy(aView, 99); + Kokkos::Experimental::deep_copy(ov, aView); + + +#if defined(KOKKOS_ENABLE_CUDA_LAMBDA) || !defined(KOKKOS_ENABLE_CUDA) + int sum = 0; + Kokkos::parallel_reduce(rangePolicy2D, KOKKOS_LAMBDA(const int i, const int j, int & updateMe){ + updateMe += ov(i, j) - aView(i- ov.begin(0), j-ov.begin(1)); + }, sum); + + ASSERT_EQ(sum, 0) << "deep_copy(offsetView, view) broken."; +#endif + } + } + template <typename Scalar, typename Device> + void test_offsetview_subview(unsigned int size) + { + {//test subview 1 + Kokkos::Experimental::OffsetView<Scalar*, Device> sliceMe("offsetToSlice", {-10, 20}); + { + auto offsetSubviewa = Kokkos::Experimental::subview(sliceMe, 0); + ASSERT_EQ(offsetSubviewa.Rank, 0) << "subview of offset is broken."; + } + + } + {//test subview 2 + Kokkos::Experimental::OffsetView<Scalar**, Device> sliceMe("offsetToSlice", {-10,20}, {-20,30}); + { + auto offsetSubview = Kokkos::Experimental::subview(sliceMe, Kokkos::ALL(),-2); + ASSERT_EQ(offsetSubview.Rank, 1) << "subview of offset is broken."; + } + + { + auto offsetSubview = Kokkos::Experimental::subview(sliceMe, 0, Kokkos::ALL()); + ASSERT_EQ(offsetSubview.Rank, 1) << "subview of offset is broken."; + } + } + + + {//test subview rank 3 + + Kokkos::Experimental::OffsetView<Scalar***, Device> sliceMe("offsetToSlice", {-10,20}, {-20,30}, {-30,40}); + + //slice 1 + { + auto offsetSubview = Kokkos::Experimental::subview(sliceMe,Kokkos::ALL(),Kokkos::ALL(), 0); + ASSERT_EQ(offsetSubview.Rank, 2) << "subview of offset is broken."; + } + { + auto offsetSubview = Kokkos::Experimental::subview(sliceMe,Kokkos::ALL(), 0,Kokkos::ALL()); + ASSERT_EQ(offsetSubview.Rank, 2) << "subview of offset is broken."; + } + + { + auto offsetSubview = Kokkos::Experimental::subview(sliceMe,0, Kokkos::ALL(),Kokkos::ALL()); + ASSERT_EQ(offsetSubview.Rank, 2) << "subview of offset is broken."; + + } + { + auto offsetSubview = Kokkos::Experimental::subview(sliceMe,0, Kokkos::ALL(), Kokkos::make_pair(-30, -21)); + ASSERT_EQ(offsetSubview.Rank, 2) << "subview of offset is broken."; + + ASSERT_EQ(offsetSubview.begin(0) , -20); + ASSERT_EQ(offsetSubview.end(0) , 31); + ASSERT_EQ(offsetSubview.begin(1) , 0); + ASSERT_EQ(offsetSubview.end(1) , 9); + +#if defined(KOKKOS_ENABLE_CUDA_LAMBDA) || !defined(KOKKOS_ENABLE_CUDA) + typedef Kokkos::MDRangePolicy<Device, Kokkos::Rank<2>, Kokkos::IndexType<int> > range_type; + typedef typename range_type::point_type point_type; + + const int b0 = offsetSubview.begin(0); + const int b1 = offsetSubview.begin(1); + + const int e0 = offsetSubview.end(0); + const int e1 = offsetSubview.end(1); + + range_type rangeP2D(point_type{ {b0, b1 } }, point_type{ { e0, e1} }); + + Kokkos::parallel_for(rangeP2D, KOKKOS_LAMBDA(const int i, const int j) { + offsetSubview(i,j) = 6; + } + ); + + int sum = 0; + Kokkos::parallel_reduce(rangeP2D, KOKKOS_LAMBDA(const int i, const int j, int & updateMe){ + updateMe += offsetSubview(i, j); + }, sum); + + ASSERT_EQ(sum, 6*(e0-b0)*(e1-b1)); +#endif + } + + // slice 2 + { + auto offsetSubview = Kokkos::Experimental::subview(sliceMe, Kokkos::ALL(), 0, 0); + ASSERT_EQ(offsetSubview.Rank, 1) << "subview of offset is broken."; + } + { + auto offsetSubview = Kokkos::Experimental::subview(sliceMe, 0, 0, Kokkos::ALL()); + ASSERT_EQ(offsetSubview.Rank, 1) << "subview of offset is broken."; + } + + { + auto offsetSubview = Kokkos::Experimental::subview(sliceMe, 0, Kokkos::ALL(), 0); + ASSERT_EQ(offsetSubview.Rank, 1) << "subview of offset is broken."; + } + } + + {//test subview rank 4 + + Kokkos::Experimental::OffsetView<Scalar****, Device> sliceMe("offsetToSlice", {-10,20}, {-20,30}, {-30,40}, {-40, 50}); + + //slice 1 + { + auto offsetSubview = Kokkos::Experimental::subview(sliceMe, Kokkos::ALL(),Kokkos::ALL(), Kokkos::ALL(), 0); + ASSERT_EQ(offsetSubview.Rank, 3) << "subview of offset is broken."; + } + { + auto offsetSubview = Kokkos::Experimental::subview(sliceMe, Kokkos::ALL(), Kokkos::ALL(), 0, Kokkos::ALL()); + ASSERT_EQ(offsetSubview.Rank, 3) << "subview of offset is broken."; + } + { + auto offsetSubview = Kokkos::Experimental::subview(sliceMe ,Kokkos::ALL(), 0, Kokkos::ALL(),Kokkos::ALL()); + ASSERT_EQ(offsetSubview.Rank, 3) << "subview of offset is broken."; + } + { + auto offsetSubview = Kokkos::Experimental::subview(sliceMe , 0, Kokkos::ALL(), Kokkos::ALL(), Kokkos::ALL() ); + ASSERT_EQ(offsetSubview.Rank, 3) << "subview of offset is broken."; + } + + // slice 2 + auto offsetSubview2a = Kokkos::Experimental::subview(sliceMe, Kokkos::ALL(), Kokkos::ALL(), 0, 0); + ASSERT_EQ(offsetSubview2a.Rank, 2) << "subview of offset is broken."; + { + auto offsetSubview2b = Kokkos::Experimental::subview(sliceMe, Kokkos::ALL(), 0, Kokkos::ALL(), 0); + ASSERT_EQ(offsetSubview2b.Rank, 2) << "subview of offset is broken."; + } + { + auto offsetSubview2b = Kokkos::Experimental::subview(sliceMe, Kokkos::ALL(), 0, 0, Kokkos::ALL()); + ASSERT_EQ(offsetSubview2b.Rank, 2) << "subview of offset is broken."; + } + { + auto offsetSubview2b = Kokkos::Experimental::subview(sliceMe, 0, Kokkos::ALL(), 0, Kokkos::ALL()); + ASSERT_EQ(offsetSubview2b.Rank, 2) << "subview of offset is broken."; + } + { + auto offsetSubview2b = Kokkos::Experimental::subview(sliceMe, 0, 0, Kokkos::ALL(), Kokkos::ALL()); + ASSERT_EQ(offsetSubview2b.Rank, 2) << "subview of offset is broken."; + } + // slice 3 + { + auto offsetSubview = Kokkos::Experimental::subview(sliceMe, Kokkos::ALL(), 0, 0, 0); + ASSERT_EQ(offsetSubview.Rank, 1) << "subview of offset is broken."; + } + { + auto offsetSubview = Kokkos::Experimental::subview(sliceMe, 0, Kokkos::ALL(), 0, 0); + ASSERT_EQ(offsetSubview.Rank, 1) << "subview of offset is broken."; + } + { + auto offsetSubview = Kokkos::Experimental::subview(sliceMe, 0, 0, Kokkos::ALL(), 0); + ASSERT_EQ(offsetSubview.Rank, 1) << "subview of offset is broken."; + } + { + auto offsetSubview = Kokkos::Experimental::subview(sliceMe, 0, 0, 0, Kokkos::ALL()); + ASSERT_EQ(offsetSubview.Rank, 1) << "subview of offset is broken."; + } + + } + + } + + TEST_F( TEST_CATEGORY, offsetview_construction) { + test_offsetview_construction<int,TEST_EXECSPACE>(10); + } + TEST_F( TEST_CATEGORY, offsetview_subview) { + test_offsetview_subview<int,TEST_EXECSPACE>(10); + } + +} // namespace Test + +#endif /* CONTAINERS_UNIT_TESTS_TESTOFFSETVIEW_HPP_ */ diff --git a/packages/kokkos/containers/unit_tests/TestScatterView.hpp b/packages/kokkos/containers/unit_tests/TestScatterView.hpp index 106d2cf98d05eacc101a8f17d620ee98c3ef01cc..d402a91b9f6dbc05cdcc8a8b0d79dc48b802b329 100644 --- a/packages/kokkos/containers/unit_tests/TestScatterView.hpp +++ b/packages/kokkos/containers/unit_tests/TestScatterView.hpp @@ -80,7 +80,9 @@ void test_scatter_view_config(int n) Kokkos::Experimental::contribute(original_view, scatter_view); } #if defined( KOKKOS_ENABLE_CXX11_DISPATCH_LAMBDA ) + Kokkos::fence(); auto host_view = Kokkos::create_mirror_view_and_copy(Kokkos::HostSpace(), original_view); + Kokkos::fence(); for (typename decltype(host_view)::size_type i = 0; i < host_view.extent(0); ++i) { auto val0 = host_view(i, 0); auto val1 = host_view(i, 1); @@ -111,9 +113,6 @@ struct TestDuplicatedScatterView { test_scatter_view_config<ExecSpace, Kokkos::LayoutRight, Kokkos::Experimental::ScatterDuplicated, Kokkos::Experimental::ScatterNonAtomic>(n); - test_scatter_view_config<ExecSpace, Kokkos::LayoutRight, - Kokkos::Experimental::ScatterDuplicated, - Kokkos::Experimental::ScatterAtomic>(n); } }; @@ -127,6 +126,16 @@ struct TestDuplicatedScatterView<Kokkos::Cuda> { }; #endif +#ifdef KOKKOS_ENABLE_ROCM +// disable duplicated instantiation with ROCm until +// UniqueToken can support it +template <> +struct TestDuplicatedScatterView<Kokkos::Experimental::ROCm> { + TestDuplicatedScatterView(int) { + } +}; +#endif + template <typename ExecSpace> void test_scatter_view(int n) { @@ -142,16 +151,28 @@ void test_scatter_view(int n) Kokkos::Experimental::ScatterNonDuplicated, Kokkos::Experimental::ScatterNonAtomic>(n); } +#ifdef KOKKOS_ENABLE_SERIAL + if (!std::is_same<ExecSpace, Kokkos::Serial>::value) { +#endif test_scatter_view_config<ExecSpace, Kokkos::LayoutRight, Kokkos::Experimental::ScatterNonDuplicated, Kokkos::Experimental::ScatterAtomic>(n); +#ifdef KOKKOS_ENABLE_SERIAL + } +#endif TestDuplicatedScatterView<ExecSpace> duptest(n); } TEST_F( TEST_CATEGORY, scatterview) { +#ifndef KOKKOS_ENABLE_ROCM test_scatter_view<TEST_EXECSPACE>(10); +#ifdef KOKKOS_ENABLE_DEBUG + test_scatter_view<TEST_EXECSPACE>(100000); +#else test_scatter_view<TEST_EXECSPACE>(10000000); +#endif +#endif } } // namespace Test diff --git a/packages/kokkos/containers/unit_tests/TestStaticCrsGraph.hpp b/packages/kokkos/containers/unit_tests/TestStaticCrsGraph.hpp index 06d7ed82469841634b99d166fc2ab47811071919..7ba307079f62b5f5ff9037e828923a1ad596cb77 100644 --- a/packages/kokkos/containers/unit_tests/TestStaticCrsGraph.hpp +++ b/packages/kokkos/containers/unit_tests/TestStaticCrsGraph.hpp @@ -46,6 +46,7 @@ #include <vector> #include <Kokkos_StaticCrsGraph.hpp> +#include <Kokkos_Core.hpp> /*--------------------------------------------------------------------------*/ namespace Test { diff --git a/packages/kokkos/containers/unit_tests/cuda/TestCuda_OffsetView.cpp b/packages/kokkos/containers/unit_tests/cuda/TestCuda_OffsetView.cpp new file mode 100644 index 0000000000000000000000000000000000000000..546f6d603a482a2b84f7e5ff33f03d71db3cb5b6 --- /dev/null +++ b/packages/kokkos/containers/unit_tests/cuda/TestCuda_OffsetView.cpp @@ -0,0 +1,47 @@ + +/* +//@HEADER +// ************************************************************************ +// +// Kokkos v. 2.0 +// Copyright (2014) Sandia Corporation +// +// Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, +// the U.S. Government retains certain rights in this software. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// +// 3. Neither the name of the Corporation nor the names of the +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY +// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE +// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) +// +// ************************************************************************ +//@HEADER +*/ + +#include<cuda/TestCuda_Category.hpp> +#include<TestOffsetView.hpp> + diff --git a/packages/kokkos/containers/unit_tests/openmp/TestOpenMP_OffsetView.cpp b/packages/kokkos/containers/unit_tests/openmp/TestOpenMP_OffsetView.cpp new file mode 100644 index 0000000000000000000000000000000000000000..169dae3212847ce8d485f8e46ae97406aaa98bd9 --- /dev/null +++ b/packages/kokkos/containers/unit_tests/openmp/TestOpenMP_OffsetView.cpp @@ -0,0 +1,47 @@ + +/* +//@HEADER +// ************************************************************************ +// +// Kokkos v. 2.0 +// Copyright (2014) Sandia Corporation +// +// Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, +// the U.S. Government retains certain rights in this software. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// +// 3. Neither the name of the Corporation nor the names of the +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY +// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE +// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) +// +// ************************************************************************ +//@HEADER +*/ + +#include<openmp/TestOpenMP_Category.hpp> +#include<TestOffsetView.hpp> + diff --git a/packages/kokkos/containers/unit_tests/rocm/TestROCm_Category.hpp b/packages/kokkos/containers/unit_tests/rocm/TestROCm_Category.hpp index 555ddd6bdf709cdf559deb2c2410ba093f9948a3..d520bbc5a7c827f78c3ac33e46bbfaf7e1c757e9 100644 --- a/packages/kokkos/containers/unit_tests/rocm/TestROCm_Category.hpp +++ b/packages/kokkos/containers/unit_tests/rocm/TestROCm_Category.hpp @@ -60,6 +60,6 @@ protected: } // namespace Test #define TEST_CATEGORY rocm -#define TEST_EXECSPACE Kokkos::ROCm +#define TEST_EXECSPACE Kokkos::Experimental::ROCm #endif diff --git a/packages/kokkos/containers/unit_tests/serial/TestSerial_OffsetView.cpp b/packages/kokkos/containers/unit_tests/serial/TestSerial_OffsetView.cpp new file mode 100644 index 0000000000000000000000000000000000000000..fadd748efbdb4b6c73906348c65269d4199fb041 --- /dev/null +++ b/packages/kokkos/containers/unit_tests/serial/TestSerial_OffsetView.cpp @@ -0,0 +1,46 @@ +/* +//@HEADER +// ************************************************************************ +// +// Kokkos v. 2.0 +// Copyright (2014) Sandia Corporation +// +// Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, +// the U.S. Government retains certain rights in this software. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// +// 3. Neither the name of the Corporation nor the names of the +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY +// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE +// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) +// +// ************************************************************************ +//@HEADER +*/ + +#include<serial/TestSerial_Category.hpp> +#include<TestOffsetView.hpp> + diff --git a/packages/kokkos/containers/unit_tests/threads/TestThreads_OffsetView.cpp b/packages/kokkos/containers/unit_tests/threads/TestThreads_OffsetView.cpp new file mode 100644 index 0000000000000000000000000000000000000000..d1eaa265e3e47fa92097a7a3e598b95a374b77bf --- /dev/null +++ b/packages/kokkos/containers/unit_tests/threads/TestThreads_OffsetView.cpp @@ -0,0 +1,47 @@ + +/* +//@HEADER +// ************************************************************************ +// +// Kokkos v. 2.0 +// Copyright (2014) Sandia Corporation +// +// Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, +// the U.S. Government retains certain rights in this software. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// +// 3. Neither the name of the Corporation nor the names of the +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY +// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE +// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) +// +// ************************************************************************ +//@HEADER +*/ + +#include<threads/TestThreads_Category.hpp> +#include<TestOffsetView.hpp> + diff --git a/packages/kokkos/core/src/CMakeLists.txt b/packages/kokkos/core/src/CMakeLists.txt index eb02616703e257b44c9ab98ffd06e634df07f09a..ab7f3f55c72be040aad805a30aaaf58a14e5636d 100644 --- a/packages/kokkos/core/src/CMakeLists.txt +++ b/packages/kokkos/core/src/CMakeLists.txt @@ -108,3 +108,7 @@ else() endif() #----------------------------------------------------------------------------- + +# build and install pkgconfig file +CONFIGURE_FILE(kokkos.pc.in kokkos.pc @ONLY) +INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/kokkos.pc DESTINATION lib/pkgconfig) diff --git a/packages/kokkos/core/src/Cuda/Kokkos_CudaExec.hpp b/packages/kokkos/core/src/Cuda/Kokkos_CudaExec.hpp index ada3f64fe129703326d2aa00d56badd14d44406c..c31b7f5b5dcfb35687d331d8a53af26021e9f0d7 100644 --- a/packages/kokkos/core/src/Cuda/Kokkos_CudaExec.hpp +++ b/packages/kokkos/core/src/Cuda/Kokkos_CudaExec.hpp @@ -208,7 +208,7 @@ struct CudaParallelLaunch< DriverType , const int shmem , const cudaStream_t stream = 0 ) { - if ( grid.x && ( block.x * block.y * block.z ) ) { + if ( (grid.x != 0) && ( ( block.x * block.y * block.z ) != 0 ) ) { if ( sizeof( Kokkos::Impl::CudaTraits::ConstantGlobalBufferType ) < sizeof( DriverType ) ) { @@ -264,7 +264,7 @@ struct CudaParallelLaunch< DriverType , const int shmem , const cudaStream_t stream = 0 ) { - if ( grid.x && ( block.x * block.y * block.z ) ) { + if ( (grid.x != 0) && ( ( block.x * block.y * block.z ) != 0 ) ) { if ( sizeof( Kokkos::Impl::CudaTraits::ConstantGlobalBufferType ) < sizeof( DriverType ) ) { @@ -321,7 +321,7 @@ struct CudaParallelLaunch< DriverType , const int shmem , const cudaStream_t stream = 0 ) { - if ( grid.x && ( block.x * block.y * block.z ) ) { + if ( (grid.x != 0) && ( ( block.x * block.y * block.z ) != 0 ) ) { if ( sizeof( Kokkos::Impl::CudaTraits::ConstantGlobalBufferType ) < sizeof( DriverType ) ) { @@ -370,7 +370,7 @@ struct CudaParallelLaunch< DriverType , const int shmem , const cudaStream_t stream = 0 ) { - if ( grid.x && ( block.x * block.y * block.z ) ) { + if ( (grid.x != 0) && ( ( block.x * block.y * block.z ) != 0 ) ) { if ( sizeof( Kokkos::Impl::CudaTraits::ConstantGlobalBufferType ) < sizeof( DriverType ) ) { diff --git a/packages/kokkos/core/src/Cuda/Kokkos_CudaSpace.cpp b/packages/kokkos/core/src/Cuda/Kokkos_CudaSpace.cpp index 302cf13d471fadd578200ee5b523c71118d9523f..4fa4609968a9e57c2fad37b78fa1ff3e209164a0 100644 --- a/packages/kokkos/core/src/Cuda/Kokkos_CudaSpace.cpp +++ b/packages/kokkos/core/src/Cuda/Kokkos_CudaSpace.cpp @@ -453,6 +453,8 @@ SharedAllocationRecord( const Kokkos::CudaSpace & arg_space , arg_label.c_str() , SharedAllocationHeader::maximum_label_length ); + // Set last element zero, in case c_str is too long + header.m_label[SharedAllocationHeader::maximum_label_length - 1] = (char) 0; // Copy to device memory Kokkos::Impl::DeepCopy<CudaSpace,HostSpace>( RecordBase::m_alloc_ptr , & header , sizeof(SharedAllocationHeader) ); @@ -491,6 +493,9 @@ SharedAllocationRecord( const Kokkos::CudaUVMSpace & arg_space , arg_label.c_str() , SharedAllocationHeader::maximum_label_length ); + + // Set last element zero, in case c_str is too long + RecordBase::m_alloc_ptr->m_label[SharedAllocationHeader::maximum_label_length - 1] = (char) 0; } SharedAllocationRecord< Kokkos::CudaHostPinnedSpace , void >:: @@ -525,6 +530,8 @@ SharedAllocationRecord( const Kokkos::CudaHostPinnedSpace & arg_space , arg_label.c_str() , SharedAllocationHeader::maximum_label_length ); + // Set last element zero, in case c_str is too long + RecordBase::m_alloc_ptr->m_label[SharedAllocationHeader::maximum_label_length - 1] = (char) 0; } //---------------------------------------------------------------------------- diff --git a/packages/kokkos/core/src/Cuda/Kokkos_Cuda_Impl.cpp b/packages/kokkos/core/src/Cuda/Kokkos_Cuda_Impl.cpp index 8249da6a80b9e43608a169dd5cae4e2001b85529..16952a3ae44b831ab072c18cf9498d62b3a3c5f8 100644 --- a/packages/kokkos/core/src/Cuda/Kokkos_Cuda_Impl.cpp +++ b/packages/kokkos/core/src/Cuda/Kokkos_Cuda_Impl.cpp @@ -689,9 +689,13 @@ Cuda::size_type cuda_internal_multiprocessor_count() CudaSpace::size_type cuda_internal_maximum_concurrent_block_count() { + #if defined(KOKKOS_ARCH_KEPLER) + // Compute capability 3.0 through 3.7 + enum : int { max_resident_blocks_per_multiprocessor = 16 }; + #else // Compute capability 5.0 through 6.2 enum : int { max_resident_blocks_per_multiprocessor = 32 }; - + #endif return CudaInternal::singleton().m_multiProcCount * max_resident_blocks_per_multiprocessor ; }; diff --git a/packages/kokkos/core/src/Cuda/Kokkos_Cuda_Internal.hpp b/packages/kokkos/core/src/Cuda/Kokkos_Cuda_Internal.hpp index 31f405dd840f2a49e784d1ec0653a67a593a13f9..145d93ed76b3a0ef4f574bab1c4dd6bfae1ee67d 100644 --- a/packages/kokkos/core/src/Cuda/Kokkos_Cuda_Internal.hpp +++ b/packages/kokkos/core/src/Cuda/Kokkos_Cuda_Internal.hpp @@ -52,22 +52,22 @@ namespace Kokkos { namespace Impl { -template<class DriverType, bool Large> +template<class DriverType, class LaunchBounds, bool Large> struct CudaGetMaxBlockSize; -template<class DriverType, bool Large = (CudaTraits::ConstantMemoryUseThreshold < sizeof(DriverType))> +template<class DriverType, class LaunchBounds> int cuda_get_max_block_size(const typename DriverType::functor_type & f, const size_t vector_length, const size_t shmem_extra_block, const size_t shmem_extra_thread) { - return CudaGetMaxBlockSize<DriverType,Large>::get_block_size(f,vector_length, shmem_extra_block,shmem_extra_thread); + return CudaGetMaxBlockSize<DriverType,LaunchBounds,(CudaTraits::ConstantMemoryUseThreshold < sizeof(DriverType))>::get_block_size(f,vector_length, shmem_extra_block,shmem_extra_thread); } template<class DriverType> -struct CudaGetMaxBlockSize<DriverType,true> { +struct CudaGetMaxBlockSize<DriverType,Kokkos::LaunchBounds<>,true> { static int get_block_size(const typename DriverType::functor_type & f, const size_t vector_length, const size_t shmem_extra_block, const size_t shmem_extra_thread) { int numBlocks; - int blockSize=32; + int blockSize=1024; int sharedmem = shmem_extra_block + shmem_extra_thread*(blockSize/vector_length) + FunctorTeamShmemSize< typename DriverType::functor_type >::value( f , blockSize/vector_length ); cudaOccupancyMaxActiveBlocksPerMultiprocessor( @@ -76,8 +76,9 @@ struct CudaGetMaxBlockSize<DriverType,true> { blockSize, sharedmem); - while (blockSize<1024 && numBlocks>0) { - blockSize*=2; + if(numBlocks>0) return blockSize; + while (blockSize>32 && numBlocks==0) { + blockSize/=2; sharedmem = shmem_extra_block + shmem_extra_thread*(blockSize/vector_length) + FunctorTeamShmemSize< typename DriverType::functor_type >::value( f , blockSize/vector_length ); @@ -87,19 +88,30 @@ struct CudaGetMaxBlockSize<DriverType,true> { blockSize, sharedmem); } - if(numBlocks>0) return blockSize; - else return blockSize/2; + int blockSizeUpperBound = blockSize*2; + while (blockSize<blockSizeUpperBound && numBlocks>0) { + blockSize+=32; + sharedmem = shmem_extra_block + shmem_extra_thread*(blockSize/vector_length) + + FunctorTeamShmemSize< typename DriverType::functor_type >::value( f , blockSize/vector_length ); + + cudaOccupancyMaxActiveBlocksPerMultiprocessor( + &numBlocks, + cuda_parallel_launch_constant_memory<DriverType>, + blockSize, + sharedmem); + } + return blockSize - 32; } }; template<class DriverType> -struct CudaGetMaxBlockSize<DriverType,false> { +struct CudaGetMaxBlockSize<DriverType,Kokkos::LaunchBounds<>,false> { static int get_block_size(const typename DriverType::functor_type & f, const size_t vector_length, const size_t shmem_extra_block, const size_t shmem_extra_thread) { int numBlocks; - int blockSize=32; - int sharedmem = shmem_extra_block + shmem_extra_thread*(blockSize/vector_length) + + unsigned int blockSize=1024; + unsigned int sharedmem = shmem_extra_block + shmem_extra_thread*(blockSize/vector_length) + FunctorTeamShmemSize< typename DriverType::functor_type >::value( f , blockSize/vector_length ); cudaOccupancyMaxActiveBlocksPerMultiprocessor( &numBlocks, @@ -107,8 +119,9 @@ struct CudaGetMaxBlockSize<DriverType,false> { blockSize, sharedmem); - while (blockSize<1024 && numBlocks>0) { - blockSize*=2; + if(numBlocks>0) return blockSize; + while (blockSize>32 && numBlocks==0) { + blockSize/=2; sharedmem = shmem_extra_block + shmem_extra_thread*(blockSize/vector_length) + FunctorTeamShmemSize< typename DriverType::functor_type >::value( f , blockSize/vector_length ); @@ -118,24 +131,121 @@ struct CudaGetMaxBlockSize<DriverType,false> { blockSize, sharedmem); } - if(numBlocks>0) return blockSize; - else return blockSize/2; + unsigned int blockSizeUpperBound = blockSize*2; + while (blockSize<blockSizeUpperBound && numBlocks>0) { + blockSize+=32; + sharedmem = shmem_extra_block + shmem_extra_thread*(blockSize/vector_length) + + FunctorTeamShmemSize< typename DriverType::functor_type >::value( f , blockSize/vector_length ); + + cudaOccupancyMaxActiveBlocksPerMultiprocessor( + &numBlocks, + cuda_parallel_launch_local_memory<DriverType>, + blockSize, + sharedmem); + } + return blockSize - 32; } }; +template<class DriverType, unsigned int MaxThreadsPerBlock, unsigned int MinBlocksPerSM> +struct CudaGetMaxBlockSize<DriverType,Kokkos::LaunchBounds<MaxThreadsPerBlock,MinBlocksPerSM>,true> { + static int get_block_size(const typename DriverType::functor_type & f, const size_t vector_length, + const size_t shmem_extra_block, const size_t shmem_extra_thread) { + int numBlocks = 0, oldNumBlocks = 0; + unsigned int blockSize=MaxThreadsPerBlock; + unsigned int sharedmem = shmem_extra_block + shmem_extra_thread*(blockSize/vector_length) + + FunctorTeamShmemSize< typename DriverType::functor_type >::value( f , blockSize/vector_length ); + cudaOccupancyMaxActiveBlocksPerMultiprocessor( + &numBlocks, + cuda_parallel_launch_constant_memory<DriverType,MaxThreadsPerBlock,MinBlocksPerSM>, + blockSize, + sharedmem); + + if(static_cast<unsigned int>(numBlocks)>=MinBlocksPerSM) return blockSize; + while (blockSize>32 && static_cast<unsigned int>(numBlocks)<MinBlocksPerSM) { + blockSize/=2; + sharedmem = shmem_extra_block + shmem_extra_thread*(blockSize/vector_length) + + FunctorTeamShmemSize< typename DriverType::functor_type >::value( f , blockSize/vector_length ); -template<class DriverType, bool Large> + cudaOccupancyMaxActiveBlocksPerMultiprocessor( + &numBlocks, + cuda_parallel_launch_constant_memory<DriverType>, + blockSize, + sharedmem); + } + unsigned int blockSizeUpperBound = (blockSize*2<MaxThreadsPerBlock?blockSize*2:MaxThreadsPerBlock); + while (blockSize<blockSizeUpperBound && static_cast<unsigned int>(numBlocks)>MinBlocksPerSM) { + blockSize+=32; + sharedmem = shmem_extra_block + shmem_extra_thread*(blockSize/vector_length) + + FunctorTeamShmemSize< typename DriverType::functor_type >::value( f , blockSize/vector_length ); + oldNumBlocks = numBlocks; + cudaOccupancyMaxActiveBlocksPerMultiprocessor( + &numBlocks, + cuda_parallel_launch_constant_memory<DriverType>, + blockSize, + sharedmem); + } + if(static_cast<unsigned int>(oldNumBlocks)>=MinBlocksPerSM) return blockSize - 32; + return -1; + } +}; + +template<class DriverType, unsigned int MaxThreadsPerBlock, unsigned int MinBlocksPerSM> +struct CudaGetMaxBlockSize<DriverType,Kokkos::LaunchBounds<MaxThreadsPerBlock,MinBlocksPerSM>,false> { + static int get_block_size(const typename DriverType::functor_type & f, const size_t vector_length, + const size_t shmem_extra_block, const size_t shmem_extra_thread) { + int numBlocks = 0, oldNumBlocks = 0; + unsigned int blockSize=MaxThreadsPerBlock; + int sharedmem = shmem_extra_block + shmem_extra_thread*(blockSize/vector_length) + + FunctorTeamShmemSize< typename DriverType::functor_type >::value( f , blockSize/vector_length ); + cudaOccupancyMaxActiveBlocksPerMultiprocessor( + &numBlocks, + cuda_parallel_launch_local_memory<DriverType,MaxThreadsPerBlock,MinBlocksPerSM>, + blockSize, + sharedmem); + if(static_cast<unsigned int>(numBlocks)>=MinBlocksPerSM) return blockSize; + + while (blockSize>32 && static_cast<unsigned int>(numBlocks)<MinBlocksPerSM) { + blockSize/=2; + sharedmem = shmem_extra_block + shmem_extra_thread*(blockSize/vector_length) + + FunctorTeamShmemSize< typename DriverType::functor_type >::value( f , blockSize/vector_length ); + + cudaOccupancyMaxActiveBlocksPerMultiprocessor( + &numBlocks, + cuda_parallel_launch_local_memory<DriverType>, + blockSize, + sharedmem); + } + unsigned int blockSizeUpperBound = (blockSize*2<MaxThreadsPerBlock?blockSize*2:MaxThreadsPerBlock); + while (blockSize<blockSizeUpperBound && static_cast<unsigned int>(numBlocks)>=MinBlocksPerSM) { + blockSize+=32; + sharedmem = shmem_extra_block + shmem_extra_thread*(blockSize/vector_length) + + FunctorTeamShmemSize< typename DriverType::functor_type >::value( f , blockSize/vector_length ); + oldNumBlocks = numBlocks; + cudaOccupancyMaxActiveBlocksPerMultiprocessor( + &numBlocks, + cuda_parallel_launch_local_memory<DriverType>, + blockSize, + sharedmem); + } + if(static_cast<unsigned int>(oldNumBlocks)>=MinBlocksPerSM) return blockSize - 32; + return -1; + } +}; + + +template<class DriverType, class LaunchBounds, bool Large> struct CudaGetOptBlockSize; -template<class DriverType, bool Large = (CudaTraits::ConstantMemoryUseThreshold < sizeof(DriverType))> +template<class DriverType, class LaunchBounds> int cuda_get_opt_block_size(const typename DriverType::functor_type & f, const size_t vector_length, const size_t shmem_extra_block, const size_t shmem_extra_thread) { - return CudaGetOptBlockSize<DriverType,Large>::get_block_size(f,vector_length,shmem_extra_block,shmem_extra_thread); + return CudaGetOptBlockSize<DriverType,LaunchBounds,(CudaTraits::ConstantMemoryUseThreshold < sizeof(DriverType))>::get_block_size(f,vector_length,shmem_extra_block,shmem_extra_thread); } template<class DriverType> -struct CudaGetOptBlockSize<DriverType,true> { +struct CudaGetOptBlockSize<DriverType,Kokkos::LaunchBounds<>,true> { static int get_block_size(const typename DriverType::functor_type & f, const size_t vector_length, const size_t shmem_extra_block, const size_t shmem_extra_thread) { int blockSize=16; @@ -165,7 +275,7 @@ struct CudaGetOptBlockSize<DriverType,true> { }; template<class DriverType> -struct CudaGetOptBlockSize<DriverType,false> { +struct CudaGetOptBlockSize<DriverType,Kokkos::LaunchBounds<>,false> { static int get_block_size(const typename DriverType::functor_type & f, const size_t vector_length, const size_t shmem_extra_block, const size_t shmem_extra_thread) { int blockSize=16; @@ -194,6 +304,75 @@ struct CudaGetOptBlockSize<DriverType,false> { } }; +template<class DriverType, unsigned int MaxThreadsPerBlock, unsigned int MinBlocksPerSM> +struct CudaGetOptBlockSize<DriverType,Kokkos::LaunchBounds< MaxThreadsPerBlock, MinBlocksPerSM >,true> { + static int get_block_size(const typename DriverType::functor_type & f, const size_t vector_length, + const size_t shmem_extra_block, const size_t shmem_extra_thread) { + int blockSize=16; + int numBlocks; + int sharedmem; + int maxOccupancy=0; + int bestBlockSize=0; + int max_threads_per_block = std::min(MaxThreadsPerBlock,cuda_internal_maximum_warp_count()*CudaTraits::WarpSize); + + while(blockSize < max_threads_per_block ) { + blockSize*=2; + + //calculate the occupancy with that optBlockSize and check whether its larger than the largest one found so far + sharedmem = shmem_extra_block + shmem_extra_thread*(blockSize/vector_length) + + FunctorTeamShmemSize< typename DriverType::functor_type >::value( f , blockSize/vector_length ); + cudaOccupancyMaxActiveBlocksPerMultiprocessor( + &numBlocks, + cuda_parallel_launch_constant_memory<DriverType,MaxThreadsPerBlock,MinBlocksPerSM>, + blockSize, + sharedmem); + if(numBlocks >= int(MinBlocksPerSM) && blockSize<=int(MaxThreadsPerBlock)) { + if(maxOccupancy < numBlocks*blockSize) { + maxOccupancy = numBlocks*blockSize; + bestBlockSize = blockSize; + } + } + } + if(maxOccupancy > 0) + return bestBlockSize; + return -1; + } +}; + +template<class DriverType, unsigned int MaxThreadsPerBlock, unsigned int MinBlocksPerSM> +struct CudaGetOptBlockSize<DriverType,Kokkos::LaunchBounds< MaxThreadsPerBlock, MinBlocksPerSM >,false> { + static int get_block_size(const typename DriverType::functor_type & f, const size_t vector_length, + const size_t shmem_extra_block, const size_t shmem_extra_thread) { + int blockSize=16; + int numBlocks; + int sharedmem; + int maxOccupancy=0; + int bestBlockSize=0; + int max_threads_per_block = std::min(MaxThreadsPerBlock,cuda_internal_maximum_warp_count()*CudaTraits::WarpSize); + + while(blockSize < max_threads_per_block ) { + blockSize*=2; + sharedmem = shmem_extra_block + shmem_extra_thread*(blockSize/vector_length) + + FunctorTeamShmemSize< typename DriverType::functor_type >::value( f , blockSize/vector_length ); + + cudaOccupancyMaxActiveBlocksPerMultiprocessor( + &numBlocks, + cuda_parallel_launch_local_memory<DriverType,MaxThreadsPerBlock,MinBlocksPerSM>, + blockSize, + sharedmem); + if(numBlocks >= int(MinBlocksPerSM) && blockSize<=int(MaxThreadsPerBlock)) { + if(maxOccupancy < numBlocks*blockSize) { + maxOccupancy = numBlocks*blockSize; + bestBlockSize = blockSize; + } + } + } + if(maxOccupancy > 0) + return bestBlockSize; + return -1; + } +}; + }} // namespace Kokkos::Impl #endif // KOKKOS_ENABLE_CUDA diff --git a/packages/kokkos/core/src/Cuda/Kokkos_Cuda_Locks.hpp b/packages/kokkos/core/src/Cuda/Kokkos_Cuda_Locks.hpp index 80192bf338a9cfef23729de5b2c6896cc8bb7663..8363a45662ce2553de05a05e13cab31b4c056511 100644 --- a/packages/kokkos/core/src/Cuda/Kokkos_Cuda_Locks.hpp +++ b/packages/kokkos/core/src/Cuda/Kokkos_Cuda_Locks.hpp @@ -148,6 +148,9 @@ namespace Kokkos { namespace Impl { namespace { static int lock_array_copied = 0; + inline int eliminate_warning_for_lock_array() { + return lock_array_copied; + } } } } diff --git a/packages/kokkos/core/src/Cuda/Kokkos_Cuda_Parallel.hpp b/packages/kokkos/core/src/Cuda/Kokkos_Cuda_Parallel.hpp index eac4abac1bb809f4f5b14fa8e832b9f21da75975..2ae1cc0dddf52e937212fc3b822e1b7ce6d8c201 100644 --- a/packages/kokkos/core/src/Cuda/Kokkos_Cuda_Parallel.hpp +++ b/packages/kokkos/core/src/Cuda/Kokkos_Cuda_Parallel.hpp @@ -60,6 +60,7 @@ #include <Cuda/Kokkos_Cuda_Internal.hpp> #include <Cuda/Kokkos_Cuda_Locks.hpp> #include <Kokkos_Vectorization.hpp> +#include <Cuda/Kokkos_Cuda_Version_9_8_Compatibility.hpp> #if defined(KOKKOS_ENABLE_PROFILING) #include <impl/Kokkos_Profiling_Interface.hpp> @@ -114,6 +115,7 @@ public: //---------------------------------------- +#ifdef KOKKOS_ENABLE_DEPRECATED_CODE template< class FunctorType > inline static int team_size_max( const FunctorType & functor ) @@ -131,7 +133,35 @@ public: return n ; } +#endif + + template<class FunctorType> + int team_size_max( const FunctorType& f, const ParallelForTag& ) const { + typedef Impl::ParallelFor< FunctorType , TeamPolicy<Properties...> > closure_type; + int block_size = Kokkos::Impl::cuda_get_max_block_size< closure_type, typename traits::launch_bounds >( f ,(size_t) vector_length(), + (size_t) team_scratch_size(0) + 2*sizeof(double), (size_t) thread_scratch_size(0) + sizeof(double) ); + return block_size/vector_length(); + } + template<class FunctorType> + int team_size_max( const FunctorType& f, const ParallelReduceTag& ) const { + typedef Impl::FunctorAnalysis<Impl::FunctorPatternInterface::REDUCE,TeamPolicyInternal,FunctorType> functor_analysis_type; + typedef typename Impl::ParallelReduceReturnValue<void,typename functor_analysis_type::value_type,FunctorType>::reducer_type reducer_type; + typedef Impl::ParallelReduce< FunctorType , TeamPolicy<Properties...>, reducer_type > closure_type; + typedef Impl::FunctorValueTraits< FunctorType , typename traits::work_tag > functor_value_traits; + + int block_size = Kokkos::Impl::cuda_get_max_block_size< closure_type, typename traits::launch_bounds >( f ,(size_t) vector_length(), + (size_t) team_scratch_size(0) + 2*sizeof(double), (size_t) thread_scratch_size(0) + sizeof(double) + + ((functor_value_traits::StaticValueSize!=0)?0:functor_value_traits::value_size( f ))); + + // Currently we require Power-of-2 team size for reductions. + int p2 = 1; + while(p2<=block_size) p2*=2; + p2/=2; + return p2/vector_length(); + } + +#ifdef KOKKOS_ENABLE_DEPRECATED_CODE template< class FunctorType > static int team_size_recommended( const FunctorType & functor ) { return team_size_max( functor ); } @@ -143,11 +173,41 @@ public: if(max<1) max = 1; return max; } +#endif + + template<class FunctorType> + int team_size_recommended( const FunctorType& f, const ParallelForTag& ) const { + typedef Impl::ParallelFor< FunctorType , TeamPolicy<Properties...> > closure_type; + int block_size = Kokkos::Impl::cuda_get_opt_block_size< closure_type, typename traits::launch_bounds >( f ,(size_t) vector_length(), + (size_t) team_scratch_size(0) + 2*sizeof(double), (size_t) thread_scratch_size(0) + sizeof(double)); + return block_size/vector_length(); + } + + template<class FunctorType> + int team_size_recommended( const FunctorType& f, const ParallelReduceTag& ) const { + typedef Impl::FunctorAnalysis<Impl::FunctorPatternInterface::REDUCE,TeamPolicyInternal,FunctorType> functor_analysis_type; + typedef typename Impl::ParallelReduceReturnValue<void,typename functor_analysis_type::value_type,FunctorType>::reducer_type reducer_type; + typedef Impl::ParallelReduce< FunctorType , TeamPolicy<Properties...>, reducer_type > closure_type; + typedef Impl::FunctorValueTraits< FunctorType , typename traits::work_tag > functor_value_traits; + + int block_size = Kokkos::Impl::cuda_get_opt_block_size< closure_type, typename traits::launch_bounds >( f ,(size_t) vector_length(), + (size_t) team_scratch_size(0) + 2*sizeof(double), (size_t) thread_scratch_size(0) + sizeof(double) + + ((functor_value_traits::StaticValueSize!=0)?0:functor_value_traits::value_size( f ))); + return block_size/vector_length(); + } + inline static int vector_length_max() { return Impl::CudaTraits::WarpSize; } + 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 + } + //---------------------------------------- inline int vector_length() const { return m_vector_length ; } @@ -419,7 +479,7 @@ public: void execute() const { const typename Policy::index_type nwork = m_policy.end() - m_policy.begin(); - const int block_size = Kokkos::Impl::cuda_get_opt_block_size< ParallelFor >( m_functor , 1, 0 , 0 ); + const int block_size = Kokkos::Impl::cuda_get_opt_block_size< ParallelFor, LaunchBounds>( m_functor , 1, 0 , 0 ); const dim3 block( 1 , block_size , 1); const dim3 grid( std::min( typename Policy::index_type(( nwork + block.y - 1 ) / block.y) , typename Policy::index_type(cuda_internal_maximum_grid_count()) ) , 1 , 1); @@ -654,7 +714,7 @@ public: : m_functor( arg_functor ) , m_league_size( arg_policy.league_size() ) , m_team_size( 0 <= arg_policy.team_size() ? arg_policy.team_size() : - Kokkos::Impl::cuda_get_opt_block_size< ParallelFor >( arg_functor , arg_policy.vector_length(), arg_policy.team_scratch_size(0),arg_policy.thread_scratch_size(0) ) / arg_policy.vector_length() ) + Kokkos::Impl::cuda_get_opt_block_size< ParallelFor, LaunchBounds >( arg_functor , arg_policy.vector_length(), arg_policy.team_scratch_size(0),arg_policy.thread_scratch_size(0) ) / arg_policy.vector_length() ) , m_vector_size( arg_policy.vector_length() ) , m_shmem_begin( sizeof(double) * ( m_team_size + 2 ) ) , m_shmem_size( arg_policy.scratch_size(0,m_team_size) + FunctorTeamShmemSize< FunctorType >::value( m_functor , m_team_size ) ) @@ -670,7 +730,7 @@ public: } if ( int(m_team_size) > - int(Kokkos::Impl::cuda_get_max_block_size< ParallelFor > + int(Kokkos::Impl::cuda_get_max_block_size< ParallelFor, LaunchBounds > ( arg_functor , arg_policy.vector_length(), arg_policy.team_scratch_size(0),arg_policy.thread_scratch_size(0) ) / arg_policy.vector_length())) { Kokkos::Impl::throw_runtime_exception(std::string("Kokkos::Impl::ParallelFor< Cuda > requested too large team size.")); } @@ -725,12 +785,13 @@ public: const Policy m_policy ; const ReducerType m_reducer ; const pointer_type m_result_ptr ; + const bool m_result_ptr_device_accessible ; size_type * m_scratch_space ; size_type * m_scratch_flags ; size_type * m_unified_space ; - // Shall we use the shfl based reduction or not (only use it for static sized types of more than 128bit - enum { UseShflReduction = ((sizeof(value_type)>2*sizeof(double)) && ValueTraits::StaticValueSize) }; + // Shall we use the shfl based reduction or not (only use it for static sized types of more than 128bit) + enum { UseShflReduction = false };//((sizeof(value_type)>2*sizeof(double)) && ValueTraits::StaticValueSize) }; // Some crutch to do function overloading private: typedef double DummyShflReductionType; @@ -752,12 +813,12 @@ public: __device__ inline void operator() () const { - run(Kokkos::Impl::if_c<UseShflReduction, DummyShflReductionType, DummySHMEMReductionType>::select(1,1.0) ); +/* run(Kokkos::Impl::if_c<UseShflReduction, DummyShflReductionType, DummySHMEMReductionType>::select(1,1.0) ); } __device__ inline void run(const DummySHMEMReductionType& ) const - { + {*/ const integral_nonzero_constant< size_type , ValueTraits::StaticValueSize / sizeof(size_type) > word_count( ValueTraits::value_size( ReducerConditional::select(m_functor , m_reducer) ) / sizeof(size_type) ); @@ -786,7 +847,8 @@ public: // This is the final block with the final result at the final threads' location size_type * const shared = kokkos_impl_cuda_shared_memory<size_type>() + ( blockDim.y - 1 ) * word_count.value ; - size_type * const global = m_unified_space ? m_unified_space : m_scratch_space ; + size_type * const global = m_result_ptr_device_accessible? reinterpret_cast<size_type*>(m_result_ptr) : + ( m_unified_space ? m_unified_space : m_scratch_space ); if ( threadIdx.y == 0 ) { Kokkos::Impl::FunctorFinal< ReducerTypeFwd , WorkTagFwd >::final( ReducerConditional::select(m_functor , m_reducer) , shared ); @@ -798,10 +860,9 @@ public: } } - __device__ inline +/* __device__ inline void run(const DummyShflReductionType&) const { - value_type value; ValueInit::init( ReducerConditional::select(m_functor , m_reducer) , &value); // Number of blocks is bounded so that the reduction can be limited to two passes. @@ -832,7 +893,7 @@ public: *result = value; } } - } + }*/ // Determine block size constrained by shared memory: static inline @@ -863,16 +924,18 @@ public: CudaParallelLaunch< ParallelReduce, LaunchBounds >( *this, grid, block, shmem ); // copy to device and execute - Cuda::fence(); + if(!m_result_ptr_device_accessible) { + Cuda::fence(); - if ( m_result_ptr ) { - if ( m_unified_space ) { - const int count = ValueTraits::value_count( ReducerConditional::select(m_functor , m_reducer) ); - for ( int i = 0 ; i < count ; ++i ) { m_result_ptr[i] = pointer_type(m_unified_space)[i] ; } - } - else { - const int size = ValueTraits::value_size( ReducerConditional::select(m_functor , m_reducer) ); - DeepCopy<HostSpace,CudaSpace>( m_result_ptr , m_scratch_space , size ); + if ( m_result_ptr ) { + if ( m_unified_space ) { + const int count = ValueTraits::value_count( ReducerConditional::select(m_functor , m_reducer) ); + for ( int i = 0 ; i < count ; ++i ) { m_result_ptr[i] = pointer_type(m_unified_space)[i] ; } + } + else { + const int size = ValueTraits::value_size( ReducerConditional::select(m_functor , m_reducer) ); + DeepCopy<HostSpace,CudaSpace>( m_result_ptr , m_scratch_space , size ); + } } } } @@ -883,17 +946,18 @@ public: } } - template< class HostViewType > + template< class ViewType > ParallelReduce( const FunctorType & arg_functor , const Policy & arg_policy - , const HostViewType & arg_result + , const ViewType & arg_result , typename std::enable_if< - Kokkos::is_view< HostViewType >::value + Kokkos::is_view< ViewType >::value ,void*>::type = NULL) : m_functor( arg_functor ) , m_policy( arg_policy ) , m_reducer( InvalidType() ) , m_result_ptr( arg_result.data() ) + , m_result_ptr_device_accessible(MemorySpaceAccess< Kokkos::CudaSpace , typename ViewType::memory_space>::accessible ) , m_scratch_space( 0 ) , m_scratch_flags( 0 ) , m_unified_space( 0 ) @@ -906,6 +970,7 @@ public: , m_policy( arg_policy ) , m_reducer( reducer ) , m_result_ptr( reducer.view().data() ) + , m_result_ptr_device_accessible(MemorySpaceAccess< Kokkos::CudaSpace , typename ReducerType::result_view_type::memory_space>::accessible ) , m_scratch_space( 0 ) , m_scratch_flags( 0 ) , m_unified_space( 0 ) @@ -953,6 +1018,7 @@ public: const Policy m_policy ; // used for workrange and nwork const ReducerType m_reducer ; const pointer_type m_result_ptr ; + const bool m_result_ptr_device_accessible ; size_type * m_scratch_space ; size_type * m_scratch_flags ; size_type * m_unified_space ; @@ -960,7 +1026,7 @@ public: typedef typename Kokkos::Impl::Reduce::DeviceIterateTile<Policy::rank, Policy, FunctorType, typename Policy::work_tag, reference_type> DeviceIteratePattern; // Shall we use the shfl based reduction or not (only use it for static sized types of more than 128bit - enum { UseShflReduction = ((sizeof(value_type)>2*sizeof(double)) && ValueTraits::StaticValueSize) }; + enum { UseShflReduction = ((sizeof(value_type)>2*sizeof(double)) && (ValueTraits::StaticValueSize!=0)) }; // Some crutch to do function overloading private: typedef double DummyShflReductionType; @@ -978,12 +1044,12 @@ public: inline __device__ void operator() (void) const { - run(Kokkos::Impl::if_c<UseShflReduction, DummyShflReductionType, DummySHMEMReductionType>::select(1,1.0) ); +/* run(Kokkos::Impl::if_c<UseShflReduction, DummyShflReductionType, DummySHMEMReductionType>::select(1,1.0) ); } __device__ inline void run(const DummySHMEMReductionType& ) const - { + {*/ const integral_nonzero_constant< size_type , ValueTraits::StaticValueSize / sizeof(size_type) > word_count( ValueTraits::value_size( ReducerConditional::select(m_functor , m_reducer) ) / sizeof(size_type) ); @@ -1007,7 +1073,8 @@ public: // This is the final block with the final result at the final threads' location size_type * const shared = kokkos_impl_cuda_shared_memory<size_type>() + ( blockDim.y - 1 ) * word_count.value ; - size_type * const global = m_unified_space ? m_unified_space : m_scratch_space ; + size_type * const global = m_result_ptr_device_accessible? reinterpret_cast<size_type*>(m_result_ptr) : + ( m_unified_space ? m_unified_space : m_scratch_space ); if ( threadIdx.y == 0 ) { Kokkos::Impl::FunctorFinal< ReducerTypeFwd , WorkTagFwd >::final( ReducerConditional::select(m_functor , m_reducer) , shared ); @@ -1019,7 +1086,7 @@ public: } } - __device__ inline +/* __device__ inline void run(const DummyShflReductionType&) const { @@ -1051,7 +1118,7 @@ public: } } } - +*/ // Determine block size constrained by shared memory: static inline unsigned local_block_size( const FunctorType & f ) @@ -1089,16 +1156,18 @@ public: CudaParallelLaunch< ParallelReduce, LaunchBounds >( *this, grid, block, shmem ); // copy to device and execute - Cuda::fence(); + if(!m_result_ptr_device_accessible) { + Cuda::fence(); - if ( m_result_ptr ) { - if ( m_unified_space ) { - const int count = ValueTraits::value_count( ReducerConditional::select(m_functor , m_reducer) ); - for ( int i = 0 ; i < count ; ++i ) { m_result_ptr[i] = pointer_type(m_unified_space)[i] ; } - } - else { - const int size = ValueTraits::value_size( ReducerConditional::select(m_functor , m_reducer) ); - DeepCopy<HostSpace,CudaSpace>( m_result_ptr , m_scratch_space , size ); + if ( m_result_ptr ) { + if ( m_unified_space ) { + const int count = ValueTraits::value_count( ReducerConditional::select(m_functor , m_reducer) ); + for ( int i = 0 ; i < count ; ++i ) { m_result_ptr[i] = pointer_type(m_unified_space)[i] ; } + } + else { + const int size = ValueTraits::value_size( ReducerConditional::select(m_functor , m_reducer) ); + DeepCopy<HostSpace,CudaSpace>( m_result_ptr , m_scratch_space , size ); + } } } } @@ -1109,17 +1178,18 @@ public: } } - template< class HostViewType > + template< class ViewType > ParallelReduce( const FunctorType & arg_functor , const Policy & arg_policy - , const HostViewType & arg_result + , const ViewType & arg_result , typename std::enable_if< - Kokkos::is_view< HostViewType >::value + Kokkos::is_view< ViewType >::value ,void*>::type = NULL) : m_functor( arg_functor ) , m_policy( arg_policy ) , m_reducer( InvalidType() ) , m_result_ptr( arg_result.data() ) + , m_result_ptr_device_accessible(MemorySpaceAccess< Kokkos::CudaSpace , typename ViewType::memory_space>::accessible ) , m_scratch_space( 0 ) , m_scratch_flags( 0 ) , m_unified_space( 0 ) @@ -1132,6 +1202,7 @@ public: , m_policy( arg_policy ) , m_reducer( reducer ) , m_result_ptr( reducer.view().data() ) + , m_result_ptr_device_accessible(MemorySpaceAccess< Kokkos::CudaSpace , typename ReducerType::result_view_type::memory_space>::accessible ) , m_scratch_space( 0 ) , m_scratch_flags( 0 ) , m_unified_space( 0 ) @@ -1174,7 +1245,7 @@ public: typedef FunctorType functor_type ; typedef Cuda::size_type size_type ; - enum { UseShflReduction = (true && ValueTraits::StaticValueSize) }; + enum { UseShflReduction = (true && (ValueTraits::StaticValueSize!=0)) }; private: typedef double DummyShflReductionType; @@ -1191,6 +1262,7 @@ private: const FunctorType m_functor ; const ReducerType m_reducer ; const pointer_type m_result_ptr ; + const bool m_result_ptr_device_accessible ; size_type * m_scratch_space ; size_type * m_scratch_flags ; size_type * m_unified_space ; @@ -1279,7 +1351,8 @@ public: // This is the final block with the final result at the final threads' location size_type * const shared = kokkos_impl_cuda_shared_memory<size_type>() + ( blockDim.y - 1 ) * word_count.value ; - size_type * const global = m_unified_space ? m_unified_space : m_scratch_space ; + size_type * const global = m_result_ptr_device_accessible? reinterpret_cast<size_type*>(m_result_ptr) : + ( m_unified_space ? m_unified_space : m_scratch_space ); if ( threadIdx.y == 0 ) { Kokkos::Impl::FunctorFinal< ReducerTypeFwd , WorkTagFwd >::final( ReducerConditional::select(m_functor , m_reducer) , shared ); @@ -1312,12 +1385,18 @@ public: , value ); } - pointer_type const result = (pointer_type) (m_unified_space ? m_unified_space : m_scratch_space) ; + pointer_type const result = m_result_ptr_device_accessible? m_result_ptr : + (pointer_type) ( m_unified_space ? m_unified_space : m_scratch_space ); value_type init; ValueInit::init( ReducerConditional::select(m_functor , m_reducer) , &init); - if(Impl::cuda_inter_block_reduction<FunctorType,ValueJoin,WorkTag> - (value,init,ValueJoin(ReducerConditional::select(m_functor , m_reducer)),m_scratch_space,result,m_scratch_flags,blockDim.y)) { + if( + Impl::cuda_inter_block_reduction<FunctorType,ValueJoin,WorkTag> + (value,init,ValueJoin(ReducerConditional::select(m_functor , m_reducer)),m_scratch_space,result,m_scratch_flags,blockDim.y) + //This breaks a test + // Kokkos::Impl::CudaReductionsFunctor<FunctorType,WorkTag,false,true>::scalar_inter_block_reduction(ReducerConditional::select(m_functor , m_reducer) , blockIdx.x , gridDim.x , + // kokkos_impl_cuda_shared_memory<size_type>() , m_scratch_space , m_scratch_flags) + ) { const unsigned id = threadIdx.y*blockDim.x + threadIdx.x; if(id==0) { Kokkos::Impl::FunctorFinal< ReducerTypeFwd , WorkTagFwd >::final( ReducerConditional::select(m_functor , m_reducer) , (void*) &value ); @@ -1331,7 +1410,7 @@ public: { const int nwork = m_league_size * m_team_size ; if ( nwork ) { - const int block_count = UseShflReduction? std::min( m_league_size , size_type(1024) ) + const int block_count = UseShflReduction? std::min( m_league_size , size_type(1024*32) ) :std::min( m_league_size , m_team_size ); m_scratch_space = cuda_internal_scratch_space( ValueTraits::value_size( ReducerConditional::select(m_functor , m_reducer) ) * block_count ); @@ -1344,16 +1423,18 @@ public: CudaParallelLaunch< ParallelReduce, LaunchBounds >( *this, grid, block, shmem_size_total ); // copy to device and execute - Cuda::fence(); - - if ( m_result_ptr ) { - if ( m_unified_space ) { - const int count = ValueTraits::value_count( ReducerConditional::select(m_functor , m_reducer) ); - for ( int i = 0 ; i < count ; ++i ) { m_result_ptr[i] = pointer_type(m_unified_space)[i] ; } - } - else { - const int size = ValueTraits::value_size( ReducerConditional::select(m_functor , m_reducer) ); - DeepCopy<HostSpace,CudaSpace>( m_result_ptr, m_scratch_space, size ); + if(!m_result_ptr_device_accessible) { + Cuda::fence(); + + if ( m_result_ptr ) { + if ( m_unified_space ) { + const int count = ValueTraits::value_count( ReducerConditional::select(m_functor , m_reducer) ); + for ( int i = 0 ; i < count ; ++i ) { m_result_ptr[i] = pointer_type(m_unified_space)[i] ; } + } + else { + const int size = ValueTraits::value_size( ReducerConditional::select(m_functor , m_reducer) ); + DeepCopy<HostSpace,CudaSpace>( m_result_ptr, m_scratch_space, size ); + } } } } @@ -1364,16 +1445,17 @@ public: } } - template< class HostViewType > + template< class ViewType > ParallelReduce( const FunctorType & arg_functor , const Policy & arg_policy - , const HostViewType & arg_result + , const ViewType & arg_result , typename std::enable_if< - Kokkos::is_view< HostViewType >::value + Kokkos::is_view< ViewType >::value ,void*>::type = NULL) : m_functor( arg_functor ) , m_reducer( InvalidType() ) , m_result_ptr( arg_result.data() ) + , m_result_ptr_device_accessible(MemorySpaceAccess< Kokkos::CudaSpace , typename ViewType::memory_space>::accessible ) , m_scratch_space( 0 ) , m_scratch_flags( 0 ) , m_unified_space( 0 ) @@ -1383,17 +1465,17 @@ public: , m_scratch_ptr{NULL,NULL} , m_scratch_size{ arg_policy.scratch_size(0,( 0 <= arg_policy.team_size() ? arg_policy.team_size() : - Kokkos::Impl::cuda_get_opt_block_size< ParallelReduce >( arg_functor , arg_policy.vector_length(), + Kokkos::Impl::cuda_get_opt_block_size< ParallelReduce, LaunchBounds >( arg_functor , arg_policy.vector_length(), arg_policy.team_scratch_size(0),arg_policy.thread_scratch_size(0) ) / arg_policy.vector_length() ) ), arg_policy.scratch_size(1,( 0 <= arg_policy.team_size() ? arg_policy.team_size() : - Kokkos::Impl::cuda_get_opt_block_size< ParallelReduce >( arg_functor , arg_policy.vector_length(), + Kokkos::Impl::cuda_get_opt_block_size< ParallelReduce, LaunchBounds >( arg_functor , arg_policy.vector_length(), arg_policy.team_scratch_size(0),arg_policy.thread_scratch_size(0) ) / arg_policy.vector_length() ) )} , m_league_size( arg_policy.league_size() ) , m_team_size( 0 <= arg_policy.team_size() ? arg_policy.team_size() : - Kokkos::Impl::cuda_get_opt_block_size< ParallelReduce >( arg_functor , arg_policy.vector_length(), + Kokkos::Impl::cuda_get_opt_block_size< ParallelReduce, LaunchBounds >( arg_functor , arg_policy.vector_length(), arg_policy.team_scratch_size(0),arg_policy.thread_scratch_size(0) ) / arg_policy.vector_length() ) , m_vector_size( arg_policy.vector_length() ) @@ -1430,9 +1512,7 @@ public: Kokkos::Impl::throw_runtime_exception(std::string("Kokkos::Impl::ParallelReduce< Cuda > requested too much L0 scratch memory")); } - if ( unsigned(m_team_size) > - unsigned(Kokkos::Impl::cuda_get_max_block_size< ParallelReduce > - ( arg_functor , arg_policy.vector_length(), arg_policy.team_scratch_size(0),arg_policy.thread_scratch_size(0) ) / arg_policy.vector_length())) { + if ( int(m_team_size) > arg_policy.team_size_max(m_functor,ParallelReduceTag()) ) { Kokkos::Impl::throw_runtime_exception(std::string("Kokkos::Impl::ParallelReduce< Cuda > requested too large team size.")); } @@ -1444,6 +1524,7 @@ public: : m_functor( arg_functor ) , m_reducer( reducer ) , m_result_ptr( reducer.view().data() ) + , m_result_ptr_device_accessible(MemorySpaceAccess< Kokkos::CudaSpace , typename ReducerType::result_view_type::memory_space>::accessible ) , m_scratch_space( 0 ) , m_scratch_flags( 0 ) , m_unified_space( 0 ) @@ -1453,7 +1534,7 @@ public: , m_scratch_ptr{NULL,NULL} , m_league_size( arg_policy.league_size() ) , m_team_size( 0 <= arg_policy.team_size() ? arg_policy.team_size() : - Kokkos::Impl::cuda_get_opt_block_size< ParallelReduce >( arg_functor , arg_policy.vector_length(), + Kokkos::Impl::cuda_get_opt_block_size< ParallelReduce, LaunchBounds >( arg_functor , arg_policy.vector_length(), arg_policy.team_scratch_size(0),arg_policy.thread_scratch_size(0) ) / arg_policy.vector_length() ) , m_vector_size( arg_policy.vector_length() ) @@ -1486,10 +1567,7 @@ public: CudaTraits::SharedMemoryCapacity < shmem_size_total ) { Kokkos::Impl::throw_runtime_exception(std::string("Kokkos::Impl::ParallelReduce< Cuda > bad team size")); } - - if ( int(m_team_size) > - int(Kokkos::Impl::cuda_get_max_block_size< ParallelReduce > - ( arg_functor , arg_policy.vector_length(), arg_policy.team_scratch_size(0),arg_policy.thread_scratch_size(0) ) / arg_policy.vector_length())) { + if ( int(m_team_size) > arg_policy.team_size_max(m_functor,ParallelReduceTag()) ) { Kokkos::Impl::throw_runtime_exception(std::string("Kokkos::Impl::ParallelReduce< Cuda > requested too large team size.")); } @@ -1753,7 +1831,7 @@ public: // Occupancy calculator assumes whole block. m_team_size = - Kokkos::Impl::cuda_get_opt_block_size< ParallelReduce > + Kokkos::Impl::cuda_get_opt_block_size< ParallelReduce, LaunchBounds > ( arg_functor , arg_policy.vector_length() , arg_policy.team_scratch_size(0) @@ -1970,7 +2048,9 @@ private: const WorkRange range( m_policy , blockIdx.x , gridDim.x ); for ( typename Policy::member_type iwork_base = range.begin(); iwork_base < range.end() ; iwork_base += blockDim.y ) { - + #ifdef KOKKOS_IMPL_CUDA_SYNCWARP_NEEDS_MASK + unsigned MASK=KOKKOS_IMPL_CUDA_ACTIVEMASK; + #endif const typename Policy::member_type iwork = iwork_base + threadIdx.y ; __syncthreads(); // Don't overwrite previous iteration values until they are used @@ -1981,7 +2061,11 @@ private: for ( unsigned i = threadIdx.y ; i < word_count.value ; ++i ) { shared_data[i + word_count.value] = shared_data[i] = shared_accum[i] ; } - + #ifdef KOKKOS_IMPL_CUDA_SYNCWARP_NEEDS_MASK + KOKKOS_IMPL_CUDA_SYNCWARP_MASK(MASK); + #else + KOKKOS_IMPL_CUDA_SYNCWARP_MASK; + #endif if ( CudaTraits::WarpSize < word_count.value ) { __syncthreads(); } // Protect against large scan values. // Call functor to accumulate inclusive scan value for this work item @@ -2189,6 +2273,9 @@ private: const WorkRange range( m_policy , blockIdx.x , gridDim.x ); for ( typename Policy::member_type iwork_base = range.begin(); iwork_base < range.end() ; iwork_base += blockDim.y ) { + #ifdef KOKKOS_IMPL_CUDA_SYNCWARP_NEEDS_MASK + unsigned MASK=KOKKOS_IMPL_CUDA_ACTIVEMASK; + #endif const typename Policy::member_type iwork = iwork_base + threadIdx.y ; @@ -2201,6 +2288,11 @@ private: shared_data[i + word_count.value] = shared_data[i] = shared_accum[i] ; } + #ifdef KOKKOS_IMPL_CUDA_SYNCWARP_NEEDS_MASK + KOKKOS_IMPL_CUDA_SYNCWARP_MASK(MASK); + #else + KOKKOS_IMPL_CUDA_SYNCWARP_MASK; + #endif if ( CudaTraits::WarpSize < word_count.value ) { __syncthreads(); } // Protect against large scan values. // Call functor to accumulate inclusive scan value for this work item diff --git a/packages/kokkos/core/src/Cuda/Kokkos_Cuda_ReduceScan.hpp b/packages/kokkos/core/src/Cuda/Kokkos_Cuda_ReduceScan.hpp index 676ba38c6e5d895fe21ec4dcd99488b5a7c52265..82d691f7d4c0979569f5c92c4c00508f4c3668fd 100644 --- a/packages/kokkos/core/src/Cuda/Kokkos_Cuda_ReduceScan.hpp +++ b/packages/kokkos/core/src/Cuda/Kokkos_Cuda_ReduceScan.hpp @@ -194,8 +194,9 @@ void cuda_shfl_up( T & out , T const & in , int delta , */ template< class ValueType , class JoinOp> -__device__ -inline void cuda_intra_warp_reduction( ValueType& result, +__device__ inline +typename std::enable_if< !Kokkos::is_reducer<ValueType>::value >::type +cuda_intra_warp_reduction( ValueType& result, const JoinOp& join, const uint32_t max_active_thread = blockDim.y) { @@ -214,8 +215,9 @@ inline void cuda_intra_warp_reduction( ValueType& result, } template< class ValueType , class JoinOp> -__device__ -inline void cuda_inter_warp_reduction( ValueType& value, +__device__ inline +typename std::enable_if< !Kokkos::is_reducer<ValueType>::value >::type +cuda_inter_warp_reduction( ValueType& value, const JoinOp& join, const int max_active_thread = blockDim.y) { @@ -247,8 +249,9 @@ inline void cuda_inter_warp_reduction( ValueType& value, } template< class ValueType , class JoinOp> -__device__ -inline void cuda_intra_block_reduction( ValueType& value, +__device__ inline +typename std::enable_if< !Kokkos::is_reducer<ValueType>::value >::type +cuda_intra_block_reduction( ValueType& value, const JoinOp& join, const int max_active_thread = blockDim.y) { cuda_intra_warp_reduction(value,join,max_active_thread); @@ -314,31 +317,52 @@ bool cuda_inter_block_reduction( typename FunctorValueTraits< FunctorType , ArgT if( id + 1 < int(gridDim.x) ) join(value, tmp); } - int active = KOKKOS_IMPL_CUDA_BALLOT(1); +#ifdef KOKKOS_IMPL_CUDA_SYNCWARP_NEEDS_MASK + unsigned int mask = KOKKOS_IMPL_CUDA_ACTIVEMASK; + int active = KOKKOS_IMPL_CUDA_BALLOT_MASK(mask,1); +#else + int active = KOKKOS_IMPL_CUDA_BALLOT_MASK(1); +#endif if (int(blockDim.x*blockDim.y) > 2) { value_type tmp = Kokkos::shfl_down(value, 2,32); if( id + 2 < int(gridDim.x) ) join(value, tmp); } - active += KOKKOS_IMPL_CUDA_BALLOT(1); +#ifdef KOKKOS_IMPL_CUDA_SYNCWARP_NEEDS_MASK + active += KOKKOS_IMPL_CUDA_BALLOT_MASK(mask,1); +#else + active += KOKKOS_IMPL_CUDA_BALLOT_MASK(1); +#endif if (int(blockDim.x*blockDim.y) > 4) { value_type tmp = Kokkos::shfl_down(value, 4,32); if( id + 4 < int(gridDim.x) ) join(value, tmp); } - active += KOKKOS_IMPL_CUDA_BALLOT(1); +#ifdef KOKKOS_IMPL_CUDA_SYNCWARP_NEEDS_MASK + active += KOKKOS_IMPL_CUDA_BALLOT_MASK(mask,1); +#else + active += KOKKOS_IMPL_CUDA_BALLOT_MASK(1); +#endif if (int(blockDim.x*blockDim.y) > 8) { value_type tmp = Kokkos::shfl_down(value, 8,32); if( id + 8 < int(gridDim.x) ) join(value, tmp); } - active += KOKKOS_IMPL_CUDA_BALLOT(1); +#ifdef KOKKOS_IMPL_CUDA_SYNCWARP_NEEDS_MASK + active += KOKKOS_IMPL_CUDA_BALLOT_MASK(mask,1); +#else + active += KOKKOS_IMPL_CUDA_BALLOT_MASK(1); +#endif if (int(blockDim.x*blockDim.y) > 16) { value_type tmp = Kokkos::shfl_down(value, 16,32); if( id + 16 < int(gridDim.x) ) join(value, tmp); } - active += KOKKOS_IMPL_CUDA_BALLOT(1); +#ifdef KOKKOS_IMPL_CUDA_SYNCWARP_NEEDS_MASK + active += KOKKOS_IMPL_CUDA_BALLOT_MASK(mask,1); +#else + active += KOKKOS_IMPL_CUDA_BALLOT_MASK(1); +#endif } } //The last block has in its thread=0 the global reduction value through "value" @@ -478,31 +502,52 @@ cuda_inter_block_reduction( const ReducerType& reducer, if( id + 1 < int(gridDim.x) ) reducer.join(value, tmp); } - int active = KOKKOS_IMPL_CUDA_BALLOT(1); +#ifdef KOKKOS_IMPL_CUDA_SYNCWARP_NEEDS_MASK + unsigned int mask = KOKKOS_IMPL_CUDA_ACTIVEMASK; + int active = KOKKOS_IMPL_CUDA_BALLOT_MASK(mask,1); +#else + int active = KOKKOS_IMPL_CUDA_BALLOT_MASK(1); +#endif if (int(blockDim.x*blockDim.y) > 2) { value_type tmp = Kokkos::shfl_down(value, 2,32); if( id + 2 < int(gridDim.x) ) reducer.join(value, tmp); } - active += KOKKOS_IMPL_CUDA_BALLOT(1); +#ifdef KOKKOS_IMPL_CUDA_SYNCWARP_NEEDS_MASK + active += KOKKOS_IMPL_CUDA_BALLOT_MASK(mask,1); +#else + active += KOKKOS_IMPL_CUDA_BALLOT_MASK(1); +#endif if (int(blockDim.x*blockDim.y) > 4) { value_type tmp = Kokkos::shfl_down(value, 4,32); if( id + 4 < int(gridDim.x) ) reducer.join(value, tmp); } - active += KOKKOS_IMPL_CUDA_BALLOT(1); +#ifdef KOKKOS_IMPL_CUDA_SYNCWARP_NEEDS_MASK + active += KOKKOS_IMPL_CUDA_BALLOT_MASK(mask,1); +#else + active += KOKKOS_IMPL_CUDA_BALLOT_MASK(1); +#endif if (int(blockDim.x*blockDim.y) > 8) { value_type tmp = Kokkos::shfl_down(value, 8,32); if( id + 8 < int(gridDim.x) ) reducer.join(value, tmp); } - active += KOKKOS_IMPL_CUDA_BALLOT(1); +#ifdef KOKKOS_IMPL_CUDA_SYNCWARP_NEEDS_MASK + active += KOKKOS_IMPL_CUDA_BALLOT_MASK(mask,1); +#else + active += KOKKOS_IMPL_CUDA_BALLOT_MASK(1); +#endif if (int(blockDim.x*blockDim.y) > 16) { value_type tmp = Kokkos::shfl_down(value, 16,32); if( id + 16 < int(gridDim.x) ) reducer.join(value, tmp); } - active += KOKKOS_IMPL_CUDA_BALLOT(1); +#ifdef KOKKOS_IMPL_CUDA_SYNCWARP_NEEDS_MASK + active += KOKKOS_IMPL_CUDA_BALLOT_MASK(mask,1); +#else + active += KOKKOS_IMPL_CUDA_BALLOT_MASK(1); +#endif } } @@ -513,6 +558,213 @@ cuda_inter_block_reduction( const ReducerType& reducer, #endif } +template<class FunctorType, class ArgTag, bool DoScan, bool UseShfl> +struct CudaReductionsFunctor; + +template<class FunctorType, class ArgTag> +struct CudaReductionsFunctor<FunctorType, ArgTag, false, true> { + typedef FunctorValueTraits< FunctorType , ArgTag > ValueTraits ; + typedef FunctorValueJoin< FunctorType , ArgTag > ValueJoin ; + typedef FunctorValueInit< FunctorType , ArgTag > ValueInit ; + typedef FunctorValueOps< FunctorType , ArgTag > ValueOps ; + typedef typename ValueTraits::pointer_type pointer_type ; + typedef typename ValueTraits::value_type Scalar; + + __device__ + static inline void scalar_intra_warp_reduction( + const FunctorType& functor, + Scalar value, // Contribution + const bool skip_vector, // Skip threads if Kokkos vector lanes are not part of the reduction + const int width, // How much of the warp participates + Scalar& result) + { + unsigned mask = width==32?0xffffffff:((1<<width)-1)<<((threadIdx.y*blockDim.x+threadIdx.x)%(32/width))*width; + for(int delta=skip_vector?blockDim.x:1; delta<width; delta*=2) { + Scalar tmp; + cuda_shfl_down(tmp,value,delta,width,mask); + ValueJoin::join( functor , &value, &tmp); + } + + cuda_shfl(result,value,0,width,mask); + } + + + __device__ + static inline void scalar_intra_block_reduction( + const FunctorType& functor, + Scalar value, + const bool skip, + Scalar* my_global_team_buffer_element, + const int shared_elements, + Scalar* shared_team_buffer_element) { + + const int warp_id = (threadIdx.y*blockDim.x)/32; + Scalar* const my_shared_team_buffer_element = + shared_team_buffer_element + warp_id%shared_elements; + + // Warp Level Reduction, ignoring Kokkos vector entries + scalar_intra_warp_reduction(functor,value,skip,32,value); + + if(warp_id<shared_elements) { + *my_shared_team_buffer_element=value; + } + // Wait for every warp to be done before using one warp to do final cross warp reduction + __syncthreads(); + + const int num_warps = blockDim.x*blockDim.y/32; + for(int w = shared_elements; w<num_warps; w+=shared_elements) { + if(warp_id>=w && warp_id<w+shared_elements) { + if((threadIdx.y*blockDim.x + threadIdx.x)%32==0) + ValueJoin::join( functor , my_shared_team_buffer_element, &value); + } + __syncthreads(); + } + + + if( warp_id == 0) { + ValueInit::init( functor , &value ); + for(unsigned int i=threadIdx.y*blockDim.x+threadIdx.x; i<blockDim.y*blockDim.x/32; i+=32) + ValueJoin::join( functor , &value,&shared_team_buffer_element[i]); + scalar_intra_warp_reduction(functor,value,false,32,*my_global_team_buffer_element); + } + } + + __device__ + static inline bool scalar_inter_block_reduction( + const FunctorType & functor , + const Cuda::size_type block_id , + const Cuda::size_type block_count , + Cuda::size_type * const shared_data , + Cuda::size_type * const global_data , + Cuda::size_type * const global_flags ) { + Scalar* const global_team_buffer_element = ((Scalar*) global_data); + Scalar* const my_global_team_buffer_element = global_team_buffer_element + blockIdx.x; + Scalar* shared_team_buffer_elements = ((Scalar*) shared_data); + Scalar value = shared_team_buffer_elements[threadIdx.y]; + int shared_elements=blockDim.x*blockDim.y/32; + int global_elements=block_count; + __syncthreads(); + + scalar_intra_block_reduction(functor,value,true,my_global_team_buffer_element,shared_elements,shared_team_buffer_elements); + __syncthreads(); + unsigned int num_teams_done = 0; + if(threadIdx.x + threadIdx.y == 0) { + __threadfence(); + num_teams_done = Kokkos::atomic_fetch_add(global_flags,1)+1; + } + bool is_last_block = false; + if(__syncthreads_or(num_teams_done == gridDim.x)) { + is_last_block=true; + *global_flags = 0; + ValueInit::init( functor, &value); + for(int i=threadIdx.y*blockDim.x+threadIdx.x; i<global_elements; i+=blockDim.x*blockDim.y) { + ValueJoin::join( functor , &value,&global_team_buffer_element[i]); + } + scalar_intra_block_reduction(functor,value,false,shared_team_buffer_elements+(blockDim.y-1),shared_elements,shared_team_buffer_elements); + } + return is_last_block; + } +}; + +template<class FunctorType, class ArgTag> +struct CudaReductionsFunctor<FunctorType, ArgTag, false, false> { + typedef FunctorValueTraits< FunctorType , ArgTag > ValueTraits ; + typedef FunctorValueJoin< FunctorType , ArgTag > ValueJoin ; + typedef FunctorValueInit< FunctorType , ArgTag > ValueInit ; + typedef FunctorValueOps< FunctorType , ArgTag > ValueOps ; + typedef typename ValueTraits::pointer_type pointer_type ; + typedef typename ValueTraits::value_type Scalar; + + __device__ + static inline void scalar_intra_warp_reduction( + const FunctorType& functor, + Scalar* value, // Contribution + const bool skip_vector, // Skip threads if Kokkos vector lanes are not part of the reduction + const int width) // How much of the warp participates + { +#ifdef KOKKOS_IMPL_CUDA_SYNCWARP_NEEDS_MASK + unsigned mask = width==32?0xffffffff:((1<<width)-1)<<((threadIdx.y*blockDim.x+threadIdx.x)%(32/width))*width; +#endif + const int lane_id = (threadIdx.y*blockDim.x+threadIdx.x)%32; + for(int delta=skip_vector?blockDim.x:1; delta<width; delta*=2) { + if(lane_id + delta<32) { + ValueJoin::join( functor , value, value+delta); + } +#ifdef KOKKOS_IMPL_CUDA_SYNCWARP_NEEDS_MASK + KOKKOS_IMPL_CUDA_SYNCWARP_MASK(mask); +#else + KOKKOS_IMPL_CUDA_SYNCWARP_MASK; +#endif + } + *value=*(value-lane_id); + } + + + __device__ + static inline void scalar_intra_block_reduction( + const FunctorType& functor, + Scalar value, + const bool skip, + Scalar* result, + const int shared_elements, + Scalar* shared_team_buffer_element) { + + const int warp_id = (threadIdx.y*blockDim.x)/32; + 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,32); + // 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)*32; + if(delta<blockDim.x*blockDim.y) + *my_shared_team_buffer_element = shared_team_buffer_element[delta]; + KOKKOS_IMPL_CUDA_SYNCWARP; + scalar_intra_warp_reduction(functor,my_shared_team_buffer_element,false,blockDim.x*blockDim.y/32); + if(threadIdx.x + threadIdx.y == 0) *result = *shared_team_buffer_element; + } + } + + __device__ + static inline bool scalar_inter_block_reduction( + const FunctorType & functor , + const Cuda::size_type block_id , + const Cuda::size_type block_count , + Cuda::size_type * const shared_data , + Cuda::size_type * const global_data , + Cuda::size_type * const global_flags ) { + Scalar* const global_team_buffer_element = ((Scalar*) global_data); + Scalar* const my_global_team_buffer_element = global_team_buffer_element + blockIdx.x; + Scalar* shared_team_buffer_elements = ((Scalar*) shared_data); + Scalar value = shared_team_buffer_elements[threadIdx.y]; + int shared_elements=blockDim.x*blockDim.y/32; + int global_elements=block_count; + __syncthreads(); + + scalar_intra_block_reduction(functor,value,true,my_global_team_buffer_element,shared_elements,shared_team_buffer_elements); + __syncthreads(); + + unsigned int num_teams_done = 0; + if(threadIdx.x + threadIdx.y == 0) { + __threadfence(); + num_teams_done = Kokkos::atomic_fetch_add(global_flags,1)+1; + } + bool is_last_block = false; + if(__syncthreads_or(num_teams_done == gridDim.x)) { + is_last_block=true; + *global_flags = 0; + ValueInit::init( functor, &value); + for(int i=threadIdx.y*blockDim.x+threadIdx.x; i<global_elements; i+=blockDim.x*blockDim.y) { + ValueJoin::join( functor , &value,&global_team_buffer_element[i]); + } + scalar_intra_block_reduction(functor,value,false,shared_team_buffer_elements+(blockDim.y-1),shared_elements,shared_team_buffer_elements); + } + return is_last_block; + } +}; //---------------------------------------------------------------------------- // See section B.17 of Cuda C Programming Guide Version 3.2 // for discussion of @@ -639,14 +891,15 @@ void cuda_intra_block_reduce_scan( const FunctorType & functor , * * Global reduce result is in the last threads' 'shared_data' location. */ + template< bool DoScan , class FunctorType , class ArgTag > __device__ -bool cuda_single_inter_block_reduce_scan( const FunctorType & functor , - const Cuda::size_type block_id , - const Cuda::size_type block_count , - Cuda::size_type * const shared_data , - Cuda::size_type * const global_data , - Cuda::size_type * const global_flags ) +bool cuda_single_inter_block_reduce_scan2( const FunctorType & functor , + const Cuda::size_type block_id , + const Cuda::size_type block_count , + Cuda::size_type * const shared_data , + Cuda::size_type * const global_data , + Cuda::size_type * const global_flags ) { typedef Cuda::size_type size_type ; typedef FunctorValueTraits< FunctorType , ArgTag > ValueTraits ; @@ -655,7 +908,6 @@ bool cuda_single_inter_block_reduce_scan( const FunctorType & functor , typedef FunctorValueOps< FunctorType , ArgTag > ValueOps ; typedef typename ValueTraits::pointer_type pointer_type ; - //typedef typename ValueTraits::reference_type reference_type ; // '__ffs' = position of the least significant bit set to 1. // 'blockDim.y' is guaranteed to be a power of two so this @@ -678,12 +930,7 @@ bool cuda_single_inter_block_reduce_scan( const FunctorType & functor , size_type * const shared = shared_data + word_count.value * BlockSizeMask ; size_type * const global = global_data + word_count.value * block_id ; -//#if (__CUDA_ARCH__ < 500) for ( int i = int(threadIdx.y) ; i < int(word_count.value) ; i += int(blockDim.y) ) { global[i] = shared[i] ; } -//#else -// for ( size_type i = 0 ; i < word_count.value ; i += 1 ) { global[i] = shared[i] ; } -//#endif - } // Contributing blocks note that their contribution has been completed via an atomic-increment flag @@ -725,6 +972,22 @@ bool cuda_single_inter_block_reduce_scan( const FunctorType & functor , return is_last_block ; } +template< bool DoScan , class FunctorType , class ArgTag > +__device__ +bool cuda_single_inter_block_reduce_scan( const FunctorType & functor , + const Cuda::size_type block_id , + const Cuda::size_type block_count , + Cuda::size_type * const shared_data , + Cuda::size_type * const global_data , + Cuda::size_type * const global_flags ) +{ + typedef FunctorValueTraits< FunctorType , ArgTag > ValueTraits ; + if(!DoScan && ValueTraits::StaticValueSize) + return Kokkos::Impl::CudaReductionsFunctor<FunctorType,ArgTag,false,(ValueTraits::StaticValueSize>16)>::scalar_inter_block_reduction(functor,block_id,block_count,shared_data,global_data,global_flags); + else + return cuda_single_inter_block_reduce_scan2<DoScan, FunctorType, ArgTag>(functor, block_id, block_count, shared_data, global_data, global_flags); +} + // Size in bytes required for inter block reduce or scan template< bool DoScan , class FunctorType , class ArgTag > inline diff --git a/packages/kokkos/core/src/Cuda/Kokkos_Cuda_Team.hpp b/packages/kokkos/core/src/Cuda/Kokkos_Cuda_Team.hpp index 73ec409b296621188e3e7f2110a144eebd46be78..9eb32f07c735c8bda8dce67bd8ce7cb03758679e 100644 --- a/packages/kokkos/core/src/Cuda/Kokkos_Cuda_Team.hpp +++ b/packages/kokkos/core/src/Cuda/Kokkos_Cuda_Team.hpp @@ -160,7 +160,7 @@ public: template<class ValueType> KOKKOS_INLINE_FUNCTION - void team_broadcast( ValueType & val, const int& thread_id) const + void team_broadcast( ValueType & val, const int& thread_id ) const { #ifdef __CUDA_ARCH__ if ( 1 == blockDim.z ) { // team == block @@ -178,6 +178,29 @@ public: } #endif } + + template<class Closure, class ValueType> + KOKKOS_INLINE_FUNCTION + void team_broadcast( Closure const & f, ValueType & val, const int& thread_id ) const + { + #ifdef __CUDA_ARCH__ + f( val ); + + if ( 1 == blockDim.z ) { // team == block + __syncthreads(); + // Wait for shared data write until all threads arrive here + if ( threadIdx.x == 0u && threadIdx.y == (uint32_t)thread_id ) { + *((ValueType*) m_team_reduce) = val ; + } + __syncthreads(); // Wait for shared data read until root thread writes + val = *((ValueType*) m_team_reduce); + } + else { // team <= warp + ValueType tmp( val ); // input might not be a register variable + cuda_shfl( val, tmp, blockDim.x * thread_id, blockDim.x * blockDim.y ); + } + #endif + } //-------------------------------------------------------------------------- /**\brief Reduction across a team @@ -200,92 +223,7 @@ public: team_reduce( ReducerType const & reducer ) const noexcept { #ifdef __CUDA_ARCH__ - - typedef typename ReducerType::value_type value_type ; - - value_type tmp( reducer.reference() ); - - // reduce within the warp using shuffle - - const int wx = - ( threadIdx.x + blockDim.x * threadIdx.y ) & CudaTraits::WarpIndexMask ; - - for ( int i = CudaTraits::WarpSize ; (int)blockDim.x <= ( i >>= 1 ) ; ) { - - cuda_shfl_down( reducer.reference() , tmp , i , CudaTraits::WarpSize ); - - // Root of each vector lane reduces: - if ( 0 == threadIdx.x && wx < i ) { - reducer.join( tmp , reducer.reference() ); - } - } - - if ( 1 < blockDim.z ) { // team <= warp - // broadcast result from root vector lange of root thread - - cuda_shfl( reducer.reference() , tmp - , blockDim.x * threadIdx.y , CudaTraits::WarpSize ); - - } - else { // team == block - // Reduce across warps using shared memory - // Broadcast result within block - - // Number of warps, blockDim.y may not be power of two: - const int nw = ( blockDim.x * blockDim.y + CudaTraits::WarpIndexMask ) >> CudaTraits::WarpIndexShift ; - - // Warp index: - const int wy = ( blockDim.x * threadIdx.y ) >> CudaTraits::WarpIndexShift ; - - // Number of shared memory entries for the reduction: - int nsh = m_team_reduce_size / sizeof(value_type); - - // Using at most one entry per warp: - if ( nw < nsh ) nsh = nw ; - - __syncthreads(); // Wait before shared data write - - if ( 0 == wx && wy < nsh ) { - ((value_type*) m_team_reduce)[wy] = tmp ; - } - - // When more warps than shared entries: - for ( int i = nsh ; i < nw ; i += nsh ) { - - __syncthreads(); - - if ( 0 == wx && i <= wy ) { - const int k = wy - i ; - if ( k < nsh ) { - reducer.join( *((value_type*) m_team_reduce + k) , tmp ); - } - } - } - - __syncthreads(); - - // One warp performs the inter-warp reduction: - - if ( 0 == wy ) { - - // Start at power of two covering nsh - - for ( int i = 1 << ( 32 - __clz(nsh-1) ) ; ( i >>= 1 ) ; ) { - const int k = wx + i ; - if ( wx < i && k < nsh ) { - reducer.join( ((value_type*)m_team_reduce)[wx] - , ((value_type*)m_team_reduce)[k] ); - __threadfence_block(); - } - } - } - - __syncthreads(); // Wait for reduction - - // Broadcast result to all threads - reducer.reference() = *((value_type*)m_team_reduce); - } - + cuda_intra_block_reduction(reducer,blockDim.y); #endif /* #ifdef __CUDA_ARCH__ */ } @@ -801,7 +739,11 @@ void parallel_for ; i += blockDim.x ) { closure(i); } + #ifdef KOKKOS_IMPL_CUDA_SYNCWARP_NEEDS_MASK KOKKOS_IMPL_CUDA_SYNCWARP_MASK(blockDim.x==32?0xffffffff:((1<<blockDim.x)-1)<<(threadIdx.y%(32/blockDim.x))*blockDim.x); + #else + KOKKOS_IMPL_CUDA_SYNCWARP_MASK; + #endif #endif } @@ -970,7 +912,11 @@ KOKKOS_INLINE_FUNCTION void single(const Impl::VectorSingleStruct<Impl::CudaTeamMember>& , const FunctorType& lambda) { #ifdef __CUDA_ARCH__ if(threadIdx.x == 0) lambda(); + #ifdef KOKKOS_IMPL_CUDA_SYNCWARP_NEEDS_MASK KOKKOS_IMPL_CUDA_SYNCWARP_MASK(blockDim.x==32?0xffffffff:((1<<blockDim.x)-1)<<(threadIdx.y%(32/blockDim.x))*blockDim.x); + #else + KOKKOS_IMPL_CUDA_SYNCWARP_MASK; + #endif #endif } @@ -979,7 +925,11 @@ KOKKOS_INLINE_FUNCTION void single(const Impl::ThreadSingleStruct<Impl::CudaTeamMember>& , const FunctorType& lambda) { #ifdef __CUDA_ARCH__ if(threadIdx.x == 0 && threadIdx.y == 0) lambda(); + #ifdef KOKKOS_IMPL_CUDA_SYNCWARP_NEEDS_MASK KOKKOS_IMPL_CUDA_SYNCWARP_MASK(blockDim.x==32?0xffffffff:((1<<blockDim.x)-1)<<(threadIdx.y%(32/blockDim.x))*blockDim.x); + #else + KOKKOS_IMPL_CUDA_SYNCWARP_MASK; + #endif #endif } diff --git a/packages/kokkos/core/src/Cuda/Kokkos_Cuda_Version_9_8_Compatibility.hpp b/packages/kokkos/core/src/Cuda/Kokkos_Cuda_Version_9_8_Compatibility.hpp index 9a9448f67c2c5dc9b8639eaebe56733b625b9ad2..25951b81b00447975552cf435e768d9193cee5de 100644 --- a/packages/kokkos/core/src/Cuda/Kokkos_Cuda_Version_9_8_Compatibility.hpp +++ b/packages/kokkos/core/src/Cuda/Kokkos_Cuda_Version_9_8_Compatibility.hpp @@ -2,9 +2,11 @@ #if defined( __CUDA_ARCH__ ) #if ( CUDA_VERSION < 9000 ) +#define KOKKOS_IMPL_CUDA_ACTIVEMASK 0 #define KOKKOS_IMPL_CUDA_SYNCWARP __threadfence_block() -#define KOKKOS_IMPL_CUDA_SYNCWARP_MASK(x) __threadfence_block() +#define KOKKOS_IMPL_CUDA_SYNCWARP_MASK __threadfence_block() #define KOKKOS_IMPL_CUDA_BALLOT(x) __ballot(x) +#define KOKKOS_IMPL_CUDA_BALLOT_MASK(x) __ballot(x) #define KOKKOS_IMPL_CUDA_SHFL(x,y,z) __shfl(x,y,z) #define KOKKOS_IMPL_CUDA_SHFL_MASK(m,x,y,z) __shfl(x,y,z) #define KOKKOS_IMPL_CUDA_SHFL_UP(x,y,z) __shfl_up(x,y,z) @@ -12,9 +14,11 @@ #define KOKKOS_IMPL_CUDA_SHFL_DOWN(x,y,z) __shfl_down(x,y,z) #define KOKKOS_IMPL_CUDA_SHFL_DOWN_MASK(m,x,y,z) __shfl_down(x,y,z) #else +#define KOKKOS_IMPL_CUDA_ACTIVEMASK __activemask() #define KOKKOS_IMPL_CUDA_SYNCWARP __syncwarp(0xffffffff) -#define KOKKOS_IMPL_CUDA_SYNCWARP_MASK(m) __syncwarp(m) +#define KOKKOS_IMPL_CUDA_SYNCWARP_MASK(m) __syncwarp(m); #define KOKKOS_IMPL_CUDA_BALLOT(x) __ballot_sync(__activemask(),x) +#define KOKKOS_IMPL_CUDA_BALLOT_MASK(m,x) __ballot_sync(m,x) #define KOKKOS_IMPL_CUDA_SHFL(x,y,z) __shfl_sync(0xffffffff,x,y,z) #define KOKKOS_IMPL_CUDA_SHFL_MASK(m,x,y,z) __shfl_sync(m,x,y,z) #define KOKKOS_IMPL_CUDA_SHFL_UP(x,y,z) __shfl_up_sync(0xffffffff,x,y,z) @@ -23,11 +27,16 @@ #define KOKKOS_IMPL_CUDA_SHFL_DOWN_MASK(m,x,y,z) __shfl_down_sync(m,x,y,z) #endif #else +#define KOKKOS_IMPL_CUDA_ACTIVEMASK 0 #define KOKKOS_IMPL_CUDA_SYNCWARP +#define KOKKOS_IMPL_CUDA_SYNCWARP_MASK #define KOKKOS_IMPL_CUDA_BALLOT(x) 0 +#define KOKKOS_IMPL_CUDA_BALLOT_MASK(x) 0 #define KOKKOS_IMPL_CUDA_SHFL(x,y,z) 0 +#define KOKKOS_IMPL_CUDA_SHFL_MASK(m,x,y,z) 0 #define KOKKOS_IMPL_CUDA_SHFL_UP(x,y,z) 0 #define KOKKOS_IMPL_CUDA_SHFL_DOWN(x,y,z) 0 +#define KOKKOS_IMPL_CUDA_SHFL_DOWN_MASK(m,x,y,z) 0 #endif #if ( CUDA_VERSION >= 9000 ) && (!defined(KOKKOS_COMPILER_CLANG)) diff --git a/packages/kokkos/core/src/Cuda/Kokkos_Cuda_View.hpp b/packages/kokkos/core/src/Cuda/Kokkos_Cuda_View.hpp index 49b11f3ae0a4a0fcc9b462412ad2b0fa9baf16cf..af2aff8b35cc46834bb08100162ec6f3938a0e43 100644 --- a/packages/kokkos/core/src/Cuda/Kokkos_Cuda_View.hpp +++ b/packages/kokkos/core/src/Cuda/Kokkos_Cuda_View.hpp @@ -279,6 +279,8 @@ public: KOKKOS_INLINE_FUNCTION static handle_type assign( value_type * arg_data_ptr, track_type const & arg_tracker ) { + if(arg_data_ptr == NULL) return handle_type(); + #if defined( KOKKOS_ACTIVE_EXECUTION_MEMORY_SPACE_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 diff --git a/packages/kokkos/core/src/KokkosExp_MDRangePolicy.hpp b/packages/kokkos/core/src/KokkosExp_MDRangePolicy.hpp index 976bdf05d37e2f2a239688d54b3511284cdafbad..fb0d6cde8424979efe871c1e35bb457eec5b04fa 100644 --- a/packages/kokkos/core/src/KokkosExp_MDRangePolicy.hpp +++ b/packages/kokkos/core/src/KokkosExp_MDRangePolicy.hpp @@ -46,6 +46,8 @@ #include <initializer_list> +#include <Kokkos_Layout.hpp> + #include<impl/KokkosExp_Host_IterateTile.hpp> #include <Kokkos_ExecPolicy.hpp> #include <Kokkos_Parallel.hpp> @@ -63,13 +65,15 @@ namespace Kokkos { // ------------------------------------------------------------------ // - +// Moved to Kokkos_Layout.hpp for more general accessibility +/* enum class Iterate { Default, // Default for the device Left, // Left indices stride fastest Right, // Right indices stride fastest }; +*/ template <typename ExecSpace> struct default_outer_direction diff --git a/packages/kokkos/core/src/Kokkos_Array.hpp b/packages/kokkos/core/src/Kokkos_Array.hpp index c602b035383d6dde3b216910bcd0ad70529abebe..8e5862fe9cc37eb1406c6311543b9b1bbb3ca3b3 100644 --- a/packages/kokkos/core/src/Kokkos_Array.hpp +++ b/packages/kokkos/core/src/Kokkos_Array.hpp @@ -45,11 +45,13 @@ #define KOKKOS_ARRAY_HPP #include <Kokkos_Macros.hpp> +#include <impl/Kokkos_Error.hpp> #include <type_traits> #include <algorithm> #include <limits> #include <cstddef> +#include <string> namespace Kokkos { @@ -132,6 +134,7 @@ public: KOKKOS_INLINE_FUNCTION static constexpr size_type size() { return N ; } KOKKOS_INLINE_FUNCTION static constexpr bool empty(){ return false ; } + KOKKOS_INLINE_FUNCTION constexpr size_type max_size() const { return N ; } template< typename iType > KOKKOS_INLINE_FUNCTION @@ -160,7 +163,7 @@ public: return & m_internal_implementation_private_member_data[0]; } - #ifdef KOKKOS_ROCM_CLANG_WORKAROUND + #ifdef KOKKOS_IMPL_ROCM_CLANG_WORKAROUND // Do not default unless move and move-assignment are also defined KOKKOS_INLINE_FUNCTION ~Array() = default ; @@ -197,6 +200,7 @@ public: KOKKOS_INLINE_FUNCTION static constexpr size_type size() { return 0 ; } KOKKOS_INLINE_FUNCTION static constexpr bool empty() { return true ; } + KOKKOS_INLINE_FUNCTION constexpr size_type max_size() const { return 0 ; } template< typename iType > KOKKOS_INLINE_FUNCTION @@ -261,6 +265,7 @@ public: KOKKOS_INLINE_FUNCTION constexpr size_type size() const { return m_size ; } KOKKOS_INLINE_FUNCTION constexpr bool empty() const { return 0 != m_size ; } + KOKKOS_INLINE_FUNCTION constexpr size_type max_size() const { return m_size ; } template< typename iType > KOKKOS_INLINE_FUNCTION @@ -336,6 +341,7 @@ public: KOKKOS_INLINE_FUNCTION constexpr size_type size() const { return m_size ; } KOKKOS_INLINE_FUNCTION constexpr bool empty() const { return 0 != m_size ; } + KOKKOS_INLINE_FUNCTION constexpr size_type max_size() const { return m_size ; } template< typename iType > KOKKOS_INLINE_FUNCTION diff --git a/packages/kokkos/core/src/Kokkos_Concepts.hpp b/packages/kokkos/core/src/Kokkos_Concepts.hpp index 2e2507b27d557ea758c5df7b16716aa518f2bf09..117469b0a25cd35b38761791a42b5650530f8217 100644 --- a/packages/kokkos/core/src/Kokkos_Concepts.hpp +++ b/packages/kokkos/core/src/Kokkos_Concepts.hpp @@ -105,7 +105,10 @@ namespace Kokkos { template< typename T > struct is_ ## CONCEPT { \ private: \ template< typename , typename = std::true_type > struct have : std::false_type {}; \ - template< typename U > struct have<U,typename std::is_same<U,typename U:: CONCEPT >::type> : std::true_type {}; \ + template< typename U > struct have<U,typename std::is_same< \ + typename std::remove_cv<U>::type, \ + typename std::remove_cv<typename U:: CONCEPT>::type \ + >::type> : std::true_type {}; \ public: \ enum { value = is_ ## CONCEPT::template have<T>::value }; \ }; diff --git a/packages/kokkos/core/src/Kokkos_CopyViews.hpp b/packages/kokkos/core/src/Kokkos_CopyViews.hpp index 31281bc31547b2fa564ab471e6aa1d29ee6e6345..86547420ef0bee23030ee1a7c33a16c898b969bf 100644 --- a/packages/kokkos/core/src/Kokkos_CopyViews.hpp +++ b/packages/kokkos/core/src/Kokkos_CopyViews.hpp @@ -453,8 +453,9 @@ template<class ViewTypeA,class ViewTypeB, class Layout, class ExecSpace,typename struct ViewCopy<ViewTypeA,ViewTypeB,Layout,ExecSpace,2,iType,KOKKOS_IMPL_COMPILING_LIBRARY> { ViewTypeA a; ViewTypeB b; - - typedef Kokkos::Rank<2,ViewFillLayoutSelector<Layout>::iterate,ViewFillLayoutSelector<Layout>::iterate> iterate_type; + static const Kokkos::Iterate outer_iteration_pattern = Kokkos::layout_iterate_type_selector<Layout>::outer_iteration_pattern; + static const Kokkos::Iterate inner_iteration_pattern = Kokkos::layout_iterate_type_selector<Layout>::inner_iteration_pattern; + typedef Kokkos::Rank<2,outer_iteration_pattern,inner_iteration_pattern> iterate_type; typedef Kokkos::MDRangePolicy<ExecSpace,iterate_type,Kokkos::IndexType<iType>> policy_type; ViewCopy(const ViewTypeA& a_, const ViewTypeB& b_):a(a_),b(b_) { @@ -475,7 +476,9 @@ struct ViewCopy<ViewTypeA,ViewTypeB,Layout,ExecSpace,3,iType,KOKKOS_IMPL_COMPILI ViewTypeA a; ViewTypeB b; - typedef Kokkos::Rank<3,ViewFillLayoutSelector<Layout>::iterate,ViewFillLayoutSelector<Layout>::iterate> iterate_type; + static const Kokkos::Iterate outer_iteration_pattern = Kokkos::layout_iterate_type_selector<Layout>::outer_iteration_pattern; + static const Kokkos::Iterate inner_iteration_pattern = Kokkos::layout_iterate_type_selector<Layout>::inner_iteration_pattern; + typedef Kokkos::Rank<3,outer_iteration_pattern,inner_iteration_pattern> iterate_type; typedef Kokkos::MDRangePolicy<ExecSpace,iterate_type,Kokkos::IndexType<iType>> policy_type; ViewCopy(const ViewTypeA& a_, const ViewTypeB& b_):a(a_),b(b_) { @@ -496,7 +499,9 @@ struct ViewCopy<ViewTypeA,ViewTypeB,Layout,ExecSpace,4,iType,KOKKOS_IMPL_COMPILI ViewTypeA a; ViewTypeB b; - typedef Kokkos::Rank<4,ViewFillLayoutSelector<Layout>::iterate,ViewFillLayoutSelector<Layout>::iterate> iterate_type; + static const Kokkos::Iterate outer_iteration_pattern = Kokkos::layout_iterate_type_selector<Layout>::outer_iteration_pattern; + static const Kokkos::Iterate inner_iteration_pattern = Kokkos::layout_iterate_type_selector<Layout>::inner_iteration_pattern; + typedef Kokkos::Rank<4,outer_iteration_pattern,inner_iteration_pattern> iterate_type; typedef Kokkos::MDRangePolicy<ExecSpace,iterate_type,Kokkos::IndexType<iType>> policy_type; ViewCopy(const ViewTypeA& a_, const ViewTypeB& b_):a(a_),b(b_) { @@ -519,7 +524,9 @@ struct ViewCopy<ViewTypeA,ViewTypeB,Layout,ExecSpace,5,iType,KOKKOS_IMPL_COMPILI ViewTypeA a; ViewTypeB b; - typedef Kokkos::Rank<5,ViewFillLayoutSelector<Layout>::iterate,ViewFillLayoutSelector<Layout>::iterate> iterate_type; + static const Kokkos::Iterate outer_iteration_pattern = Kokkos::layout_iterate_type_selector<Layout>::outer_iteration_pattern; + static const Kokkos::Iterate inner_iteration_pattern = Kokkos::layout_iterate_type_selector<Layout>::inner_iteration_pattern; + typedef Kokkos::Rank<5,outer_iteration_pattern,inner_iteration_pattern> iterate_type; typedef Kokkos::MDRangePolicy<ExecSpace,iterate_type,Kokkos::IndexType<iType>> policy_type; ViewCopy(const ViewTypeA& a_, const ViewTypeB& b_):a(a_),b(b_) { @@ -542,7 +549,9 @@ struct ViewCopy<ViewTypeA,ViewTypeB,Layout,ExecSpace,6,iType,KOKKOS_IMPL_COMPILI ViewTypeA a; ViewTypeB b; - typedef Kokkos::Rank<6,ViewFillLayoutSelector<Layout>::iterate,ViewFillLayoutSelector<Layout>::iterate> iterate_type; + static const Kokkos::Iterate outer_iteration_pattern = Kokkos::layout_iterate_type_selector<Layout>::outer_iteration_pattern; + static const Kokkos::Iterate inner_iteration_pattern = Kokkos::layout_iterate_type_selector<Layout>::inner_iteration_pattern; + typedef Kokkos::Rank<6,outer_iteration_pattern,inner_iteration_pattern> iterate_type; typedef Kokkos::MDRangePolicy<ExecSpace,iterate_type,Kokkos::IndexType<iType>> policy_type; ViewCopy(const ViewTypeA& a_, const ViewTypeB& b_):a(a_),b(b_) { @@ -566,7 +575,9 @@ struct ViewCopy<ViewTypeA,ViewTypeB,Layout,ExecSpace,7,iType,KOKKOS_IMPL_COMPILI ViewTypeA a; ViewTypeB b; - typedef Kokkos::Rank<6,ViewFillLayoutSelector<Layout>::iterate,ViewFillLayoutSelector<Layout>::iterate> iterate_type; + static const Kokkos::Iterate outer_iteration_pattern = Kokkos::layout_iterate_type_selector<Layout>::outer_iteration_pattern; + static const Kokkos::Iterate inner_iteration_pattern = Kokkos::layout_iterate_type_selector<Layout>::inner_iteration_pattern; + typedef Kokkos::Rank<6,outer_iteration_pattern,inner_iteration_pattern> iterate_type; typedef Kokkos::MDRangePolicy<ExecSpace,iterate_type,Kokkos::IndexType<iType>> policy_type; ViewCopy(const ViewTypeA& a_, const ViewTypeB& b_):a(a_),b(b_) { @@ -590,7 +601,9 @@ struct ViewCopy<ViewTypeA,ViewTypeB,Layout,ExecSpace,8,iType,KOKKOS_IMPL_COMPILI ViewTypeA a; ViewTypeB b; - typedef Kokkos::Rank<6,ViewFillLayoutSelector<Layout>::iterate,ViewFillLayoutSelector<Layout>::iterate> iterate_type; + static const Kokkos::Iterate outer_iteration_pattern = Kokkos::layout_iterate_type_selector<Layout>::outer_iteration_pattern; + static const Kokkos::Iterate inner_iteration_pattern = Kokkos::layout_iterate_type_selector<Layout>::inner_iteration_pattern; + typedef Kokkos::Rank<6,outer_iteration_pattern,inner_iteration_pattern> iterate_type; typedef Kokkos::MDRangePolicy<ExecSpace,iterate_type,Kokkos::IndexType<iType>> policy_type; ViewCopy(const ViewTypeA& a_, const ViewTypeB& b_):a(a_),b(b_) { @@ -642,7 +655,9 @@ void view_copy(const DstType& dst, const SrcType& src) { int64_t strides[DstType::Rank+1]; dst.stride(strides); Kokkos::Iterate iterate; - if ( std::is_same<typename DstType::array_layout,Kokkos::LayoutRight>::value ) { + if ( Kokkos::is_layouttiled<typename DstType::array_layout>::value ) { + iterate = Kokkos::layout_iterate_type_selector<typename DstType::array_layout>::outer_iteration_pattern; + } else if ( std::is_same<typename DstType::array_layout,Kokkos::LayoutRight>::value ) { iterate = Kokkos::Iterate::Right; } else if ( std::is_same<typename DstType::array_layout,Kokkos::LayoutLeft>::value ) { iterate = Kokkos::Iterate::Left; @@ -1243,9 +1258,9 @@ void deep_copy ViewTypeFlat; ViewTypeFlat dst_flat(dst.data(),dst.size()); - if(dst.span() < std::numeric_limits<int>::max()) + if(dst.span() < std::numeric_limits<int>::max()) { Kokkos::Impl::ViewFill< ViewTypeFlat , Kokkos::LayoutRight, typename ViewType::execution_space, ViewTypeFlat::Rank, int >( dst_flat , value ); - else + } else Kokkos::Impl::ViewFill< ViewTypeFlat , Kokkos::LayoutRight, typename ViewType::execution_space, ViewTypeFlat::Rank, int64_t >( dst_flat , value ); Kokkos::fence(); return; @@ -1397,7 +1412,6 @@ void deep_copy enum { SrcExecCanAccessDst = Kokkos::Impl::SpaceAccessibility< src_execution_space , dst_memory_space >::accessible }; - // Checking for Overlapping Views. dst_value_type* dst_start = dst.data(); dst_value_type* dst_end = dst.data() + dst.span(); @@ -1493,7 +1507,7 @@ void deep_copy Kokkos::fence(); } else { Kokkos::fence(); - Impl::view_copy(typename dst_type::uniform_runtime_nomemspace_type(dst),typename src_type::uniform_runtime_const_nomemspace_type(src)); + Impl::view_copy(dst, src); Kokkos::fence(); } } @@ -1739,8 +1753,7 @@ void deep_copy exec_space.fence(); } else { exec_space.fence(); - Impl::view_copy(typename dst_type::uniform_runtime_nomemspace_type(dst), - typename src_type::uniform_runtime_const_nomemspace_type(src)); + Impl::view_copy(dst, src); exec_space.fence(); } } @@ -1917,4 +1930,213 @@ void realloc( Kokkos::View<T,P...> & v , } } /* namespace Kokkos */ +//---------------------------------------------------------------------------- +//---------------------------------------------------------------------------- + +namespace Kokkos { +namespace Impl { + +// Deduce Mirror Types +template<class Space, class T, class ... P> +struct MirrorViewType { + // The incoming view_type + typedef typename Kokkos::View<T,P...> src_view_type; + // The memory space for the mirror view + typedef typename Space::memory_space memory_space; + // Check whether it is the same memory space + enum { is_same_memspace = std::is_same<memory_space,typename src_view_type::memory_space>::value }; + // The array_layout + typedef typename src_view_type::array_layout array_layout; + // The data type (we probably want it non-const since otherwise we can't even deep_copy to it. + typedef typename src_view_type::non_const_data_type data_type; + // The destination view type if it is not the same memory space + typedef Kokkos::View<data_type,array_layout,Space> dest_view_type; + // If it is the same memory_space return the existsing view_type + // This will also keep the unmanaged trait if necessary + typedef typename std::conditional<is_same_memspace,src_view_type,dest_view_type>::type view_type; +}; + +template<class Space, class T, class ... P> +struct MirrorType { + // The incoming view_type + typedef typename Kokkos::View<T,P...> src_view_type; + // The memory space for the mirror view + typedef typename Space::memory_space memory_space; + // Check whether it is the same memory space + enum { is_same_memspace = std::is_same<memory_space,typename src_view_type::memory_space>::value }; + // The array_layout + typedef typename src_view_type::array_layout array_layout; + // The data type (we probably want it non-const since otherwise we can't even deep_copy to it. + typedef typename src_view_type::non_const_data_type data_type; + // The destination view type if it is not the same memory space + typedef Kokkos::View<data_type,array_layout,Space> view_type; +}; + +} + +template< class T , class ... P > +inline +typename Kokkos::View<T,P...>::HostMirror +create_mirror( const Kokkos::View<T,P...> & src + , typename std::enable_if< + std::is_same< typename ViewTraits<T,P...>::specialize , void >::value && + ! std::is_same< typename Kokkos::ViewTraits<T,P...>::array_layout + , Kokkos::LayoutStride >::value + >::type * = 0 + ) +{ + typedef View<T,P...> src_type ; + typedef typename src_type::HostMirror dst_type ; + + return dst_type( std::string( src.label() ).append("_mirror") +#ifdef KOKKOS_ENABLE_DEPRECATED_CODE + , src.extent(0) + , src.extent(1) + , src.extent(2) + , src.extent(3) + , src.extent(4) + , src.extent(5) + , src.extent(6) + , src.extent(7) ); +#else + , 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 ); +#endif +} + +template< class T , class ... P > +inline +typename Kokkos::View<T,P...>::HostMirror +create_mirror( const Kokkos::View<T,P...> & src + , typename std::enable_if< + std::is_same< typename ViewTraits<T,P...>::specialize , void >::value && + std::is_same< typename Kokkos::ViewTraits<T,P...>::array_layout + , Kokkos::LayoutStride >::value + >::type * = 0 + ) +{ + typedef View<T,P...> src_type ; + typedef typename src_type::HostMirror dst_type ; + + 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(); + + return dst_type( std::string( src.label() ).append("_mirror") , layout ); +} + + +// Create a mirror in a new space (specialization for different space) +template<class Space, class T, class ... P> +typename Impl::MirrorType<Space,T,P ...>::view_type +create_mirror(const Space& , const Kokkos::View<T,P...> & src + , typename std::enable_if< + std::is_same< typename ViewTraits<T,P...>::specialize , void >::value + >::type * = 0) { + return typename Impl::MirrorType<Space,T,P ...>::view_type(src.label(),src.layout()); +} + +template< class T , class ... P > +inline +typename Kokkos::View<T,P...>::HostMirror +create_mirror_view( const Kokkos::View<T,P...> & src + , typename std::enable_if<( + std::is_same< typename Kokkos::View<T,P...>::memory_space + , typename Kokkos::View<T,P...>::HostMirror::memory_space + >::value + && + std::is_same< typename Kokkos::View<T,P...>::data_type + , typename Kokkos::View<T,P...>::HostMirror::data_type + >::value + )>::type * = 0 + ) +{ + return src ; +} + +template< class T , class ... P > +inline +typename Kokkos::View<T,P...>::HostMirror +create_mirror_view( const Kokkos::View<T,P...> & src + , typename std::enable_if< ! ( + std::is_same< typename Kokkos::View<T,P...>::memory_space + , typename Kokkos::View<T,P...>::HostMirror::memory_space + >::value + && + std::is_same< typename Kokkos::View<T,P...>::data_type + , typename Kokkos::View<T,P...>::HostMirror::data_type + >::value + )>::type * = 0 + ) +{ + return Kokkos::create_mirror( src ); +} + +// Create a mirror view in a new space (specialization for same space) +template<class Space, class T, class ... P> +typename Impl::MirrorViewType<Space,T,P ...>::view_type +create_mirror_view(const Space& , const Kokkos::View<T,P...> & src + , typename std::enable_if<Impl::MirrorViewType<Space,T,P ...>::is_same_memspace>::type* = 0 ) { + return src; +} + +// Create a mirror view in a new space (specialization for different space) +template<class Space, class T, class ... P> +typename Impl::MirrorViewType<Space,T,P ...>::view_type +create_mirror_view(const Space& , const Kokkos::View<T,P...> & src + , typename std::enable_if<!Impl::MirrorViewType<Space,T,P ...>::is_same_memspace>::type* = 0 ) { + return typename Impl::MirrorViewType<Space,T,P ...>::view_type(src.label(),src.layout()); +} + +// Create a mirror view and deep_copy in a new space (specialization for same space) +template<class Space, class T, class ... P> +typename Impl::MirrorViewType<Space,T,P ...>::view_type +create_mirror_view_and_copy(const Space& , const Kokkos::View<T,P...> & src + , std::string const& name = "" + , typename std::enable_if<Impl::MirrorViewType<Space,T,P ...>::is_same_memspace>::type* = 0 ) { + (void)name; + return src; +} + +// Create a mirror view and deep_copy in a new space (specialization for different space) +template<class Space, class T, class ... P> +typename Impl::MirrorViewType<Space,T,P ...>::view_type +create_mirror_view_and_copy(const Space& , const Kokkos::View<T,P...> & src + , std::string const& name = "" + , typename std::enable_if<!Impl::MirrorViewType<Space,T,P ...>::is_same_memspace>::type* = 0 ) { + using Mirror = typename Impl::MirrorViewType<Space,T,P ...>::view_type; + std::string label = name.empty() ? src.label() : name; + auto mirror = Mirror(ViewAllocateWithoutInitializing(label), src.layout()); + deep_copy(mirror, src); + return mirror; +} + +} /* namespace Kokkos */ + + +//---------------------------------------------------------------------------- +//---------------------------------------------------------------------------- + #endif diff --git a/packages/kokkos/core/src/Kokkos_ExecPolicy.hpp b/packages/kokkos/core/src/Kokkos_ExecPolicy.hpp index a33e28fcd4293d766042f1fd338cdf34ded4ddf3..d4693b43c153952b5e7530c3d90f97fde3455d0b 100644 --- a/packages/kokkos/core/src/Kokkos_ExecPolicy.hpp +++ b/packages/kokkos/core/src/Kokkos_ExecPolicy.hpp @@ -57,6 +57,10 @@ namespace Kokkos { +struct ParallelForTag {}; +struct ParallelScanTag {}; +struct ParallelReduceTag {}; + struct ChunkSize { int value; ChunkSize(int value_):value(value_) {} @@ -320,6 +324,10 @@ public: template< class FunctorType > static int team_size_recommended( const FunctorType & , const int&); + + template<class FunctorType> + int team_size_recommended( const FunctorType & functor , const int vector_length); + //---------------------------------------- /** \brief Construct policy with the given instance of the execution space */ TeamPolicyInternal( const typename traits::execution_space & , int league_size_request , int team_size_request , int vector_length_request = 1 ); diff --git a/packages/kokkos/core/src/Kokkos_Layout.hpp b/packages/kokkos/core/src/Kokkos_Layout.hpp index b0f92d8cf10cec45ff5d9e7130af8d0d682aa26f..43e117783bfc0d7966179324792cb195a09f58a0 100644 --- a/packages/kokkos/core/src/Kokkos_Layout.hpp +++ b/packages/kokkos/core/src/Kokkos_Layout.hpp @@ -76,6 +76,8 @@ struct LayoutLeft { size_t dimension[ ARRAY_LAYOUT_MAX_RANK ]; + enum { is_extent_constructible = true }; + LayoutLeft( LayoutLeft const & ) = default ; LayoutLeft( LayoutLeft && ) = default ; LayoutLeft & operator = ( LayoutLeft const & ) = default ; @@ -108,6 +110,8 @@ struct LayoutRight { size_t dimension[ ARRAY_LAYOUT_MAX_RANK ]; + enum { is_extent_constructible = true }; + LayoutRight( LayoutRight const & ) = default ; LayoutRight( LayoutRight && ) = default ; LayoutRight & operator = ( LayoutRight const & ) = default ; @@ -132,6 +136,8 @@ struct LayoutStride { size_t dimension[ ARRAY_LAYOUT_MAX_RANK ] ; size_t stride[ ARRAY_LAYOUT_MAX_RANK ] ; + enum { is_extent_constructible = false }; + LayoutStride( LayoutStride const & ) = default ; LayoutStride( LayoutStride && ) = default ; LayoutStride & operator = ( LayoutStride const & ) = default ; @@ -222,6 +228,8 @@ struct LayoutTileLeft { size_t dimension[ ARRAY_LAYOUT_MAX_RANK ] ; + enum { is_extent_constructible = true }; + LayoutTileLeft( LayoutTileLeft const & ) = default ; LayoutTileLeft( LayoutTileLeft && ) = default ; LayoutTileLeft & operator = ( LayoutTileLeft const & ) = default ; @@ -235,6 +243,144 @@ struct LayoutTileLeft { : dimension { argN0 , argN1 , argN2 , argN3 , argN4 , argN5 , argN6 , argN7 } {} }; + +////////////////////////////////////////////////////////////////////////////////////// + +enum class Iterate +{ + Default, + Left, // Left indices stride fastest + Right // Right indices stride fastest +}; + +// To check for LayoutTiled +// This is to hide extra compile-time 'identifier' info within the LayoutTiled class by not relying on template specialization to include the ArgN*'s +template < typename LayoutTiledCheck, class Enable = void > +struct is_layouttiled : std::false_type {}; + +#ifndef KOKKOS_ENABLE_DEPRECATED_CODE +template < typename LayoutTiledCheck > +struct is_layouttiled< LayoutTiledCheck, typename std::enable_if<LayoutTiledCheck::is_array_layout_tiled>::type > : std::true_type {}; + +namespace Experimental { + +/// LayoutTiled +// Must have Rank >= 2 +template < Kokkos::Iterate OuterP, Kokkos::Iterate InnerP, + unsigned ArgN0 , unsigned ArgN1 , unsigned ArgN2 = 0, unsigned ArgN3 = 0, unsigned ArgN4 = 0, unsigned ArgN5 = 0, unsigned ArgN6 = 0, unsigned ArgN7 = 0, + bool IsPowerOfTwo = + ( Impl::is_integral_power_of_two(ArgN0) && + Impl::is_integral_power_of_two(ArgN1) && + (Impl::is_integral_power_of_two(ArgN2) || (ArgN2 == 0) ) && + (Impl::is_integral_power_of_two(ArgN3) || (ArgN3 == 0) ) && + (Impl::is_integral_power_of_two(ArgN4) || (ArgN4 == 0) ) && + (Impl::is_integral_power_of_two(ArgN5) || (ArgN5 == 0) ) && + (Impl::is_integral_power_of_two(ArgN6) || (ArgN6 == 0) ) && + (Impl::is_integral_power_of_two(ArgN7) || (ArgN7 == 0) ) + ) + > +struct LayoutTiled { + + static_assert( IsPowerOfTwo + , "LayoutTiled must be given power-of-two tile dimensions" ); + +#if 0 + static_assert( (Impl::is_integral_power_of_two(ArgN0) ) && + (Impl::is_integral_power_of_two(ArgN1) ) && + (Impl::is_integral_power_of_two(ArgN2) || (ArgN2 == 0) ) && + (Impl::is_integral_power_of_two(ArgN3) || (ArgN3 == 0) ) && + (Impl::is_integral_power_of_two(ArgN4) || (ArgN4 == 0) ) && + (Impl::is_integral_power_of_two(ArgN5) || (ArgN5 == 0) ) && + (Impl::is_integral_power_of_two(ArgN6) || (ArgN6 == 0) ) && + (Impl::is_integral_power_of_two(ArgN7) || (ArgN7 == 0) ) + , "LayoutTiled must be given power-of-two tile dimensions" ); +#endif + + typedef LayoutTiled<OuterP, InnerP, ArgN0, ArgN1, ArgN2, ArgN3, ArgN4, ArgN5, ArgN6, ArgN7, IsPowerOfTwo> array_layout ; + static constexpr Iterate outer_pattern = OuterP; + static constexpr Iterate inner_pattern = InnerP; + + enum { N0 = ArgN0 }; + enum { N1 = ArgN1 }; + enum { N2 = ArgN2 }; + enum { N3 = ArgN3 }; + enum { N4 = ArgN4 }; + enum { N5 = ArgN5 }; + enum { N6 = ArgN6 }; + enum { N7 = ArgN7 }; + + size_t dimension[ ARRAY_LAYOUT_MAX_RANK ] ; + + enum { is_extent_constructible = true }; + + LayoutTiled( LayoutTiled const & ) = default ; + LayoutTiled( LayoutTiled && ) = default ; + LayoutTiled & operator = ( LayoutTiled const & ) = default ; + LayoutTiled & operator = ( LayoutTiled && ) = default ; + + KOKKOS_INLINE_FUNCTION + explicit constexpr + LayoutTiled( size_t argN0 = 0 , size_t argN1 = 0 , size_t argN2 = 0 , size_t argN3 = 0 + , size_t argN4 = 0 , size_t argN5 = 0 , size_t argN6 = 0 , size_t argN7 = 0 + ) + : dimension { argN0 , argN1 , argN2 , argN3 , argN4 , argN5 , argN6 , argN7 } {} +}; + +} // namespace Experimental +#endif + + +// For use with view_copy +template < typename ... Layout > +struct layout_iterate_type_selector { + static const Kokkos::Iterate outer_iteration_pattern = Kokkos::Iterate::Default ; + static const Kokkos::Iterate inner_iteration_pattern = Kokkos::Iterate::Default ; +}; + +template <> +struct layout_iterate_type_selector< Kokkos::LayoutRight > { + static const Kokkos::Iterate outer_iteration_pattern = Kokkos::Iterate::Right ; + static const Kokkos::Iterate inner_iteration_pattern = Kokkos::Iterate::Right ; +}; + +template <> +struct layout_iterate_type_selector< Kokkos::LayoutLeft > { + static const Kokkos::Iterate outer_iteration_pattern = Kokkos::Iterate::Left ; + static const Kokkos::Iterate inner_iteration_pattern = Kokkos::Iterate::Left ; +}; + +template <> +struct layout_iterate_type_selector< Kokkos::LayoutStride > { + static const Kokkos::Iterate outer_iteration_pattern = Kokkos::Iterate::Default ; + static const Kokkos::Iterate inner_iteration_pattern = Kokkos::Iterate::Default ; +}; + +#ifndef KOKKOS_ENABLE_DEPRECATED_CODE +template < unsigned ArgN0 , unsigned ArgN1 , unsigned ArgN2 , unsigned ArgN3 , unsigned ArgN4 , unsigned ArgN5 , unsigned ArgN6 , unsigned ArgN7 > +struct layout_iterate_type_selector< Kokkos::Experimental::LayoutTiled<Kokkos::Iterate::Left, Kokkos::Iterate::Left, ArgN0, ArgN1, ArgN2, ArgN3, ArgN4, ArgN5, ArgN6, ArgN7, true> > { + static const Kokkos::Iterate outer_iteration_pattern = Kokkos::Iterate::Left ; + static const Kokkos::Iterate inner_iteration_pattern = Kokkos::Iterate::Left ; +}; + +template < unsigned ArgN0 , unsigned ArgN1 , unsigned ArgN2 , unsigned ArgN3 , unsigned ArgN4 , unsigned ArgN5 , unsigned ArgN6 , unsigned ArgN7 > +struct layout_iterate_type_selector< Kokkos::Experimental::LayoutTiled<Kokkos::Iterate::Right, Kokkos::Iterate::Left, ArgN0, ArgN1, ArgN2, ArgN3, ArgN4, ArgN5, ArgN6, ArgN7, true> > { + static const Kokkos::Iterate outer_iteration_pattern = Kokkos::Iterate::Right ; + static const Kokkos::Iterate inner_iteration_pattern = Kokkos::Iterate::Left ; +}; + +template < unsigned ArgN0 , unsigned ArgN1 , unsigned ArgN2 , unsigned ArgN3 , unsigned ArgN4 , unsigned ArgN5 , unsigned ArgN6 , unsigned ArgN7 > +struct layout_iterate_type_selector< Kokkos::Experimental::LayoutTiled<Kokkos::Iterate::Left, Kokkos::Iterate::Right, ArgN0, ArgN1, ArgN2, ArgN3, ArgN4, ArgN5, ArgN6, ArgN7, true> > { + static const Kokkos::Iterate outer_iteration_pattern = Kokkos::Iterate::Left ; + static const Kokkos::Iterate inner_iteration_pattern = Kokkos::Iterate::Right ; +}; + +template < unsigned ArgN0 , unsigned ArgN1 , unsigned ArgN2 , unsigned ArgN3 , unsigned ArgN4 , unsigned ArgN5 , unsigned ArgN6 , unsigned ArgN7 > +struct layout_iterate_type_selector< Kokkos::Experimental::LayoutTiled<Kokkos::Iterate::Right, Kokkos::Iterate::Right, ArgN0, ArgN1, ArgN2, ArgN3, ArgN4, ArgN5, ArgN6, ArgN7, true> > { + static const Kokkos::Iterate outer_iteration_pattern = Kokkos::Iterate::Right ; + static const Kokkos::Iterate inner_iteration_pattern = Kokkos::Iterate::Right ; +}; +#endif + } // namespace Kokkos #endif // #ifndef KOKKOS_LAYOUT_HPP diff --git a/packages/kokkos/core/src/Kokkos_Macros.hpp b/packages/kokkos/core/src/Kokkos_Macros.hpp index 0cd19d223754a839d524aa16ea1ce69695f01b81..96bd23e22009bb16ca87adb84afa961e103459ac 100644 --- a/packages/kokkos/core/src/Kokkos_Macros.hpp +++ b/packages/kokkos/core/src/Kokkos_Macros.hpp @@ -153,7 +153,7 @@ #else #define KOKKOS_LAMBDA [=]__host__ __device__ - #if defined( KOKKOS_ENABLE_CXX1Z ) + #if defined( KOKKOS_ENABLE_CXX17 ) || defined( KOKKOS_ENABLE_CXX20 ) #define KOKKOS_CLASS_LAMBDA [=,*this] __host__ __device__ #endif #endif @@ -213,7 +213,7 @@ #define KOKKOS_LAMBDA [=] #endif -#if defined( KOKKOS_ENABLE_CXX1Z ) && !defined( KOKKOS_CLASS_LAMBDA ) +#if (defined( KOKKOS_ENABLE_CXX17 ) || defined( KOKKOS_ENABLE_CXX20) )&& !defined( KOKKOS_CLASS_LAMBDA ) #define KOKKOS_CLASS_LAMBDA [=,*this] #endif @@ -521,6 +521,9 @@ #if defined ( KOKKOS_ENABLE_CUDA ) #if ( 9000 <= CUDA_VERSION ) #define KOKKOS_IMPL_CUDA_VERSION_9_WORKAROUND + #if ( __CUDA_ARCH__ ) + #define KOKKOS_IMPL_CUDA_SYNCWARP_NEEDS_MASK + #endif #endif #endif diff --git a/packages/kokkos/core/src/Kokkos_Parallel_Reduce.hpp b/packages/kokkos/core/src/Kokkos_Parallel_Reduce.hpp index 7bed7aa3dcd85ce6a9e9dc4217726ea254a4d8b0..19007945147ac3f8422e87ab5dc278047b45383f 100644 --- a/packages/kokkos/core/src/Kokkos_Parallel_Reduce.hpp +++ b/packages/kokkos/core/src/Kokkos_Parallel_Reduce.hpp @@ -793,7 +793,7 @@ struct ParallelReduceReturnValue<typename std::enable_if< static return_type return_value(ReturnType& return_val, const FunctorType& functor) { -#ifdef KOKOOS_ENABLE_DEPRECATED_CODE +#ifdef KOKKOS_ENABLE_DEPRECATED_CODE return return_type(return_val,functor.value_count); #else if ( is_array<ReturnType>::value ) @@ -1002,7 +1002,8 @@ void parallel_reduce(const std::string& label, typename Impl::enable_if< Kokkos::Impl::is_execution_policy<PolicyType>::value >::type * = 0) { - Impl::ParallelReduceAdaptor<PolicyType,FunctorType,const ReturnType>::execute(label,policy,functor,return_value); + ReturnType return_value_impl = return_value; + Impl::ParallelReduceAdaptor<PolicyType,FunctorType,ReturnType>::execute(label,policy,functor,return_value_impl); } template< class PolicyType, class FunctorType, class ReturnType > @@ -1054,6 +1055,9 @@ void parallel_reduce(const std::string& label, , typename ValueTraits::pointer_type >::type value_type ; + static_assert(Impl::FunctorAnalysis<Impl::FunctorPatternInterface::REDUCE,PolicyType,FunctorType>:: + has_final_member_function,"Calling parallel_reduce without either return value or final function."); + typedef Kokkos::View< value_type , Kokkos::HostSpace , Kokkos::MemoryUnmanaged @@ -1076,6 +1080,9 @@ void parallel_reduce(const PolicyType& policy, , typename ValueTraits::pointer_type >::type value_type ; + static_assert(Impl::FunctorAnalysis<Impl::FunctorPatternInterface::REDUCE,PolicyType,FunctorType>:: + has_final_member_function,"Calling parallel_reduce without either return value or final function."); + typedef Kokkos::View< value_type , Kokkos::HostSpace , Kokkos::MemoryUnmanaged @@ -1096,6 +1103,9 @@ void parallel_reduce(const size_t& policy, , typename ValueTraits::pointer_type >::type value_type ; + static_assert(Impl::FunctorAnalysis<Impl::FunctorPatternInterface::REDUCE,RangePolicy<>,FunctorType>:: + has_final_member_function,"Calling parallel_reduce without either return value or final function."); + typedef Kokkos::View< value_type , Kokkos::HostSpace , Kokkos::MemoryUnmanaged @@ -1117,6 +1127,9 @@ void parallel_reduce(const std::string& label, , typename ValueTraits::pointer_type >::type value_type ; + static_assert(Impl::FunctorAnalysis<Impl::FunctorPatternInterface::REDUCE,RangePolicy<>,FunctorType>:: + has_final_member_function,"Calling parallel_reduce without either return value or final function."); + typedef Kokkos::View< value_type , Kokkos::HostSpace , Kokkos::MemoryUnmanaged diff --git a/packages/kokkos/core/src/Kokkos_ScratchSpace.hpp b/packages/kokkos/core/src/Kokkos_ScratchSpace.hpp index 4527dd4c14586e2c451d0658a5c774bf0da286a4..86d803ccc972ad274043f708fac5e35400418b3e 100644 --- a/packages/kokkos/core/src/Kokkos_ScratchSpace.hpp +++ b/packages/kokkos/core/src/Kokkos_ScratchSpace.hpp @@ -136,6 +136,55 @@ public: } } + + KOKKOS_INLINE_FUNCTION + void* get_shmem_aligned (const ptrdiff_t size, const ptrdiff_t alignment, int level = -1) const { + if(level == -1) + level = m_default_level; + if(level == 0) { + + char* previous = m_iter_L0; + const ptrdiff_t missalign = size_t(m_iter_L0)%alignment; + if(missalign) m_iter_L0 += alignment-missalign; + + void* tmp = m_iter_L0 + m_offset * size; + if (m_end_L0 < (m_iter_L0 += size * m_multiplier)) { + m_iter_L0 = previous; // put it back like it was + #ifdef KOKKOS_DEBUG + // mfh 23 Jun 2015: printf call consumes 25 registers + // in a CUDA build, so only print in debug mode. The + // function still returns NULL if not enough memory. + printf ("ScratchMemorySpace<...>::get_shmem: Failed to allocate " + "%ld byte(s); remaining capacity is %ld byte(s)\n", long(size), + long(m_end_L0-m_iter_L0)); + #endif // KOKKOS_DEBUG + tmp = 0; + } + return tmp; + } else { + + char* previous = m_iter_L1; + const ptrdiff_t missalign = size_t(m_iter_L1)%alignment; + if(missalign) m_iter_L1 += alignment-missalign; + + void* tmp = m_iter_L1 + m_offset * size; + if (m_end_L1 < (m_iter_L1 += size * m_multiplier)) { + m_iter_L1 = previous; // put it back like it was + #ifdef KOKKOS_DEBUG + // mfh 23 Jun 2015: printf call consumes 25 registers + // in a CUDA build, so only print in debug mode. The + // function still returns NULL if not enough memory. + printf ("ScratchMemorySpace<...>::get_shmem: Failed to allocate " + "%ld byte(s); remaining capacity is %ld byte(s)\n", long(size), + long(m_end_L1-m_iter_L1)); + #endif // KOKKOS_DEBUG + tmp = 0; + } + return tmp; + + } + } + template< typename IntType > KOKKOS_INLINE_FUNCTION ScratchMemorySpace( void * ptr_L0 , const IntType & size_L0 , void * ptr_L1 = NULL , const IntType & size_L1 = 0) diff --git a/packages/kokkos/core/src/Kokkos_Serial.hpp b/packages/kokkos/core/src/Kokkos_Serial.hpp index 911aba892272b1a072c64a6cecfae6c2d2b0760e..01701e53a2783e93b6e272ef7f2e0d577ade9ecd 100644 --- a/packages/kokkos/core/src/Kokkos_Serial.hpp +++ b/packages/kokkos/core/src/Kokkos_Serial.hpp @@ -262,7 +262,7 @@ public: } //---------------------------------------- - +#ifdef KOKKOS_ENABLE_DEPRECATED_CODE template< class FunctorType > static int team_size_max( const FunctorType & ) { return 1 ; } @@ -274,6 +274,16 @@ public: template< class FunctorType > static int team_size_recommended( const FunctorType & , const int& ) { return 1 ; } +#endif + + template<class FunctorType> + int team_size_max( const FunctorType&, const ParallelForTag& ) const { return 1 ; } + template<class FunctorType> + int team_size_max( const FunctorType&, const ParallelReduceTag& ) const { return 1 ; } + template<class FunctorType> + int team_size_recommended( const FunctorType&, const ParallelForTag& ) const { return 1 ; } + template<class FunctorType> + int team_size_recommended( const FunctorType&, const ParallelReduceTag& ) const { return 1 ; } //---------------------------------------- @@ -281,6 +291,16 @@ public: inline int league_size() const { return m_league_size ; } inline size_t scratch_size(const int& level, int = 0) const { return m_team_scratch_size[level] + m_thread_scratch_size[level]; } + inline static + int vector_length_max() + { return 1024; } // Use arbitrary large number, is meant as a vectorizable length + + inline static + int scratch_size_max(int level) + { return (level==0? + 1024*32: + 20*1024*1024); + } /** \brief Specify league size, request team size */ TeamPolicyInternal( execution_space & , int league_size_request diff --git a/packages/kokkos/core/src/Kokkos_TaskScheduler.hpp b/packages/kokkos/core/src/Kokkos_TaskScheduler.hpp index c3185853dc693a7263e1b9e649aad859f78e1121..5045e9cbbcb67301d13fb872bd9deb4ffb16fc8a 100644 --- a/packages/kokkos/core/src/Kokkos_TaskScheduler.hpp +++ b/packages/kokkos/core/src/Kokkos_TaskScheduler.hpp @@ -624,7 +624,6 @@ public: when_all( Future< A1 , A2 > const arg[] , int narg ) { using future_type = Future< execution_space > ; - using task_base = Kokkos::Impl::TaskBase< void , void , void > ; future_type f ; @@ -692,7 +691,6 @@ public: { using input_type = decltype( func(0) ); using future_type = Future< execution_space > ; - using task_base = Kokkos::Impl::TaskBase< void , void , void > ; static_assert( is_future< input_type >::value , "Functor must return a Kokkos::Future" ); diff --git a/packages/kokkos/core/src/Kokkos_View.hpp b/packages/kokkos/core/src/Kokkos_View.hpp index 70301884c3e03f7cacb24ee7b536669e74419a2b..da49aff222102fcc39e7314d4a8154c13b6b3ebf 100644 --- a/packages/kokkos/core/src/Kokkos_View.hpp +++ b/packages/kokkos/core/src/Kokkos_View.hpp @@ -707,10 +707,17 @@ public: //---------------------------------------- // Allow specializations to query their specialized map +#ifdef KOKKOS_ENABLE_DEPRECATED_CODE KOKKOS_INLINE_FUNCTION const Kokkos::Impl::ViewMapping< traits , void > & implementation_map() const { return m_map ; } - +#endif + KOKKOS_INLINE_FUNCTION + const Kokkos::Impl::ViewMapping< traits , void > & + impl_map() const { return m_map ; } + KOKKOS_INLINE_FUNCTION + const Kokkos::Impl::SharedAllocationTracker & + impl_track() const { return m_track ; } //---------------------------------------- private: @@ -752,423 +759,421 @@ private: #endif public: - #ifdef KOKKOS_ENABLE_DEPRECATED_CODE - template< class ... Args > - KOKKOS_FORCEINLINE_FUNCTION - typename std::enable_if<( Kokkos::Impl::are_integral<Args...>::value - && ( 0 == Rank ) - ), reference_type >::type - operator()( Args ... args ) const - { - KOKKOS_IMPL_VIEW_OPERATOR_VERIFY( (m_track,m_map,args...) ) - return m_map.reference(); - } - - template< typename I0 - , class ... Args> - KOKKOS_FORCEINLINE_FUNCTION - typename std::enable_if< - ( Kokkos::Impl::are_integral<I0,Args...>::value - && ( 1 == Rank ) - && ! is_default_map - ), reference_type >::type - operator()( const I0 & i0, - Args ... args) const - { - KOKKOS_IMPL_VIEW_OPERATOR_VERIFY( (m_track,m_map,i0,args...) ) - return m_map.reference(i0); - } - - template< typename I0 - , class ... Args > - KOKKOS_FORCEINLINE_FUNCTION - typename std::enable_if< - ( Kokkos::Impl::are_integral<I0,Args...>::value - && ( 1 == Rank ) - && is_default_map - && ! is_layout_stride - ), reference_type >::type - operator()( const I0 & i0 - , Args ... args ) const - { - KOKKOS_IMPL_VIEW_OPERATOR_VERIFY( (m_track,m_map,i0,args...) ) - return m_map.m_handle[ i0 ]; - } + template< class ... Args > + KOKKOS_FORCEINLINE_FUNCTION + typename std::enable_if<( Kokkos::Impl::are_integral<Args...>::value + && ( 0 == Rank ) + ), reference_type >::type + operator()( Args ... args ) const + { + KOKKOS_IMPL_VIEW_OPERATOR_VERIFY( (m_track,m_map,args...) ) + return m_map.reference(); + } - template< typename I0 - , class ... Args > - KOKKOS_FORCEINLINE_FUNCTION - typename std::enable_if< - ( Kokkos::Impl::are_integral<I0,Args...>::value - && ( 1 == Rank ) - && is_default_map - && is_layout_stride - ), reference_type >::type - operator()( const I0 & i0 - , Args ... args ) const - { - KOKKOS_IMPL_VIEW_OPERATOR_VERIFY( (m_track,m_map,i0,args...) ) - return m_map.m_handle[ m_map.m_offset.m_stride.S0 * i0 ]; - } + template< typename I0 + , class ... Args> + KOKKOS_FORCEINLINE_FUNCTION + typename std::enable_if< + ( Kokkos::Impl::are_integral<I0,Args...>::value + && ( 1 == Rank ) + && ! is_default_map + ), reference_type >::type + operator()( const I0 & i0, + Args ... args) const + { + KOKKOS_IMPL_VIEW_OPERATOR_VERIFY( (m_track,m_map,i0,args...) ) + return m_map.reference(i0); + } - //------------------------------ - // Rank 1 operator[] + template< typename I0 + , class ... Args > + KOKKOS_FORCEINLINE_FUNCTION + typename std::enable_if< + ( Kokkos::Impl::are_integral<I0,Args...>::value + && ( 1 == Rank ) + && is_default_map + && ! is_layout_stride + ), reference_type >::type + operator()( const I0 & i0 + , Args ... args ) const + { + KOKKOS_IMPL_VIEW_OPERATOR_VERIFY( (m_track,m_map,i0,args...) ) + return m_map.m_impl_handle[ i0 ]; + } - template< typename I0 > - KOKKOS_FORCEINLINE_FUNCTION - typename std::enable_if< - ( Kokkos::Impl::are_integral<I0>::value - && ( 1 == Rank ) - && ! is_default_map - ), reference_type >::type - operator[]( const I0 & i0 ) const - { - KOKKOS_IMPL_VIEW_OPERATOR_VERIFY( (m_track,m_map,i0) ) - return m_map.reference(i0); - } + template< typename I0 + , class ... Args > + KOKKOS_FORCEINLINE_FUNCTION + typename std::enable_if< + ( Kokkos::Impl::are_integral<I0,Args...>::value + && ( 1 == Rank ) + && is_default_map + && is_layout_stride + ), reference_type >::type + operator()( const I0 & i0 + , Args ... args ) const + { + KOKKOS_IMPL_VIEW_OPERATOR_VERIFY( (m_track,m_map,i0,args...) ) + return m_map.m_impl_handle[ m_map.m_impl_offset.m_stride.S0 * i0 ]; + } - template< typename I0 > - KOKKOS_FORCEINLINE_FUNCTION - typename std::enable_if< - ( Kokkos::Impl::are_integral<I0>::value - && ( 1 == Rank ) - && is_default_map - && ! is_layout_stride - ), reference_type >::type - operator[]( const I0 & i0 ) const - { - KOKKOS_IMPL_VIEW_OPERATOR_VERIFY( (m_track,m_map,i0) ) - return m_map.m_handle[ i0 ]; - } + //------------------------------ + // Rank 1 operator[] + + template< typename I0 > + KOKKOS_FORCEINLINE_FUNCTION + typename std::enable_if< + ( Kokkos::Impl::are_integral<I0>::value + && ( 1 == Rank ) + && ! is_default_map + ), reference_type >::type + operator[]( const I0 & i0 ) const + { + KOKKOS_IMPL_VIEW_OPERATOR_VERIFY( (m_track,m_map,i0) ) + return m_map.reference(i0); + } template< typename I0 > - KOKKOS_FORCEINLINE_FUNCTION - typename std::enable_if< - ( Kokkos::Impl::are_integral<I0>::value - && ( 1 == Rank ) - && is_default_map - && is_layout_stride - ), reference_type >::type - operator[]( const I0 & i0 ) const - { - KOKKOS_IMPL_VIEW_OPERATOR_VERIFY( (m_track,m_map,i0) ) - return m_map.m_handle[ m_map.m_offset.m_stride.S0 * i0 ]; - } - - - template< typename I0 , typename I1 - , class ... Args > - KOKKOS_FORCEINLINE_FUNCTION - typename std::enable_if< - ( Kokkos::Impl::are_integral<I0,I1,Args...>::value - && ( 2 == Rank ) - && ! is_default_map - ), reference_type >::type - operator()( const I0 & i0 , const I1 & i1 - , Args ... args ) const - { - KOKKOS_IMPL_VIEW_OPERATOR_VERIFY( (m_track,m_map,i0,i1,args...) ) - return m_map.reference(i0,i1); - } + KOKKOS_FORCEINLINE_FUNCTION + typename std::enable_if< + ( Kokkos::Impl::are_integral<I0>::value + && ( 1 == Rank ) + && is_default_map + && ! is_layout_stride + ), reference_type >::type + operator[]( const I0 & i0 ) const + { + KOKKOS_IMPL_VIEW_OPERATOR_VERIFY( (m_track,m_map,i0) ) + return m_map.m_impl_handle[ i0 ]; + } + + template< typename I0 > + KOKKOS_FORCEINLINE_FUNCTION + typename std::enable_if< + ( Kokkos::Impl::are_integral<I0>::value + && ( 1 == Rank ) + && is_default_map + && is_layout_stride + ), reference_type >::type + operator[]( const I0 & i0 ) const + { + KOKKOS_IMPL_VIEW_OPERATOR_VERIFY( (m_track,m_map,i0) ) + return m_map.m_impl_handle[ m_map.m_impl_offset.m_stride.S0 * i0 ]; + } - template< typename I0 , typename I1 - , class ... Args > - KOKKOS_FORCEINLINE_FUNCTION - typename std::enable_if< - ( Kokkos::Impl::are_integral<I0,I1,Args...>::value - && ( 2 == Rank ) - && is_default_map - && is_layout_left && ( traits::rank_dynamic == 0 ) - ), reference_type >::type - operator()( const I0 & i0 , const I1 & i1 - , Args ... args ) const - { - KOKKOS_IMPL_VIEW_OPERATOR_VERIFY( (m_track,m_map,i0,i1,args...) ) - return m_map.m_handle[ i0 + m_map.m_offset.m_dim.N0 * i1 ]; - } - - template< typename I0 , typename I1 - , class ... Args > - KOKKOS_FORCEINLINE_FUNCTION - typename std::enable_if< - ( Kokkos::Impl::are_integral<I0,I1,Args...>::value - && ( 2 == Rank ) - && is_default_map - && is_layout_left && ( traits::rank_dynamic != 0 ) - ), reference_type >::type - operator()( const I0 & i0 , const I1 & i1 - , Args ... args ) const - { - KOKKOS_IMPL_VIEW_OPERATOR_VERIFY( (m_track,m_map,i0,i1,args...) ) - return m_map.m_handle[ i0 + m_map.m_offset.m_stride * i1 ]; - } + template< typename I0 , typename I1 + , class ... Args > + KOKKOS_FORCEINLINE_FUNCTION + typename std::enable_if< + ( Kokkos::Impl::are_integral<I0,I1,Args...>::value + && ( 2 == Rank ) + && ! is_default_map + ), reference_type >::type + operator()( const I0 & i0 , const I1 & i1 + , Args ... args ) const + { + KOKKOS_IMPL_VIEW_OPERATOR_VERIFY( (m_track,m_map,i0,i1,args...) ) + return m_map.reference(i0,i1); + } - template< typename I0 , typename I1 - , class ... Args > - KOKKOS_FORCEINLINE_FUNCTION - typename std::enable_if< - ( Kokkos::Impl::are_integral<I0,I1,Args...>::value - && ( 2 == Rank ) - && is_default_map - && is_layout_right && ( traits::rank_dynamic == 0 ) - ), reference_type >::type - operator()( const I0 & i0 , const I1 & i1 - , Args ... args ) const - { - KOKKOS_IMPL_VIEW_OPERATOR_VERIFY( (m_track,m_map,i0,i1,args...) ) - return m_map.m_handle[ i1 + m_map.m_offset.m_dim.N1 * i0 ]; - } + template< typename I0 , typename I1 + , class ... Args > + KOKKOS_FORCEINLINE_FUNCTION + typename std::enable_if< + ( Kokkos::Impl::are_integral<I0,I1,Args...>::value + && ( 2 == Rank ) + && is_default_map + && is_layout_left && ( traits::rank_dynamic == 0 ) + ), reference_type >::type + operator()( const I0 & i0 , const I1 & i1 + , Args ... args ) const + { + KOKKOS_IMPL_VIEW_OPERATOR_VERIFY( (m_track,m_map,i0,i1,args...) ) + return m_map.m_impl_handle[ i0 + m_map.m_impl_offset.m_dim.N0 * i1 ]; + } - template< typename I0 , typename I1 - , class ... Args > - KOKKOS_FORCEINLINE_FUNCTION - typename std::enable_if< - ( Kokkos::Impl::are_integral<I0,I1,Args...>::value - && ( 2 == Rank ) - && is_default_map - && is_layout_right && ( traits::rank_dynamic != 0 ) - ), reference_type >::type - operator()( const I0 & i0 , const I1 & i1 - , Args ... args ) const - { - KOKKOS_IMPL_VIEW_OPERATOR_VERIFY( (m_track,m_map,i0,i1,args...) ) - return m_map.m_handle[ i1 + m_map.m_offset.m_stride * i0 ]; - } + template< typename I0 , typename I1 + , class ... Args > + KOKKOS_FORCEINLINE_FUNCTION + typename std::enable_if< + ( Kokkos::Impl::are_integral<I0,I1,Args...>::value + && ( 2 == Rank ) + && is_default_map + && is_layout_left && ( traits::rank_dynamic != 0 ) + ), reference_type >::type + operator()( const I0 & i0 , const I1 & i1 + , Args ... args ) const + { + KOKKOS_IMPL_VIEW_OPERATOR_VERIFY( (m_track,m_map,i0,i1,args...) ) + return m_map.m_impl_handle[ i0 + m_map.m_impl_offset.m_stride * i1 ]; + } - template< typename I0 , typename I1 - , class ... Args > - KOKKOS_FORCEINLINE_FUNCTION - typename std::enable_if< - ( Kokkos::Impl::are_integral<I0,I1,Args...>::value - && ( 2 == Rank ) - && is_default_map - && is_layout_stride - ), reference_type >::type - operator()( const I0 & i0 , const I1 & i1 - , Args ... args ) const - { - KOKKOS_IMPL_VIEW_OPERATOR_VERIFY( (m_track,m_map,i0,i1,args...) ) - return m_map.m_handle[ i0 * m_map.m_offset.m_stride.S0 + - i1 * m_map.m_offset.m_stride.S1 ]; - } + template< typename I0 , typename I1 + , class ... Args > + KOKKOS_FORCEINLINE_FUNCTION + typename std::enable_if< + ( Kokkos::Impl::are_integral<I0,I1,Args...>::value + && ( 2 == Rank ) + && is_default_map + && is_layout_right && ( traits::rank_dynamic == 0 ) + ), reference_type >::type + operator()( const I0 & i0 , const I1 & i1 + , Args ... args ) const + { + KOKKOS_IMPL_VIEW_OPERATOR_VERIFY( (m_track,m_map,i0,i1,args...) ) + return m_map.m_impl_handle[ i1 + m_map.m_impl_offset.m_dim.N1 * i0 ]; + } - //------------------------------ - // Rank 3 + template< typename I0 , typename I1 + , class ... Args > + KOKKOS_FORCEINLINE_FUNCTION + typename std::enable_if< + ( Kokkos::Impl::are_integral<I0,I1,Args...>::value + && ( 2 == Rank ) + && is_default_map + && is_layout_right && ( traits::rank_dynamic != 0 ) + ), reference_type >::type + operator()( const I0 & i0 , const I1 & i1 + , Args ... args ) const + { + KOKKOS_IMPL_VIEW_OPERATOR_VERIFY( (m_track,m_map,i0,i1,args...) ) + return m_map.m_impl_handle[ i1 + m_map.m_impl_offset.m_stride * i0 ]; + } - template< typename I0 , typename I1 , typename I2 - , class ... Args > - KOKKOS_FORCEINLINE_FUNCTION - typename std::enable_if< - ( Kokkos::Impl::are_integral<I0,I1,I2,Args...>::value - && ( 3 == Rank ) - && is_default_map - ), reference_type >::type - operator()( const I0 & i0 , const I1 & i1 , const I2 & i2 - , Args ... args ) const - { - KOKKOS_IMPL_VIEW_OPERATOR_VERIFY( (m_track,m_map,i0,i1,i2,args...) ) - return m_map.m_handle[ m_map.m_offset(i0,i1,i2) ]; - } + template< typename I0 , typename I1 + , class ... Args > + KOKKOS_FORCEINLINE_FUNCTION + typename std::enable_if< + ( Kokkos::Impl::are_integral<I0,I1,Args...>::value + && ( 2 == Rank ) + && is_default_map + && is_layout_stride + ), reference_type >::type + operator()( const I0 & i0 , const I1 & i1 + , Args ... args ) const + { + KOKKOS_IMPL_VIEW_OPERATOR_VERIFY( (m_track,m_map,i0,i1,args...) ) + return m_map.m_impl_handle[ i0 * m_map.m_impl_offset.m_stride.S0 + + i1 * m_map.m_impl_offset.m_stride.S1 ]; + } - template< typename I0 , typename I1 , typename I2 - , class ... Args > - KOKKOS_FORCEINLINE_FUNCTION - typename std::enable_if< - ( Kokkos::Impl::are_integral<I0,I1,I2,Args...>::value - && ( 3 == Rank ) - && ! is_default_map - ), reference_type >::type - operator()( const I0 & i0 , const I1 & i1 , const I2 & i2 - , Args ... args ) const - { - KOKKOS_IMPL_VIEW_OPERATOR_VERIFY( (m_track,m_map,i0,i1,i2,args...) ) - return m_map.reference(i0,i1,i2); - } + //------------------------------ + // Rank 3 - //------------------------------ - // Rank 4 + template< typename I0 , typename I1 , typename I2 + , class ... Args > + KOKKOS_FORCEINLINE_FUNCTION + typename std::enable_if< + ( Kokkos::Impl::are_integral<I0,I1,I2,Args...>::value + && ( 3 == Rank ) + && is_default_map + ), reference_type >::type + operator()( const I0 & i0 , const I1 & i1 , const I2 & i2 + , Args ... args ) const + { + KOKKOS_IMPL_VIEW_OPERATOR_VERIFY( (m_track,m_map,i0,i1,i2,args...) ) + return m_map.m_impl_handle[ m_map.m_impl_offset(i0,i1,i2) ]; + } - template< typename I0 , typename I1 , typename I2 , typename I3 - , class ... Args > - KOKKOS_FORCEINLINE_FUNCTION - typename std::enable_if< - ( Kokkos::Impl::are_integral<I0,I1,I2,I3,Args...>::value - && ( 4 == Rank ) - && is_default_map - ), reference_type >::type - operator()( const I0 & i0 , const I1 & i1 , const I2 & i2 , const I3 & i3 - , Args ... args ) const - { - KOKKOS_IMPL_VIEW_OPERATOR_VERIFY( (m_track,m_map,i0,i1,i2,i3,args...) ) - return m_map.m_handle[ m_map.m_offset(i0,i1,i2,i3) ]; - } + template< typename I0 , typename I1 , typename I2 + , class ... Args > + KOKKOS_FORCEINLINE_FUNCTION + typename std::enable_if< + ( Kokkos::Impl::are_integral<I0,I1,I2,Args...>::value + && ( 3 == Rank ) + && ! is_default_map + ), reference_type >::type + operator()( const I0 & i0 , const I1 & i1 , const I2 & i2 + , Args ... args ) const + { + KOKKOS_IMPL_VIEW_OPERATOR_VERIFY( (m_track,m_map,i0,i1,i2,args...) ) + return m_map.reference(i0,i1,i2); + } - template< typename I0 , typename I1 , typename I2 , typename I3 - , class ... Args > - KOKKOS_FORCEINLINE_FUNCTION - typename std::enable_if< - ( Kokkos::Impl::are_integral<I0,I1,I2,I3,Args...>::value - && ( 4 == Rank ) - && ! is_default_map - ), reference_type >::type - operator()( const I0 & i0 , const I1 & i1 , const I2 & i2 , const I3 & i3 - , Args ... args ) const - { - KOKKOS_IMPL_VIEW_OPERATOR_VERIFY( (m_track,m_map,i0,i1,i2,i3,args...) ) - return m_map.reference(i0,i1,i2,i3); - } + //------------------------------ + // Rank 4 - //------------------------------ - // Rank 5 + template< typename I0 , typename I1 , typename I2 , typename I3 + , class ... Args > + KOKKOS_FORCEINLINE_FUNCTION + typename std::enable_if< + ( Kokkos::Impl::are_integral<I0,I1,I2,I3,Args...>::value + && ( 4 == Rank ) + && is_default_map + ), reference_type >::type + operator()( const I0 & i0 , const I1 & i1 , const I2 & i2 , const I3 & i3 + , Args ... args ) const + { + KOKKOS_IMPL_VIEW_OPERATOR_VERIFY( (m_track,m_map,i0,i1,i2,i3,args...) ) + return m_map.m_impl_handle[ m_map.m_impl_offset(i0,i1,i2,i3) ]; + } - template< typename I0 , typename I1 , typename I2 , typename I3 - , typename I4 - , class ... Args > - KOKKOS_FORCEINLINE_FUNCTION - typename std::enable_if< - ( Kokkos::Impl::are_integral<I0,I1,I2,I3,I4,Args...>::value - && ( 5 == Rank ) - && is_default_map - ), reference_type >::type - operator()( const I0 & i0 , const I1 & i1 , const I2 & i2 , const I3 & i3 - , const I4 & i4 - , Args ... args ) const - { - KOKKOS_IMPL_VIEW_OPERATOR_VERIFY( (m_track,m_map,i0,i1,i2,i3,i4,args...) ) - return m_map.m_handle[ m_map.m_offset(i0,i1,i2,i3,i4) ]; - } + template< typename I0 , typename I1 , typename I2 , typename I3 + , class ... Args > + KOKKOS_FORCEINLINE_FUNCTION + typename std::enable_if< + ( Kokkos::Impl::are_integral<I0,I1,I2,I3,Args...>::value + && ( 4 == Rank ) + && ! is_default_map + ), reference_type >::type + operator()( const I0 & i0 , const I1 & i1 , const I2 & i2 , const I3 & i3 + , Args ... args ) const + { + KOKKOS_IMPL_VIEW_OPERATOR_VERIFY( (m_track,m_map,i0,i1,i2,i3,args...) ) + return m_map.reference(i0,i1,i2,i3); + } - template< typename I0 , typename I1 , typename I2 , typename I3 - , typename I4 - , class ... Args > - KOKKOS_FORCEINLINE_FUNCTION - typename std::enable_if< - ( Kokkos::Impl::are_integral<I0,I1,I2,I3,I4,Args...>::value - && ( 5 == Rank ) - && ! is_default_map - ), reference_type >::type - operator()( const I0 & i0 , const I1 & i1 , const I2 & i2 , const I3 & i3 - , const I4 & i4 - , Args ... args ) const - { - KOKKOS_IMPL_VIEW_OPERATOR_VERIFY( (m_track,m_map,i0,i1,i2,i3,i4,args...) ) - return m_map.reference(i0,i1,i2,i3,i4); - } + //------------------------------ + // Rank 5 - //------------------------------ - // Rank 6 + template< typename I0 , typename I1 , typename I2 , typename I3 + , typename I4 + , class ... Args > + KOKKOS_FORCEINLINE_FUNCTION + typename std::enable_if< + ( Kokkos::Impl::are_integral<I0,I1,I2,I3,I4,Args...>::value + && ( 5 == Rank ) + && is_default_map + ), reference_type >::type + operator()( const I0 & i0 , const I1 & i1 , const I2 & i2 , const I3 & i3 + , const I4 & i4 + , Args ... args ) const + { + KOKKOS_IMPL_VIEW_OPERATOR_VERIFY( (m_track,m_map,i0,i1,i2,i3,i4,args...) ) + return m_map.m_impl_handle[ m_map.m_impl_offset(i0,i1,i2,i3,i4) ]; + } - template< typename I0 , typename I1 , typename I2 , typename I3 - , typename I4 , typename I5 - , class ... Args > - KOKKOS_FORCEINLINE_FUNCTION - typename std::enable_if< - ( Kokkos::Impl::are_integral<I0,I1,I2,I3,I4,I5,Args...>::value - && ( 6 == Rank ) - && is_default_map - ), reference_type >::type - operator()( const I0 & i0 , const I1 & i1 , const I2 & i2 , const I3 & i3 - , const I4 & i4 , const I5 & i5 - , Args ... args ) const - { - KOKKOS_IMPL_VIEW_OPERATOR_VERIFY( (m_track,m_map,i0,i1,i2,i3,i4,i5,args...) ) - return m_map.m_handle[ m_map.m_offset(i0,i1,i2,i3,i4,i5) ]; - } + template< typename I0 , typename I1 , typename I2 , typename I3 + , typename I4 + , class ... Args > + KOKKOS_FORCEINLINE_FUNCTION + typename std::enable_if< + ( Kokkos::Impl::are_integral<I0,I1,I2,I3,I4,Args...>::value + && ( 5 == Rank ) + && ! is_default_map + ), reference_type >::type + operator()( const I0 & i0 , const I1 & i1 , const I2 & i2 , const I3 & i3 + , const I4 & i4 + , Args ... args ) const + { + KOKKOS_IMPL_VIEW_OPERATOR_VERIFY( (m_track,m_map,i0,i1,i2,i3,i4,args...) ) + return m_map.reference(i0,i1,i2,i3,i4); + } - template< typename I0 , typename I1 , typename I2 , typename I3 - , typename I4 , typename I5 - , class ... Args > - KOKKOS_FORCEINLINE_FUNCTION - typename std::enable_if< - ( Kokkos::Impl::are_integral<I0,I1,I2,I3,I4,I5,Args...>::value - && ( 6 == Rank ) - && ! is_default_map - ), reference_type >::type - operator()( const I0 & i0 , const I1 & i1 , const I2 & i2 , const I3 & i3 - , const I4 & i4 , const I5 & i5 - , Args ... args ) const - { - KOKKOS_IMPL_VIEW_OPERATOR_VERIFY( (m_track,m_map,i0,i1,i2,i3,i4,i5,args...) ) - return m_map.reference(i0,i1,i2,i3,i4,i5); - } + //------------------------------ + // Rank 6 - //------------------------------ - // Rank 7 + template< typename I0 , typename I1 , typename I2 , typename I3 + , typename I4 , typename I5 + , class ... Args > + KOKKOS_FORCEINLINE_FUNCTION + typename std::enable_if< + ( Kokkos::Impl::are_integral<I0,I1,I2,I3,I4,I5,Args...>::value + && ( 6 == Rank ) + && is_default_map + ), reference_type >::type + operator()( const I0 & i0 , const I1 & i1 , const I2 & i2 , const I3 & i3 + , const I4 & i4 , const I5 & i5 + , Args ... args ) const + { + KOKKOS_IMPL_VIEW_OPERATOR_VERIFY( (m_track,m_map,i0,i1,i2,i3,i4,i5,args...) ) + return m_map.m_impl_handle[ m_map.m_impl_offset(i0,i1,i2,i3,i4,i5) ]; + } - template< typename I0 , typename I1 , typename I2 , typename I3 - , typename I4 , typename I5 , typename I6 - , class ... Args > - KOKKOS_FORCEINLINE_FUNCTION - typename std::enable_if< - ( Kokkos::Impl::are_integral<I0,I1,I2,I3,I4,I5,I6,Args...>::value - && ( 7 == Rank ) - && is_default_map - ), reference_type >::type - operator()( const I0 & i0 , const I1 & i1 , const I2 & i2 , const I3 & i3 - , const I4 & i4 , const I5 & i5 , const I6 & i6 - , Args ... args ) const - { - KOKKOS_IMPL_VIEW_OPERATOR_VERIFY( (m_track,m_map,i0,i1,i2,i3,i4,i5,i6,args...) ) - return m_map.m_handle[ m_map.m_offset(i0,i1,i2,i3,i4,i5,i6) ]; - } + template< typename I0 , typename I1 , typename I2 , typename I3 + , typename I4 , typename I5 + , class ... Args > + KOKKOS_FORCEINLINE_FUNCTION + typename std::enable_if< + ( Kokkos::Impl::are_integral<I0,I1,I2,I3,I4,I5,Args...>::value + && ( 6 == Rank ) + && ! is_default_map + ), reference_type >::type + operator()( const I0 & i0 , const I1 & i1 , const I2 & i2 , const I3 & i3 + , const I4 & i4 , const I5 & i5 + , Args ... args ) const + { + KOKKOS_IMPL_VIEW_OPERATOR_VERIFY( (m_track,m_map,i0,i1,i2,i3,i4,i5,args...) ) + return m_map.reference(i0,i1,i2,i3,i4,i5); + } - template< typename I0 , typename I1 , typename I2 , typename I3 - , typename I4 , typename I5 , typename I6 - , class ... Args > - KOKKOS_FORCEINLINE_FUNCTION - typename std::enable_if< - ( Kokkos::Impl::are_integral<I0,I1,I2,I3,I4,I5,I6,Args...>::value - && ( 7 == Rank ) - && ! is_default_map - ), reference_type >::type - operator()( const I0 & i0 , const I1 & i1 , const I2 & i2 , const I3 & i3 - , const I4 & i4 , const I5 & i5 , const I6 & i6 - , Args ... args ) const - { - KOKKOS_IMPL_VIEW_OPERATOR_VERIFY( (m_track,m_map,i0,i1,i2,i3,i4,i5,i6,args...) ) - return m_map.reference(i0,i1,i2,i3,i4,i5,i6); - } + //------------------------------ + // Rank 7 - //------------------------------ - // Rank 8 + template< typename I0 , typename I1 , typename I2 , typename I3 + , typename I4 , typename I5 , typename I6 + , class ... Args > + KOKKOS_FORCEINLINE_FUNCTION + typename std::enable_if< + ( Kokkos::Impl::are_integral<I0,I1,I2,I3,I4,I5,I6,Args...>::value + && ( 7 == Rank ) + && is_default_map + ), reference_type >::type + operator()( const I0 & i0 , const I1 & i1 , const I2 & i2 , const I3 & i3 + , const I4 & i4 , const I5 & i5 , const I6 & i6 + , Args ... args ) const + { + KOKKOS_IMPL_VIEW_OPERATOR_VERIFY( (m_track,m_map,i0,i1,i2,i3,i4,i5,i6,args...) ) + return m_map.m_impl_handle[ m_map.m_impl_offset(i0,i1,i2,i3,i4,i5,i6) ]; + } - template< typename I0 , typename I1 , typename I2 , typename I3 - , typename I4 , typename I5 , typename I6 , typename I7 - , class ... Args > - KOKKOS_FORCEINLINE_FUNCTION - typename std::enable_if< - ( Kokkos::Impl::are_integral<I0,I1,I2,I3,I4,I5,I6,I7,Args...>::value - && ( 8 == Rank ) - && is_default_map - ), reference_type >::type - operator()( const I0 & i0 , const I1 & i1 , const I2 & i2 , const I3 & i3 - , const I4 & i4 , const I5 & i5 , const I6 & i6 , const I7 & i7 - , Args ... args ) const - { - KOKKOS_IMPL_VIEW_OPERATOR_VERIFY( (m_track,m_map,i0,i1,i2,i3,i4,i5,i6,i7,args...) ) - return m_map.m_handle[ m_map.m_offset(i0,i1,i2,i3,i4,i5,i6,i7) ]; - } + template< typename I0 , typename I1 , typename I2 , typename I3 + , typename I4 , typename I5 , typename I6 + , class ... Args > + KOKKOS_FORCEINLINE_FUNCTION + typename std::enable_if< + ( Kokkos::Impl::are_integral<I0,I1,I2,I3,I4,I5,I6,Args...>::value + && ( 7 == Rank ) + && ! is_default_map + ), reference_type >::type + operator()( const I0 & i0 , const I1 & i1 , const I2 & i2 , const I3 & i3 + , const I4 & i4 , const I5 & i5 , const I6 & i6 + , Args ... args ) const + { + KOKKOS_IMPL_VIEW_OPERATOR_VERIFY( (m_track,m_map,i0,i1,i2,i3,i4,i5,i6,args...) ) + return m_map.reference(i0,i1,i2,i3,i4,i5,i6); + } - template< typename I0 , typename I1 , typename I2 , typename I3 - , typename I4 , typename I5 , typename I6 , typename I7 - , class ... Args > - KOKKOS_FORCEINLINE_FUNCTION - typename std::enable_if< - ( Kokkos::Impl::are_integral<I0,I1,I2,I3,I4,I5,I6,I7,Args...>::value - && ( 8 == Rank ) - && ! is_default_map - ), reference_type >::type - operator()( const I0 & i0 , const I1 & i1 , const I2 & i2 , const I3 & i3 - , const I4 & i4 , const I5 & i5 , const I6 & i6 , const I7 & i7 - , Args ... args ) const - { - KOKKOS_IMPL_VIEW_OPERATOR_VERIFY( (m_track,m_map,i0,i1,i2,i3,i4,i5,i6,i7,args...) ) - return m_map.reference(i0,i1,i2,i3,i4,i5,i6,i7); - } + //------------------------------ + // Rank 8 + + template< typename I0 , typename I1 , typename I2 , typename I3 + , typename I4 , typename I5 , typename I6 , typename I7 + , class ... Args > + KOKKOS_FORCEINLINE_FUNCTION + typename std::enable_if< + ( Kokkos::Impl::are_integral<I0,I1,I2,I3,I4,I5,I6,I7,Args...>::value + && ( 8 == Rank ) + && is_default_map + ), reference_type >::type + operator()( const I0 & i0 , const I1 & i1 , const I2 & i2 , const I3 & i3 + , const I4 & i4 , const I5 & i5 , const I6 & i6 , const I7 & i7 + , Args ... args ) const + { + KOKKOS_IMPL_VIEW_OPERATOR_VERIFY( (m_track,m_map,i0,i1,i2,i3,i4,i5,i6,i7,args...) ) + return m_map.m_impl_handle[ m_map.m_impl_offset(i0,i1,i2,i3,i4,i5,i6,i7) ]; + } + + template< typename I0 , typename I1 , typename I2 , typename I3 + , typename I4 , typename I5 , typename I6 , typename I7 + , class ... Args > + KOKKOS_FORCEINLINE_FUNCTION + typename std::enable_if< + ( Kokkos::Impl::are_integral<I0,I1,I2,I3,I4,I5,I6,I7,Args...>::value + && ( 8 == Rank ) + && ! is_default_map + ), reference_type >::type + operator()( const I0 & i0 , const I1 & i1 , const I2 & i2 , const I3 & i3 + , const I4 & i4 , const I5 & i5 , const I6 & i6 , const I7 & i7 + , Args ... args ) const + { + KOKKOS_IMPL_VIEW_OPERATOR_VERIFY( (m_track,m_map,i0,i1,i2,i3,i4,i5,i6,i7,args...) ) + return m_map.reference(i0,i1,i2,i3,i4,i5,i6,i7); + } - #else + #else //------------------------------ // Rank 0 operator() @@ -1206,7 +1211,7 @@ public: operator()( const I0 & i0 ) const { KOKKOS_IMPL_VIEW_OPERATOR_VERIFY( (m_track,m_map,i0) ) - return m_map.m_handle[ i0 ]; + return m_map.m_impl_handle[ i0 ]; } template< typename I0 > @@ -1220,7 +1225,7 @@ public: operator()( const I0 & i0) const { KOKKOS_IMPL_VIEW_OPERATOR_VERIFY( (m_track,m_map,i0) ) - return m_map.m_handle[ m_map.m_offset.m_stride.S0 * i0 ]; + return m_map.m_impl_handle[ m_map.m_impl_offset.m_stride.S0 * i0 ]; } //------------------------------ // Rank 1 operator[] @@ -1249,7 +1254,7 @@ public: operator[]( const I0 & i0 ) const { KOKKOS_IMPL_VIEW_OPERATOR_VERIFY( (m_track,m_map,i0) ) - return m_map.m_handle[ i0 ]; + return m_map.m_impl_handle[ i0 ]; } template< typename I0 > @@ -1263,7 +1268,7 @@ public: operator[]( const I0 & i0 ) const { KOKKOS_IMPL_VIEW_OPERATOR_VERIFY( (m_track,m_map,i0) ) - return m_map.m_handle[ m_map.m_offset.m_stride.S0 * i0 ]; + return m_map.m_impl_handle[ m_map.m_impl_offset.m_stride.S0 * i0 ]; } @@ -1294,7 +1299,7 @@ public: operator()( const I0 & i0 , const I1 & i1) const { KOKKOS_IMPL_VIEW_OPERATOR_VERIFY( (m_track,m_map,i0,i1) ) - return m_map.m_handle[ i0 + m_map.m_offset.m_dim.N0 * i1 ]; + return m_map.m_impl_handle[ i0 + m_map.m_impl_offset.m_dim.N0 * i1 ]; } template< typename I0 , typename I1> @@ -1308,7 +1313,7 @@ public: operator()( const I0 & i0 , const I1 & i1) const { KOKKOS_IMPL_VIEW_OPERATOR_VERIFY( (m_track,m_map,i0,i1) ) - return m_map.m_handle[ i0 + m_map.m_offset.m_stride * i1 ]; + return m_map.m_impl_handle[ i0 + m_map.m_impl_offset.m_stride * i1 ]; } template< typename I0 , typename I1 > @@ -1322,7 +1327,7 @@ public: operator()( const I0 & i0 , const I1 & i1 ) const { KOKKOS_IMPL_VIEW_OPERATOR_VERIFY( (m_track,m_map,i0,i1) ) - return m_map.m_handle[ i1 + m_map.m_offset.m_dim.N1 * i0 ]; + return m_map.m_impl_handle[ i1 + m_map.m_impl_offset.m_dim.N1 * i0 ]; } template< typename I0 , typename I1 > @@ -1336,7 +1341,7 @@ public: operator()( const I0 & i0 , const I1 & i1 ) const { KOKKOS_IMPL_VIEW_OPERATOR_VERIFY( (m_track,m_map,i0,i1) ) - return m_map.m_handle[ i1 + m_map.m_offset.m_stride * i0 ]; + return m_map.m_impl_handle[ i1 + m_map.m_impl_offset.m_stride * i0 ]; } template< typename I0 , typename I1> @@ -1350,8 +1355,8 @@ public: operator()( const I0 & i0 , const I1 & i1 ) const { KOKKOS_IMPL_VIEW_OPERATOR_VERIFY( (m_track,m_map,i0,i1) ) - return m_map.m_handle[ i0 * m_map.m_offset.m_stride.S0 + - i1 * m_map.m_offset.m_stride.S1 ]; + return m_map.m_impl_handle[ i0 * m_map.m_impl_offset.m_stride.S0 + + i1 * m_map.m_impl_offset.m_stride.S1 ]; } //------------------------------ @@ -1367,7 +1372,7 @@ public: operator()( const I0 & i0 , const I1 & i1 , const I2 & i2) const { KOKKOS_IMPL_VIEW_OPERATOR_VERIFY( (m_track,m_map,i0,i1,i2) ) - return m_map.m_handle[ m_map.m_offset(i0,i1,i2) ]; + return m_map.m_impl_handle[ m_map.m_impl_offset(i0,i1,i2) ]; } template< typename I0 , typename I1 , typename I2> @@ -1396,7 +1401,7 @@ public: operator()( const I0 & i0 , const I1 & i1 , const I2 & i2 , const I3 & i3) const { KOKKOS_IMPL_VIEW_OPERATOR_VERIFY( (m_track,m_map,i0,i1,i2,i3) ) - return m_map.m_handle[ m_map.m_offset(i0,i1,i2,i3) ]; + return m_map.m_impl_handle[ m_map.m_impl_offset(i0,i1,i2,i3) ]; } template< typename I0 , typename I1 , typename I2 , typename I3 > @@ -1427,7 +1432,7 @@ public: , const I4 & i4 ) const { KOKKOS_IMPL_VIEW_OPERATOR_VERIFY( (m_track,m_map,i0,i1,i2,i3,i4) ) - return m_map.m_handle[ m_map.m_offset(i0,i1,i2,i3,i4) ]; + return m_map.m_impl_handle[ m_map.m_impl_offset(i0,i1,i2,i3,i4) ]; } template< typename I0 , typename I1 , typename I2 , typename I3 @@ -1460,7 +1465,7 @@ public: , const I4 & i4 , const I5 & i5 ) const { KOKKOS_IMPL_VIEW_OPERATOR_VERIFY( (m_track,m_map,i0,i1,i2,i3,i4,i5) ) - return m_map.m_handle[ m_map.m_offset(i0,i1,i2,i3,i4,i5) ]; + return m_map.m_impl_handle[ m_map.m_impl_offset(i0,i1,i2,i3,i4,i5) ]; } template< typename I0 , typename I1 , typename I2 , typename I3 @@ -1493,7 +1498,7 @@ public: , const I4 & i4 , const I5 & i5 , const I6 & i6) const { KOKKOS_IMPL_VIEW_OPERATOR_VERIFY( (m_track,m_map,i0,i1,i2,i3,i4,i5,i6) ) - return m_map.m_handle[ m_map.m_offset(i0,i1,i2,i3,i4,i5,i6) ]; + return m_map.m_impl_handle[ m_map.m_impl_offset(i0,i1,i2,i3,i4,i5,i6) ]; } template< typename I0 , typename I1 , typename I2 , typename I3 @@ -1526,7 +1531,7 @@ public: , const I4 & i4 , const I5 & i5 , const I6 & i6 , const I7 & i7) const { KOKKOS_IMPL_VIEW_OPERATOR_VERIFY( (m_track,m_map,i0,i1,i2,i3,i4,i5,i6,i7) ) - return m_map.m_handle[ m_map.m_offset(i0,i1,i2,i3,i4,i5,i6,i7) ]; + return m_map.m_impl_handle[ m_map.m_impl_offset(i0,i1,i2,i3,i4,i5,i6,i7) ]; } template< typename I0 , typename I1 , typename I2 , typename I3 @@ -1545,7 +1550,6 @@ public: } #endif - template< class ... Args > KOKKOS_FORCEINLINE_FUNCTION typename std::enable_if<( Kokkos::Impl::are_integral<Args...>::value @@ -1585,7 +1589,7 @@ public: , Args ... args ) const { KOKKOS_IMPL_VIEW_OPERATOR_VERIFY( (m_track,m_map,i0,args...) ) - return m_map.m_handle[ i0 ]; + return m_map.m_impl_handle[ i0 ]; } template< typename I0 @@ -1601,7 +1605,7 @@ public: , Args ... args ) const { KOKKOS_IMPL_VIEW_OPERATOR_VERIFY( (m_track,m_map,i0,args...) ) - return m_map.m_handle[ m_map.m_offset.m_stride.S0 * i0 ]; + return m_map.m_impl_handle[ m_map.m_impl_offset.m_stride.S0 * i0 ]; } template< typename I0 , typename I1 @@ -1632,7 +1636,7 @@ public: , Args ... args ) const { KOKKOS_IMPL_VIEW_OPERATOR_VERIFY( (m_track,m_map,i0,i1,args...) ) - return m_map.m_handle[ i0 + m_map.m_offset.m_dim.N0 * i1 ]; + return m_map.m_impl_handle[ i0 + m_map.m_impl_offset.m_dim.N0 * i1 ]; } template< typename I0 , typename I1 @@ -1648,7 +1652,7 @@ public: , Args ... args ) const { KOKKOS_IMPL_VIEW_OPERATOR_VERIFY( (m_track,m_map,i0,i1,args...) ) - return m_map.m_handle[ i0 + m_map.m_offset.m_stride * i1 ]; + return m_map.m_impl_handle[ i0 + m_map.m_impl_offset.m_stride * i1 ]; } template< typename I0 , typename I1 @@ -1664,7 +1668,7 @@ public: , Args ... args ) const { KOKKOS_IMPL_VIEW_OPERATOR_VERIFY( (m_track,m_map,i0,i1,args...) ) - return m_map.m_handle[ i1 + m_map.m_offset.m_dim.N1 * i0 ]; + return m_map.m_impl_handle[ i1 + m_map.m_impl_offset.m_dim.N1 * i0 ]; } template< typename I0 , typename I1 @@ -1680,7 +1684,7 @@ public: , Args ... args ) const { KOKKOS_IMPL_VIEW_OPERATOR_VERIFY( (m_track,m_map,i0,i1,args...) ) - return m_map.m_handle[ i1 + m_map.m_offset.m_stride * i0 ]; + return m_map.m_impl_handle[ i1 + m_map.m_impl_offset.m_stride * i0 ]; } template< typename I0 , typename I1 @@ -1696,8 +1700,8 @@ public: , Args ... args ) const { KOKKOS_IMPL_VIEW_OPERATOR_VERIFY( (m_track,m_map,i0,i1,args...) ) - return m_map.m_handle[ i0 * m_map.m_offset.m_stride.S0 + - i1 * m_map.m_offset.m_stride.S1 ]; + return m_map.m_impl_handle[ i0 * m_map.m_impl_offset.m_stride.S0 + + i1 * m_map.m_impl_offset.m_stride.S1 ]; } //------------------------------ @@ -1715,7 +1719,7 @@ public: , Args ... args ) const { KOKKOS_IMPL_VIEW_OPERATOR_VERIFY( (m_track,m_map,i0,i1,i2,args...) ) - return m_map.m_handle[ m_map.m_offset(i0,i1,i2) ]; + return m_map.m_impl_handle[ m_map.m_impl_offset(i0,i1,i2) ]; } template< typename I0 , typename I1 , typename I2 @@ -1748,7 +1752,7 @@ public: , Args ... args ) const { KOKKOS_IMPL_VIEW_OPERATOR_VERIFY( (m_track,m_map,i0,i1,i2,i3,args...) ) - return m_map.m_handle[ m_map.m_offset(i0,i1,i2,i3) ]; + return m_map.m_impl_handle[ m_map.m_impl_offset(i0,i1,i2,i3) ]; } template< typename I0 , typename I1 , typename I2 , typename I3 @@ -1783,7 +1787,7 @@ public: , Args ... args ) const { KOKKOS_IMPL_VIEW_OPERATOR_VERIFY( (m_track,m_map,i0,i1,i2,i3,i4,args...) ) - return m_map.m_handle[ m_map.m_offset(i0,i1,i2,i3,i4) ]; + return m_map.m_impl_handle[ m_map.m_impl_offset(i0,i1,i2,i3,i4) ]; } template< typename I0 , typename I1 , typename I2 , typename I3 @@ -1820,7 +1824,7 @@ public: , Args ... args ) const { KOKKOS_IMPL_VIEW_OPERATOR_VERIFY( (m_track,m_map,i0,i1,i2,i3,i4,i5,args...) ) - return m_map.m_handle[ m_map.m_offset(i0,i1,i2,i3,i4,i5) ]; + return m_map.m_impl_handle[ m_map.m_impl_offset(i0,i1,i2,i3,i4,i5) ]; } template< typename I0 , typename I1 , typename I2 , typename I3 @@ -1857,7 +1861,7 @@ public: , Args ... args ) const { KOKKOS_IMPL_VIEW_OPERATOR_VERIFY( (m_track,m_map,i0,i1,i2,i3,i4,i5,i6,args...) ) - return m_map.m_handle[ m_map.m_offset(i0,i1,i2,i3,i4,i5,i6) ]; + return m_map.m_impl_handle[ m_map.m_impl_offset(i0,i1,i2,i3,i4,i5,i6) ]; } template< typename I0 , typename I1 , typename I2 , typename I3 @@ -1894,7 +1898,7 @@ public: , Args ... args ) const { KOKKOS_IMPL_VIEW_OPERATOR_VERIFY( (m_track,m_map,i0,i1,i2,i3,i4,i5,i6,i7,args...) ) - return m_map.m_handle[ m_map.m_offset(i0,i1,i2,i3,i4,i5,i6,i7) ]; + return m_map.m_impl_handle[ m_map.m_impl_offset(i0,i1,i2,i3,i4,i5,i6,i7) ]; } template< typename I0 , typename I1 , typename I2 , typename I3 @@ -1938,6 +1942,8 @@ public: KOKKOS_INLINE_FUNCTION View & operator = ( View && rhs ) { m_track = std::move(rhs.m_track) ; m_map = std::move(rhs.m_map) ; return *this ; } + + //---------------------------------------- // Compatible view copy constructor and assignment // may assign unmanaged from managed. @@ -2206,7 +2212,8 @@ public: , arg_N4 , arg_N5 , arg_N6 , arg_N7 ) ) { - + static_assert ( traits::array_layout::is_extent_constructible , "Layout is not extent constructible. A layout object should be passed too.\n" ); + #ifdef KOKKOS_ACTIVE_EXECUTION_MEMORY_SPACE_HOST Impl::runtime_check_rank_host(traits::rank_dynamic, std::is_same<typename traits::specialize,void>::value, arg_N0, arg_N1, arg_N2, arg_N3, arg_N4, arg_N5, arg_N6, arg_N7, label()); @@ -2257,6 +2264,15 @@ public: #endif } + template <class Traits> + KOKKOS_INLINE_FUNCTION + View( const track_type & track, const Kokkos::Impl::ViewMapping< Traits , void > &map ) : + m_track(track), m_map() + { + typedef Kokkos::Impl::ViewMapping< traits , Traits , void > Mapping ; + static_assert( Mapping::is_assignable , "Incompatible View copy construction" ); + Mapping::assign( m_map , map , track ); + } //---------------------------------------- // Memory span required to wrap these dimensions. @@ -2346,7 +2362,7 @@ public: static inline size_t shmem_size( typename traits::array_layout const& arg_layout ) { - return map_type::memory_span( arg_layout ); + return map_type::memory_span( arg_layout )+sizeof(typename traits::value_type); } explicit KOKKOS_INLINE_FUNCTION @@ -2354,7 +2370,7 @@ public: , const typename traits::array_layout & arg_layout ) : View( Impl::ViewCtorProp<pointer_type>( reinterpret_cast<pointer_type>( - arg_space.get_shmem( map_type::memory_span( arg_layout ) ) ) ) + arg_space.get_shmem_aligned( map_type::memory_span( arg_layout ), sizeof(typename traits::value_type) ) ) ) , arg_layout ) {} @@ -2370,11 +2386,11 @@ public: , const size_t arg_N7 = KOKKOS_IMPL_CTOR_DEFAULT_ARG ) : View( Impl::ViewCtorProp<pointer_type>( reinterpret_cast<pointer_type>( - arg_space.get_shmem( + arg_space.get_shmem_aligned( map_type::memory_span( typename traits::array_layout ( arg_N0 , arg_N1 , arg_N2 , arg_N3 - , arg_N4 , arg_N5 , arg_N6 , arg_N7 ) ) ) ) ) + , arg_N4 , arg_N5 , arg_N6 , arg_N7 ) ), sizeof(typename traits::value_type) ) ) ) , typename traits::array_layout ( arg_N0 , arg_N1 , arg_N2 , arg_N3 , arg_N4 , arg_N5 , arg_N6 , arg_N7 ) @@ -2515,209 +2531,6 @@ void shared_allocation_tracking_enable() } /* namespace Impl */ } /* namespace Kokkos */ -//---------------------------------------------------------------------------- -//---------------------------------------------------------------------------- - -//---------------------------------------------------------------------------- -//---------------------------------------------------------------------------- - -namespace Kokkos { -namespace Impl { - -// Deduce Mirror Types -template<class Space, class T, class ... P> -struct MirrorViewType { - // The incoming view_type - typedef typename Kokkos::View<T,P...> src_view_type; - // The memory space for the mirror view - typedef typename Space::memory_space memory_space; - // Check whether it is the same memory space - enum { is_same_memspace = std::is_same<memory_space,typename src_view_type::memory_space>::value }; - // The array_layout - typedef typename src_view_type::array_layout array_layout; - // The data type (we probably want it non-const since otherwise we can't even deep_copy to it. - typedef typename src_view_type::non_const_data_type data_type; - // The destination view type if it is not the same memory space - typedef Kokkos::View<data_type,array_layout,Space> dest_view_type; - // If it is the same memory_space return the existsing view_type - // This will also keep the unmanaged trait if necessary - typedef typename std::conditional<is_same_memspace,src_view_type,dest_view_type>::type view_type; -}; - -template<class Space, class T, class ... P> -struct MirrorType { - // The incoming view_type - typedef typename Kokkos::View<T,P...> src_view_type; - // The memory space for the mirror view - typedef typename Space::memory_space memory_space; - // Check whether it is the same memory space - enum { is_same_memspace = std::is_same<memory_space,typename src_view_type::memory_space>::value }; - // The array_layout - typedef typename src_view_type::array_layout array_layout; - // The data type (we probably want it non-const since otherwise we can't even deep_copy to it. - typedef typename src_view_type::non_const_data_type data_type; - // The destination view type if it is not the same memory space - typedef Kokkos::View<data_type,array_layout,Space> view_type; -}; - -} - -template< class T , class ... P > -inline -typename Kokkos::View<T,P...>::HostMirror -create_mirror( const Kokkos::View<T,P...> & src - , typename std::enable_if< - ! std::is_same< typename Kokkos::ViewTraits<T,P...>::array_layout - , Kokkos::LayoutStride >::value - >::type * = 0 - ) -{ - typedef View<T,P...> src_type ; - typedef typename src_type::HostMirror dst_type ; - - return dst_type( std::string( src.label() ).append("_mirror") -#ifdef KOKKOS_ENABLE_DEPRECATED_CODE - , src.extent(0) - , src.extent(1) - , src.extent(2) - , src.extent(3) - , src.extent(4) - , src.extent(5) - , src.extent(6) - , src.extent(7) ); -#else - , 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 ); -#endif -} - -template< class T , class ... P > -inline -typename Kokkos::View<T,P...>::HostMirror -create_mirror( const Kokkos::View<T,P...> & src - , typename std::enable_if< - std::is_same< typename Kokkos::ViewTraits<T,P...>::array_layout - , Kokkos::LayoutStride >::value - >::type * = 0 - ) -{ - typedef View<T,P...> src_type ; - typedef typename src_type::HostMirror dst_type ; - - 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(); - - return dst_type( std::string( src.label() ).append("_mirror") , layout ); -} - - -// Create a mirror in a new space (specialization for different space) -template<class Space, class T, class ... P> -typename Impl::MirrorType<Space,T,P ...>::view_type create_mirror(const Space& , const Kokkos::View<T,P...> & src) { - return typename Impl::MirrorType<Space,T,P ...>::view_type(src.label(),src.layout()); -} - -template< class T , class ... P > -inline -typename Kokkos::View<T,P...>::HostMirror -create_mirror_view( const Kokkos::View<T,P...> & src - , typename std::enable_if<( - std::is_same< typename Kokkos::View<T,P...>::memory_space - , typename Kokkos::View<T,P...>::HostMirror::memory_space - >::value - && - std::is_same< typename Kokkos::View<T,P...>::data_type - , typename Kokkos::View<T,P...>::HostMirror::data_type - >::value - )>::type * = 0 - ) -{ - return src ; -} - -template< class T , class ... P > -inline -typename Kokkos::View<T,P...>::HostMirror -create_mirror_view( const Kokkos::View<T,P...> & src - , typename std::enable_if< ! ( - std::is_same< typename Kokkos::View<T,P...>::memory_space - , typename Kokkos::View<T,P...>::HostMirror::memory_space - >::value - && - std::is_same< typename Kokkos::View<T,P...>::data_type - , typename Kokkos::View<T,P...>::HostMirror::data_type - >::value - )>::type * = 0 - ) -{ - return Kokkos::create_mirror( src ); -} - -// Create a mirror view in a new space (specialization for same space) -template<class Space, class T, class ... P> -typename Impl::MirrorViewType<Space,T,P ...>::view_type -create_mirror_view(const Space& , const Kokkos::View<T,P...> & src - , typename std::enable_if<Impl::MirrorViewType<Space,T,P ...>::is_same_memspace>::type* = 0 ) { - return src; -} - -// Create a mirror view in a new space (specialization for different space) -template<class Space, class T, class ... P> -typename Impl::MirrorViewType<Space,T,P ...>::view_type -create_mirror_view(const Space& , const Kokkos::View<T,P...> & src - , typename std::enable_if<!Impl::MirrorViewType<Space,T,P ...>::is_same_memspace>::type* = 0 ) { - return typename Impl::MirrorViewType<Space,T,P ...>::view_type(src.label(),src.layout()); -} - -// Create a mirror view and deep_copy in a new space (specialization for same space) -template<class Space, class T, class ... P> -typename Impl::MirrorViewType<Space,T,P ...>::view_type -create_mirror_view_and_copy(const Space& , const Kokkos::View<T,P...> & src - , std::string const& name = "" - , typename std::enable_if<Impl::MirrorViewType<Space,T,P ...>::is_same_memspace>::type* = 0 ) { - (void)name; - return src; -} - -// Create a mirror view and deep_copy in a new space (specialization for different space) -template<class Space, class T, class ... P> -typename Impl::MirrorViewType<Space,T,P ...>::view_type -create_mirror_view_and_copy(const Space& , const Kokkos::View<T,P...> & src - , std::string const& name = "" - , typename std::enable_if<!Impl::MirrorViewType<Space,T,P ...>::is_same_memspace>::type* = 0 ) { - using Mirror = typename Impl::MirrorViewType<Space,T,P ...>::view_type; - std::string label = name.empty() ? src.label() : name; - auto mirror = Mirror(ViewAllocateWithoutInitializing(label), src.layout()); - deep_copy(mirror, src); - return mirror; -} - -} /* namespace Kokkos */ - - //---------------------------------------------------------------------------- //---------------------------------------------------------------------------- diff --git a/packages/kokkos/core/src/Makefile b/packages/kokkos/core/src/Makefile index 6ee5fec7165a16af13f3ab687a271d0e92609734..c2dbddf45e98877756c0a86224d85d857ea06538 100644 --- a/packages/kokkos/core/src/Makefile +++ b/packages/kokkos/core/src/Makefile @@ -16,6 +16,7 @@ endif CXXFLAGS ?= -O3 LINK ?= $(CXX) LDFLAGS ?= +CP = cp include $(KOKKOS_PATH)/Makefile.kokkos include $(KOKKOS_PATH)/core/src/Makefile.generate_header_lists @@ -50,7 +51,12 @@ ifeq ($(KOKKOS_OS),Linux) COPY_FLAG = -u endif ifeq ($(KOKKOS_OS),Darwin) - COPY_FLAG = + COPY_FLAG = + # If Homebrew coreutils is installed, its cp will have the -u option + ifneq ("$(wildcard /usr/local/opt/coreutils/libexec/gnubin/cp)","") + CP = /usr/local/opt/coreutils/libexec/gnubin/cp + COPY_FLAG = -u + endif endif ifeq ($(KOKKOS_DEBUG),"no") @@ -66,36 +72,38 @@ mkdir: mkdir -p $(PREFIX)/bin mkdir -p $(PREFIX)/include mkdir -p $(PREFIX)/lib + mkdir -p $(PREFIX)/lib/pkgconfig mkdir -p $(PREFIX)/include/impl copy-cuda: mkdir mkdir -p $(PREFIX)/include/Cuda - cp $(COPY_FLAG) $(KOKKOS_HEADERS_CUDA) $(PREFIX)/include/Cuda + $(CP) $(COPY_FLAG) $(KOKKOS_HEADERS_CUDA) $(PREFIX)/include/Cuda copy-threads: mkdir mkdir -p $(PREFIX)/include/Threads - cp $(COPY_FLAG) $(KOKKOS_HEADERS_THREADS) $(PREFIX)/include/Threads + $(CP) $(COPY_FLAG) $(KOKKOS_HEADERS_THREADS) $(PREFIX)/include/Threads copy-qthreads: mkdir mkdir -p $(PREFIX)/include/Qthreads - cp $(COPY_FLAG) $(KOKKOS_HEADERS_QTHREADS) $(PREFIX)/include/Qthreads + $(CP) $(COPY_FLAG) $(KOKKOS_HEADERS_QTHREADS) $(PREFIX)/include/Qthreads copy-openmp: mkdir mkdir -p $(PREFIX)/include/OpenMP - cp $(COPY_FLAG) $(KOKKOS_HEADERS_OPENMP) $(PREFIX)/include/OpenMP + $(CP) $(COPY_FLAG) $(KOKKOS_HEADERS_OPENMP) $(PREFIX)/include/OpenMP copy-rocm: mkdir mkdir -p $(PREFIX)/include/ROCm - cp $(COPY_FLAG) $(KOKKOS_HEADERS_ROCM) $(PREFIX)/include/ROCm + $(CP) $(COPY_FLAG) $(KOKKOS_HEADERS_ROCM) $(PREFIX)/include/ROCm install: mkdir $(CONDITIONAL_COPIES) build-lib generate_build_settings - cp $(COPY_FLAG) $(NVCC_WRAPPER) $(PREFIX)/bin - cp $(COPY_FLAG) $(KOKKOS_HEADERS_INCLUDE) $(PREFIX)/include - cp $(COPY_FLAG) $(KOKKOS_HEADERS_INCLUDE_IMPL) $(PREFIX)/include/impl - cp $(COPY_FLAG) $(KOKKOS_MAKEFILE) $(PREFIX) - cp $(COPY_FLAG) $(KOKKOS_CMAKEFILE) $(PREFIX) - cp $(COPY_FLAG) libkokkos.a $(PREFIX)/lib - cp $(COPY_FLAG) $(KOKKOS_CONFIG_HEADER) $(PREFIX)/include + $(CP) $(COPY_FLAG) $(NVCC_WRAPPER) $(PREFIX)/bin + $(CP) $(COPY_FLAG) $(KOKKOS_HEADERS_INCLUDE) $(PREFIX)/include + $(CP) $(COPY_FLAG) $(KOKKOS_HEADERS_INCLUDE_IMPL) $(PREFIX)/include/impl + $(CP) $(COPY_FLAG) $(KOKKOS_MAKEFILE) $(PREFIX) + $(CP) $(COPY_FLAG) $(KOKKOS_CMAKEFILE) $(PREFIX) + $(CP) $(COPY_FLAG) $(KOKKOS_PKGCONFIG) $(PREFIX)/lib/pkgconfig + $(CP) $(COPY_FLAG) libkokkos.a $(PREFIX)/lib + $(CP) $(COPY_FLAG) $(KOKKOS_CONFIG_HEADER) $(PREFIX)/include clean: kokkos-clean - rm -f $(KOKKOS_MAKEFILE) $(KOKKOS_CMAKEFILE) + rm -f $(KOKKOS_MAKEFILE) $(KOKKOS_CMAKEFILE) $(KOKKOS_PKGCONFIG) diff --git a/packages/kokkos/core/src/Makefile.generate_build_files b/packages/kokkos/core/src/Makefile.generate_build_files index 7e0c6351fe321c6f1e31d4bde485e32097cd9f32..cc856ee9a328ae1318d225739ee6c5609e03cfe9 100644 --- a/packages/kokkos/core/src/Makefile.generate_build_files +++ b/packages/kokkos/core/src/Makefile.generate_build_files @@ -5,6 +5,7 @@ # These files are generated by this makefile KOKKOS_MAKEFILE=Makefile.kokkos KOKKOS_CMAKEFILE=kokkos_generated_settings.cmake +KOKKOS_PKGCONFIG=kokkos.pc ifeq ($(KOKKOS_DEBUG),"no") KOKKOS_DEBUG_CMAKE = OFF @@ -33,11 +34,29 @@ kokkos_append_var = $(call kokkos_appendvar_makefile,$1); $(call kokkos_appendva kokkos_append_var2 = $(call kokkos_appendvar2_makefile,$1); $(call kokkos_appendvar_cmakefile,$1,$2) kokkos_append_varval = $(call kokkos_appendval_makefile,$1,$2); $(call kokkos_appendval_cmakefile,$1,$2,$3) +kokkos_fixup_sed_impl = sed \ + -e 's|$(KOKKOS_PATH)/core/src|$(PREFIX)/include|g' \ + -e 's|$(KOKKOS_PATH)/containers/src|$(PREFIX)/include|g' \ + -e 's|$(KOKKOS_PATH)/algorithms/src|$(PREFIX)/include|g' \ + -e 's|-L$(PWD)|-L$(PREFIX)/lib|g' \ + -e 's|= libkokkos.a|= $(PREFIX)/lib/libkokkos.a|g' \ + -e 's|= $(KOKKOS_CONFIG_HEADER)|= $(PREFIX)/include/$(KOKKOS_CONFIG_HEADER)|g' $1 \ + > $1.tmp && mv -f $1.tmp $1 + +$(KOKKOS_PKGCONFIG): $(KOKKOS_PATH)/core/src/$(KOKKOS_PKGCONFIG).in + @sed -e 's|@CMAKE_INSTALL_PREFIX@|$(PREFIX)|g' \ + -e 's|@KOKKOS_CXXFLAGS@|$(patsubst -I%,,$(KOKKOS_CXXFLAGS))|g' \ + -e 's|@KOKKOS_EXTRA_LIBS_LIST@|$(KOKKOS_EXTRA_LIBS)|g' \ + -e 's|@KOKKOS_LINK_FLAGS@|$(KOKKOS_LINK_FLAGS)|g' \ + $< > $@ + +kokkos_fixup_sed = $(call kokkos_fixup_sed_impl,$(KOKKOS_MAKEFILE)); $(call kokkos_fixup_sed_impl,$(KOKKOS_CMAKEFILE)) + #This function should be used for variables whose values are different in GNU Make versus CMake, #especially lists which are delimited by commas in one case and semicolons in another kokkos_append_gmakevar = $(call kokkos_appendvar_makefile,$1); $(call kokkos_append_gmakevar_cmakefile,$1,$2) -generate_build_settings: $(KOKKOS_CONFIG_HEADER) +generate_build_settings: $(KOKKOS_CONFIG_HEADER) $(KOKKOS_PKGCONFIG) @rm -f $(KOKKOS_MAKEFILE) @rm -f $(KOKKOS_CMAKEFILE) @$(call kokkos_append_string, "#Global Settings used to generate this library") @@ -68,7 +87,6 @@ generate_build_settings: $(KOKKOS_CONFIG_HEADER) @$(call kokkos_append_var,KOKKOS_HEADERS_ROCM,'STRING "Kokkos headers ROCm list"') @$(call kokkos_append_var,KOKKOS_HEADERS_THREADS,'STRING "Kokkos headers Threads list"') @$(call kokkos_append_var,KOKKOS_HEADERS_QTHREADS,'STRING "Kokkos headers QThreads list"') - @$(call kokkos_append_var,KOKKOS_SRC,'STRING "Kokkos source list"') @$(call kokkos_append_string,"") @$(call kokkos_append_string,"#Variables used in application Makefiles") @$(call kokkos_append_var,KOKKOS_OS,'STRING ""') # This was not in original cmake gen @@ -94,19 +112,11 @@ generate_build_settings: $(KOKKOS_CONFIG_HEADER) @$(call kokkos_append_makefile,"#Fake kokkos-clean target") @$(call kokkos_append_makefile,"kokkos-clean:") @$(call kokkos_append_makefile,"") - @sed \ - -e 's|$(KOKKOS_PATH)/core/src|$(PREFIX)/include|g' \ - -e 's|$(KOKKOS_PATH)/containers/src|$(PREFIX)/include|g' \ - -e 's|$(KOKKOS_PATH)/algorithms/src|$(PREFIX)/include|g' \ - -e 's|-L$(PWD)|-L$(PREFIX)/lib|g' \ - -e 's|= libkokkos.a|= $(PREFIX)/lib/libkokkos.a|g' \ - -e 's|= $(KOKKOS_CONFIG_HEADER)|= $(PREFIX)/include/$(KOKKOS_CONFIG_HEADER)|g' $(KOKKOS_MAKEFILE) \ - > $(KOKKOS_MAKEFILE).tmp - @mv -f $(KOKKOS_MAKEFILE).tmp $(KOKKOS_MAKEFILE) + @$(call kokkos_fixup_sed) + @$(call kokkos_append_var,KOKKOS_SRC,'STRING "Kokkos source list"') @$(call kokkos_setvar_cmakefile,KOKKOS_CXX_FLAGS,$(KOKKOS_CXXFLAGS)) @$(call kokkos_setvar_cmakefile,KOKKOS_CPP_FLAGS,$(KOKKOS_CPPFLAGS)) @$(call kokkos_setvar_cmakefile,KOKKOS_LD_FLAGS,$(KOKKOS_LDFLAGS)) @$(call kokkos_setlist_cmakefile,KOKKOS_LIBS_LIST,$(KOKKOS_LIBS)) @$(call kokkos_setlist_cmakefile,KOKKOS_EXTRA_LIBS_LIST,$(KOKKOS_EXTRA_LIBS)) @$(call kokkos_setvar_cmakefile,KOKKOS_LINK_FLAGS,$(KOKKOS_LINK_FLAGS)) - diff --git a/packages/kokkos/core/src/OpenMP/Kokkos_OpenMP_Task.cpp b/packages/kokkos/core/src/OpenMP/Kokkos_OpenMP_Task.cpp index 351f5f1ec27a0217b7c78272e4c46d6cd38b450d..2f2c7684602ab439144d3199566bbaadf3384117 100644 --- a/packages/kokkos/core/src/OpenMP/Kokkos_OpenMP_Task.cpp +++ b/packages/kokkos/core/src/OpenMP/Kokkos_OpenMP_Task.cpp @@ -103,8 +103,6 @@ public: void TaskQueueSpecialization< Kokkos::OpenMP >::execute ( TaskQueue< Kokkos::OpenMP > * const queue ) { - using execution_space = Kokkos::OpenMP ; - using queue_type = TaskQueue< execution_space > ; using task_root_type = TaskBase< void , void , void > ; using Member = Impl::HostThreadTeamMember< execution_space > ; @@ -213,8 +211,6 @@ void TaskQueueSpecialization< Kokkos::OpenMP >:: iff_single_thread_recursive_execute ( TaskQueue< Kokkos::OpenMP > * const queue ) { - using execution_space = Kokkos::OpenMP ; - using queue_type = TaskQueue< execution_space > ; using task_root_type = TaskBase< void , void , void > ; using Member = Impl::HostThreadTeamMember< execution_space > ; diff --git a/packages/kokkos/core/src/OpenMP/Kokkos_OpenMP_Team.hpp b/packages/kokkos/core/src/OpenMP/Kokkos_OpenMP_Team.hpp index b530dca10faaede77de23b975901cbdc9f4030a2..e8fbc467e095785ff4f7b763eed45709e66786f3 100644 --- a/packages/kokkos/core/src/OpenMP/Kokkos_OpenMP_Team.hpp +++ b/packages/kokkos/core/src/OpenMP/Kokkos_OpenMP_Team.hpp @@ -76,14 +76,11 @@ public: //---------------------------------------- +#ifdef KOKKOS_ENABLE_DEPRECATED_CODE template< class FunctorType > inline static int team_size_max( const FunctorType & ) { -#ifdef KOKKOS_ENABLE_DEPRECATED_CODE int pool_size = traits::execution_space::thread_pool_size(1); -#else - int pool_size = traits::execution_space::impl_thread_pool_size(1); -#endif int max_host_team_size = Impl::HostThreadTeamData::max_team_members; return pool_size<max_host_team_size?pool_size:max_host_team_size; } @@ -92,17 +89,47 @@ public: inline static int team_size_recommended( const FunctorType & ) { -#ifdef KOKKOS_ENABLE_DEPRECATED_CODE return traits::execution_space::thread_pool_size(2); -#else - return traits::execution_space::impl_thread_pool_size(2); -#endif } template< class FunctorType > inline static int team_size_recommended( const FunctorType &, const int& ) { + return traits::execution_space::thread_pool_size(2); + } +#endif + + template<class FunctorType> + int team_size_max( const FunctorType&, const ParallelForTag& ) const { +#ifdef KOKKOS_ENABLE_DEPRECATED_CODE + int pool_size = traits::execution_space::thread_pool_size(1); +#else + int pool_size = traits::execution_space::impl_thread_pool_size(1); +#endif + int max_host_team_size = Impl::HostThreadTeamData::max_team_members; + return pool_size<max_host_team_size?pool_size:max_host_team_size; + } + template<class FunctorType> + int team_size_max( const FunctorType&, const ParallelReduceTag& ) const { +#ifdef KOKKOS_ENABLE_DEPRECATED_CODE + int pool_size = traits::execution_space::thread_pool_size(1); +#else + int pool_size = traits::execution_space::impl_thread_pool_size(1); +#endif + int max_host_team_size = Impl::HostThreadTeamData::max_team_members; + return pool_size<max_host_team_size?pool_size:max_host_team_size; + } + template<class FunctorType> + int team_size_recommended( const FunctorType&, const ParallelForTag& ) const { +#ifdef KOKKOS_ENABLE_DEPRECATED_CODE + return traits::execution_space::thread_pool_size(2); +#else + return traits::execution_space::impl_thread_pool_size(2); +#endif + } + template<class FunctorType> + int team_size_recommended( const FunctorType&, const ParallelReduceTag& ) const { #ifdef KOKKOS_ENABLE_DEPRECATED_CODE return traits::execution_space::thread_pool_size(2); #else @@ -110,6 +137,18 @@ public: #endif } + + inline static + int vector_length_max() + { return 1024; } // Use arbitrary large number, is meant as a vectorizable length + + inline static + int scratch_size_max(int level) + { return (level==0? + 1024*32: // Roughly L1 size + 20*1024*1024); // Limit to keep compatibility with CUDA + } + //---------------------------------------- private: diff --git a/packages/kokkos/core/src/OpenMPTarget/Kokkos_OpenMPTargetSpace.cpp b/packages/kokkos/core/src/OpenMPTarget/Kokkos_OpenMPTargetSpace.cpp index 2d53670c8df37aecb52475b3ad10ab3dd8770877..c7d4defad2c56961cc468655d6a1f217f4f33720 100644 --- a/packages/kokkos/core/src/OpenMPTarget/Kokkos_OpenMPTargetSpace.cpp +++ b/packages/kokkos/core/src/OpenMPTarget/Kokkos_OpenMPTargetSpace.cpp @@ -160,7 +160,8 @@ SharedAllocationRecord( const Kokkos::Experimental::OpenMPTargetSpace & arg_spac , arg_label.c_str() , SharedAllocationHeader::maximum_label_length ); - + // Set last element zero, in case c_str is too long + header.m_label[SharedAllocationHeader::maximum_label_length - 1] = (char) 0; //TODO DeepCopy // DeepCopy diff --git a/packages/kokkos/core/src/ROCm/Kokkos_ROCm_Config.hpp b/packages/kokkos/core/src/ROCm/Kokkos_ROCm_Config.hpp index 71643458b471d45e0cc3743fea1233f3b8c39f54..87840bb37be3b4a63f613c68a86846f7a381710d 100644 --- a/packages/kokkos/core/src/ROCm/Kokkos_ROCm_Config.hpp +++ b/packages/kokkos/core/src/ROCm/Kokkos_ROCm_Config.hpp @@ -44,8 +44,8 @@ #ifndef GUARD_CORE_KOKKOS_ROCM_CONFIG_HPP #define GUARD_CORE_KOKKOS_ROCM_CONFIG_HPP -#ifndef KOKKOS_ROCM_HAS_WORKAROUNDS -#define KOKKOS_ROCM_HAS_WORKAROUNDS 1 +#ifndef KOKKOS_IMPL_ROCM_CLANG_WORKAROUND +#define KOKKOS_IMPL_ROCM_CLANG_WORKAROUND 1 #endif #endif diff --git a/packages/kokkos/core/src/ROCm/Kokkos_ROCm_Exec.hpp b/packages/kokkos/core/src/ROCm/Kokkos_ROCm_Exec.hpp index 1c2bf303cfbfcfa2d18ad53b875b46fbf8ef8bb6..205e6a29553942e117f1d9d125f3b16128f59734 100644 --- a/packages/kokkos/core/src/ROCm/Kokkos_ROCm_Exec.hpp +++ b/packages/kokkos/core/src/ROCm/Kokkos_ROCm_Exec.hpp @@ -55,14 +55,14 @@ namespace Impl { struct ROCmTraits { // TODO: determine if needed - enum { WavefrontSize = 64 /* 64 */ }; - enum { WorkgroupSize = 64 /* 64 */ }; - enum { WavefrontIndexMask = 0x001f /* Mask for warpindex */ }; - enum { WavefrontIndexShift = 5 /* WarpSize == 1 << WarpShift */ }; + enum { WavefrontSize = 64 /* 64 */ }; + enum { WorkgroupSize = 256 /* 256 */ }; + enum { WavefrontIndexMask = 0x003f /* Mask for wavefrontindex */ }; + enum { WavefrontIndexShift = 6 /* WavefrontSize == 1 << WavefrontShift */ }; - enum { SharedMemoryBanks = 32 /* Compute device 2.0 */ }; - enum { SharedMemoryCapacity = 0x0C000 /* 48k shared / 16k L1 Cache */ }; - enum { SharedMemoryUsage = 0x04000 /* 16k shared / 48k L1 Cache */ }; + enum { SharedMemoryBanks = 64 /* GCN */ }; + enum { SharedMemoryCapacity = 0x10000 /* 64k shared / 16k L1 Cache */ }; + enum { SharedMemoryUsage = 0x04000 /* 64k shared / 16k L1 Cache */ }; enum { UpperBoundExtentCount = 4294967295 /* Hard upper bound */ }; #if 0 @@ -84,6 +84,16 @@ size_t rocm_internal_maximum_workgroup_count(); size_t * rocm_internal_scratch_flags( const size_t size ); size_t * rocm_internal_scratch_space( const size_t size ); +// This pointer is the start of dynamic shared memory (LDS). +// Dynamic is at the end of LDS and it's size must be specified +// in a tile_block specification at kernel launch time. +template< typename T > +KOKKOS_INLINE_FUNCTION +T * kokkos_impl_rocm_shared_memory() +//{ return (T*) hc::get_group_segment_base_pointer() ; } +{ return (T*) hc::get_dynamic_group_segment_base_pointer() ; } + + } } // namespace Kokkos #define ROCM_SPACE_ATOMIC_MASK 0x1FFFF @@ -249,7 +259,6 @@ struct ROCmParallelLaunch< DriverType size_t bx = (grid.x > block.x)? block.x : grid.x; size_t by = (grid.y > block.y)? block.y : grid.y; size_t bz = (grid.z > block.z)? block.z : grid.z; - hc::parallel_for_each(ext.tile_with_dynamic(bz,by,bx,shmem), [=](const hc::index<3> & idx) [[hc]] diff --git a/packages/kokkos/core/src/ROCm/Kokkos_ROCm_Impl.cpp b/packages/kokkos/core/src/ROCm/Kokkos_ROCm_Impl.cpp index 3ae312647e6d038cf561860ac7c81bf3fbce7bf8..236042ccc20ad62b85ea72fb64eb062067263999 100644 --- a/packages/kokkos/core/src/ROCm/Kokkos_ROCm_Impl.cpp +++ b/packages/kokkos/core/src/ROCm/Kokkos_ROCm_Impl.cpp @@ -543,20 +543,13 @@ enum { sizeScratchGrain = sizeof(ScratchGrain) }; void rocmMemset( Kokkos::Experimental::ROCm::size_type * ptr , Kokkos::Experimental::ROCm::size_type value , Kokkos::Experimental::ROCm::size_type size) { char * mptr = (char * ) ptr; -#if 0 - parallel_for_each(hc::extent<1>(size), +/* parallel_for_each(hc::extent<1>(size), [=, &ptr] (hc::index<1> idx) __HC__ { int i = idx[0]; ptr[i] = value; - }).wait(); -#else - for (int i= 0; i<size ; i++) - { - mptr[i] = (char) value; - } -#endif + }).wait();*/ } Kokkos::Experimental::ROCm::size_type * @@ -567,9 +560,9 @@ ROCmInternal::scratch_flags( const Kokkos::Experimental::ROCm::size_type size ) m_scratchFlagsCount = ( size + sizeScratchGrain - 1 ) / sizeScratchGrain ; - typedef Kokkos::Impl::SharedAllocationRecord< Kokkos::HostSpace , void > Record ; + typedef Kokkos::Impl::SharedAllocationRecord< Kokkos::Experimental::ROCmSpace , void > Record ; - Record * const r = Record::allocate( Kokkos::HostSpace() + Record * const r = Record::allocate( Kokkos::Experimental::ROCmSpace() , "InternalScratchFlags" , ( sizeScratchGrain * m_scratchFlagsCount ) ); @@ -590,9 +583,9 @@ ROCmInternal::scratch_space( const Kokkos::Experimental::ROCm::size_type size ) m_scratchSpaceCount = ( size + sizeScratchGrain - 1 ) / sizeScratchGrain ; - typedef Kokkos::Impl::SharedAllocationRecord< Kokkos::HostSpace , void > Record ; + typedef Kokkos::Impl::SharedAllocationRecord< Kokkos::Experimental::ROCmSpace , void > Record ; - Record * const r = Record::allocate( Kokkos::HostSpace() + static Record * const r = Record::allocate( Kokkos::Experimental::ROCmSpace() , "InternalScratchSpace" , ( sizeScratchGrain * m_scratchSpaceCount ) ); @@ -616,7 +609,7 @@ void ROCmInternal::finalize() // scratch_lock_array_rocm_space_ptr(false); // threadid_lock_array_rocm_space_ptr(false); - typedef Kokkos::Impl::SharedAllocationRecord< HostSpace > RecordROCm ; + typedef Kokkos::Impl::SharedAllocationRecord< Kokkos::Experimental::ROCmSpace > RecordROCm ; typedef Kokkos::Impl::SharedAllocationRecord< Kokkos::Experimental::ROCmHostPinnedSpace > RecordHost ; RecordROCm::decrement( RecordROCm::get_record( m_scratchFlags ) ); diff --git a/packages/kokkos/core/src/ROCm/Kokkos_ROCm_Parallel.hpp b/packages/kokkos/core/src/ROCm/Kokkos_ROCm_Parallel.hpp index 2978ae8f5f453599a3504e558a9c8fa5e770b9b9..edd1c12e45072b30fbe25d6d0a89d0085f2877c2 100644 --- a/packages/kokkos/core/src/ROCm/Kokkos_ROCm_Parallel.hpp +++ b/packages/kokkos/core/src/ROCm/Kokkos_ROCm_Parallel.hpp @@ -243,6 +243,15 @@ public: return(max); } + template< class FunctorType , class PatternTypeTag> + int team_size_max( const FunctorType& functor, PatternTypeTag) { + return 256/vector_length(); + } + template< class FunctorType , class PatternTypeTag> + int team_size_recommended( const FunctorType& functor, PatternTypeTag) { + return 128/vector_length(); + } + template<class F> KOKKOS_INLINE_FUNCTION int team_size(const F& f) const { return (m_team_size > 0) ? m_team_size : team_size_recommended(f); } KOKKOS_INLINE_FUNCTION int team_size() const { return (m_team_size > 0) ? m_team_size : Impl::get_max_tile_thread(); ; } @@ -261,6 +270,11 @@ public: return m_thread_scratch_size[level]; } + static int scratch_size_max(int level) { + return level==0 ? + 1024*40 : 1024*1204*20; + } + typedef Impl::ROCmTeamMember member_type; }; @@ -487,6 +501,7 @@ public: #endif } m_idx.barrier.wait(); + reducer.reference() = buffer[0]; } /** \brief Intra-team vector reduce @@ -541,19 +556,19 @@ public: } template< typename ReducerType > - KOKKOS_INLINE_FUNCTION static + KOKKOS_INLINE_FUNCTION typename std::enable_if< is_reducer< ReducerType >::value >::type - vector_reduce( ReducerType const & reducer ) + vector_reduce( ReducerType const & reducer ) const { #ifdef __HCC_ACCELERATOR__ - if(blockDim_x == 1) return; + if(m_vector_length == 1) return; // Intra vector lane shuffle reduction: typename ReducerType::value_type tmp ( reducer.reference() ); - for ( int i = blockDim_x ; ( i >>= 1 ) ; ) { - shfl_down( reducer.reference() , i , blockDim_x ); - if ( (int)threadIdx_x < i ) { reducer.join( tmp , reducer.reference() ); } + for ( int i = m_vector_length ; ( i >>= 1 ) ; ) { + reducer.reference() = shfl_down( tmp , i , m_vector_length ); + if ( (int)vector_rank() < i ) { reducer.join( tmp , reducer.reference() ); } } // Broadcast from root lane to all other lanes. @@ -561,7 +576,7 @@ public: // because floating point summation is not associative // and thus different threads could have different results. - shfl( reducer.reference() , 0 , blockDim_x ); + reducer.reference() = shfl( tmp , 0 , m_vector_length ); #endif } @@ -847,7 +862,7 @@ public: hc::extent< 1 > flat_extent( total_size ); - hc::tiled_extent< 1 > team_extent = flat_extent.tile(team_size*vector_length); + hc::tiled_extent< 1 > team_extent = flat_extent.tile(vector_length*team_size); hc::parallel_for_each( team_extent , [=](hc::tiled_index<1> idx) [[hc]] { rocm_invoke<typename Policy::work_tag>(f, typename Policy::member_type(idx, league_size, team_size, shared, shared_size, scratch_size0, scratch, scratch_size1,vector_length)); @@ -958,6 +973,176 @@ public: }; +//---------------------------------------------------------------------------- + +template< class FunctorType , class ReducerType, class... Traits > +class ParallelReduce< + FunctorType , Kokkos::MDRangePolicy< Traits... >, ReducerType, Kokkos::Experimental::ROCm > +{ +private: + typedef Kokkos::MDRangePolicy< Traits ... > Policy ; + using RP = Policy; + typedef typename Policy::array_index_type array_index_type; + typedef typename Policy::index_type index_type; + typedef typename Policy::work_tag WorkTag ; + typedef typename Policy::member_type Member ; + typedef typename Policy::launch_bounds LaunchBounds; + + typedef Kokkos::Impl::if_c< std::is_same<InvalidType,ReducerType>::value, FunctorType, ReducerType> ReducerConditional; + typedef typename ReducerConditional::type ReducerTypeFwd; + typedef typename Kokkos::Impl::if_c< std::is_same<InvalidType,ReducerType>::value, WorkTag, void>::type WorkTagFwd; + + typedef Kokkos::Impl::FunctorValueTraits< ReducerTypeFwd, WorkTagFwd > ValueTraits ; + typedef Kokkos::Impl::FunctorValueInit< ReducerTypeFwd, WorkTagFwd > ValueInit ; + typedef Kokkos::Impl::FunctorValueJoin< ReducerTypeFwd, WorkTagFwd > ValueJoin ; + + +public: + + typedef typename ValueTraits::pointer_type pointer_type ; + typedef typename ValueTraits::value_type value_type ; + typedef typename ValueTraits::reference_type reference_type ; + typedef FunctorType functor_type ; + typedef Kokkos::Experimental::ROCm::size_type size_type ; + + // Algorithmic constraints: blockSize is a power of two AND blockDim.y == blockDim.z == 1 + + const FunctorType m_functor ; + const Policy m_policy ; // used for workrange and nwork + const ReducerType m_reducer ; + const pointer_type m_result_ptr ; + value_type * m_scratch_space ; + size_type * m_scratch_flags ; + + typedef typename Kokkos::Impl::Reduce::DeviceIterateTile<Policy::rank, Policy, FunctorType, typename Policy::work_tag, reference_type> DeviceIteratePattern; + + KOKKOS_INLINE_FUNCTION + void exec_range( reference_type update ) const + { + Kokkos::Impl::Reduce::DeviceIterateTile<Policy::rank,Policy,FunctorType,typename Policy::work_tag, reference_type>(m_policy, m_functor, update).exec_range(); + } + + + KOKKOS_INLINE_FUNCTION + void operator()(void) const + { + run(); + } + + KOKKOS_INLINE_FUNCTION + void run( ) const + { + const integral_nonzero_constant< size_type , ValueTraits::StaticValueSize / sizeof(value_type) > + word_count( (ValueTraits::value_size( ReducerConditional::select(m_functor , m_reducer) )) / sizeof(value_type) ); + // pointer to shared data accounts for the reserved space at the start + value_type * const shared = kokkos_impl_rocm_shared_memory<value_type>() + + 2*sizeof(uint64_t); + + { + reference_type value = + ValueInit::init( ReducerConditional::select(m_functor , m_reducer) , shared + threadIdx_y * word_count.value ); + // Number of blocks is bounded so that the reduction can be limited to two passes. + // Each thread block is given an approximately equal amount of work to perform. + // Accumulate the values for this block. + // The accumulation ordering does not match the final pass, but is arithmatically equivalent. + + this-> exec_range( value ); + } + + // Reduce with final value at blockDim.y - 1 location. + // Problem: non power-of-two blockDim + + if ( rocm_single_inter_block_reduce_scan<false,ReducerTypeFwd,WorkTagFwd>( + ReducerConditional::select(m_functor , m_reducer) , blockIdx_x , + gridDim_x , shared , m_scratch_space , m_scratch_flags ) ) { + + // This is the final block with the final result at the final threads' location + value_type * const tshared = shared + ( blockDim_y - 1 ) * word_count.value ; + value_type * const global = m_scratch_space ; + + if ( threadIdx_y == 0 ) { + Kokkos::Impl::FunctorFinal< ReducerTypeFwd , WorkTagFwd >::final( ReducerConditional::select(m_functor , m_reducer) , tshared ); +// for ( unsigned i = 0 ; i < word_count.value ; i+=blockDim_y ) { global[i] = tshared[i]; } + for ( unsigned i = 0 ; i < word_count.value ; i++ ) { global[i] = tshared[i]; } + } + } + } + + + + // Determine block size constrained by shared memory: + static inline + unsigned local_block_size( const FunctorType & f ) + { + unsigned n = ROCmTraits::WavefrontSize * 8 ; + while ( n && ROCmTraits::SharedMemoryCapacity < rocm_single_inter_block_reduce_scan_shmem<false,FunctorType,WorkTag>( f , n ) ) { n >>= 1 ; } + return n ; + } + + inline + void execute() + { + const int 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 + // Nearest power of two + int exponent_pow_two = std::ceil( std::log2((float)block_size) ); + block_size = 1<<(exponent_pow_two); + + m_scratch_space = (value_type*)rocm_internal_scratch_space( ValueTraits::value_size( ReducerConditional::select(m_functor , m_reducer) ) * block_size*nwork /* block_size == max block_count */ ); + m_scratch_flags = rocm_internal_scratch_flags( sizeof(size_type) ); + const dim3 block( 1 , block_size , 1 ); + // Required grid.x <= block.y + const dim3 grid( nwork, block_size , 1 ); + const int shmem = rocm_single_inter_block_reduce_scan_shmem<false,FunctorType,WorkTag>( m_functor , block.y ); + + ROCmParallelLaunch< ParallelReduce, LaunchBounds >( *this, grid, block, shmem ); // copy to device and execute + + ROCM::fence(); + + if ( m_result_ptr ) { + const int size = ValueTraits::value_size( ReducerConditional::select(m_functor , m_reducer) ); + DeepCopy<HostSpace,Kokkos::Experimental::ROCmSpace>( m_result_ptr , m_scratch_space , size ); + } + } + else { + if (m_result_ptr) { + ValueInit::init( ReducerConditional::select(m_functor , m_reducer) , m_result_ptr ); + } + } + } + + + template< class HostViewType > + ParallelReduce( const FunctorType & arg_functor + , const Policy & arg_policy + , const HostViewType & arg_result + , typename std::enable_if< + Kokkos::is_view< HostViewType >::value + ,void*>::type = NULL) + : m_functor( arg_functor ) + , m_policy( arg_policy ) + , m_reducer( InvalidType() ) + , m_result_ptr( arg_result.data() ) + , m_scratch_space( 0 ) + , m_scratch_flags( 0 ) + {} + + ParallelReduce( const FunctorType & arg_functor + , const Policy & arg_policy + , const ReducerType & reducer) + : m_functor( arg_functor ) + , m_policy( arg_policy ) + , m_reducer( reducer ) + , m_result_ptr( reducer.view().data() ) + , m_scratch_space( 0 ) + , m_scratch_flags( 0 ) + {} + +}; +//---------------------------------------------------------------------------- + template< class FunctorType, class ReducerType, class... Traits > class ParallelReduce< FunctorType , Kokkos::TeamPolicy< Traits... >, ReducerType, Kokkos::Experimental::ROCm > @@ -992,8 +1177,14 @@ public: const int scratch_size0 = policy.scratch_size(0,team_size); const int scratch_size1 = policy.scratch_size(1,team_size); const int total_size = league_size * team_size ; - - if(total_size == 0) return; + + typedef Kokkos::Impl::FunctorValueInit< FunctorType, typename Policy::work_tag > ValueInit ; + if(total_size==0) { + if (result_view.data()) { + ValueInit::init( f , result_view.data() ); + } + return; + } const int reduce_size = ValueTraits::value_size( f ); const int shared_size = FunctorTeamShmemSize< FunctorType >::value( f , team_size ); @@ -1042,7 +1233,16 @@ public: const int vector_length = policy.vector_length(); const int total_size = league_size * team_size; - if(total_size == 0) return; + typedef Kokkos::Impl::FunctorValueInit< ReducerType, typename Policy::work_tag > ValueInit ; + typedef Kokkos::Impl::if_c< std::is_same<InvalidType,ReducerType>::value, + FunctorType, ReducerType> ReducerConditional; + if(total_size==0) { + if (reducer.view().data()) { + ValueInit::init( ReducerConditional::select(f,reducer), + reducer.view().data() ); + } + return; + } const int reduce_size = ValueTraits::value_size( f ); const int shared_size = FunctorTeamShmemSize< FunctorType >::value( f , team_size ); @@ -1113,6 +1313,39 @@ public: //---------------------------------------- }; +template< class FunctorType , class ReturnType , class... Traits > +class ParallelScanWithTotal< FunctorType , Kokkos::RangePolicy< Traits... >, + ReturnType, Kokkos::Experimental::ROCm > +{ +private: + + typedef Kokkos::RangePolicy< Traits... > Policy; + typedef typename Policy::work_tag Tag; + typedef Kokkos::Impl::FunctorValueTraits< FunctorType, Tag> ValueTraits; + +public: + + //---------------------------------------- + + inline + ParallelScanWithTotal( const FunctorType & f + , const Policy & policy + , ReturnType & arg_returnvalue) + { + const auto len = policy.end()-policy.begin(); + + + if(len==0) return; + + scan_enqueue<Tag,ReturnType>(len, f, arg_returnvalue, [](hc::tiled_index<1> idx, int, int) { return idx.global[0]; }); + } + + KOKKOS_INLINE_FUNCTION + void execute() const {} + + //---------------------------------------- +}; + template< class FunctorType , class... Traits> class ParallelScan< FunctorType , Kokkos::TeamPolicy< Traits... >, Kokkos::Experimental::ROCm > { @@ -1350,22 +1583,17 @@ void parallel_for(const Impl::TeamThreadRangeBoundariesStruct<iType,Impl::ROCmTe * val is performed and put into result. This functionality requires C++11 support.*/ template< typename iType, class Lambda, typename ValueType > KOKKOS_INLINE_FUNCTION -void parallel_reduce(const Impl::TeamThreadRangeBoundariesStruct<iType,Impl::ROCmTeamMember>& loop_boundaries, +typename std::enable_if< ! Kokkos::is_reducer< ValueType >::value >::type +parallel_reduce(const Impl::TeamThreadRangeBoundariesStruct<iType,Impl::ROCmTeamMember>& loop_boundaries, const Lambda & lambda, ValueType& result) { - result = ValueType(); + Kokkos::Sum<ValueType> reducer(result); + reducer.init( reducer.reference() ); for( iType i = loop_boundaries.start; i < loop_boundaries.end; i+=loop_boundaries.increment) { - ValueType tmp = ValueType(); - lambda(i,tmp); - result+=tmp; + lambda(i,reducer.reference()); } - result = loop_boundaries.thread.team_reduce(result, - Impl::JoinAdd<ValueType>()); -// Impl::rocm_intra_workgroup_reduction( loop_boundaries.thread, result, -// Impl::JoinAdd<ValueType>()); -// Impl::rocm_inter_workgroup_reduction( loop_boundaries.thread, result, -// Impl::JoinAdd<ValueType>()); + loop_boundaries.thread.team_reduce(reducer); } /** \brief Inter-thread thread range parallel_reduce. Executes lambda(iType i, ValueType & val) for each i=0..N-1. @@ -1374,7 +1602,8 @@ void parallel_reduce(const Impl::TeamThreadRangeBoundariesStruct<iType,Impl::ROC * val is performed and put into result. This functionality requires C++11 support.*/ template< typename iType, class Lambda, typename ReducerType > KOKKOS_INLINE_FUNCTION -void parallel_reduce(const Impl::TeamThreadRangeBoundariesStruct<iType,Impl::ROCmTeamMember>& loop_boundaries, +typename std::enable_if< Kokkos::is_reducer< ReducerType >::value >::type +parallel_reduce(const Impl::TeamThreadRangeBoundariesStruct<iType,Impl::ROCmTeamMember>& loop_boundaries, const Lambda & lambda, ReducerType const & reducer) { reducer.init( reducer.reference() ); @@ -1439,7 +1668,8 @@ void parallel_for(const Impl::ThreadVectorRangeBoundariesStruct<iType,Impl::ROCm * val is performed and put into result. This functionality requires C++11 support.*/ template< typename iType, class Lambda, typename ValueType > KOKKOS_INLINE_FUNCTION -void parallel_reduce(const Impl::ThreadVectorRangeBoundariesStruct<iType,Impl::ROCmTeamMember >& +typename std::enable_if< !Kokkos::is_reducer< ValueType >::value >::type +parallel_reduce(const Impl::ThreadVectorRangeBoundariesStruct<iType,Impl::ROCmTeamMember >& loop_boundaries, const Lambda & lambda, ValueType& result) { result = ValueType(); @@ -1477,7 +1707,8 @@ void parallel_reduce(const Impl::ThreadVectorRangeBoundariesStruct<iType,Impl::R * val is performed and put into result. This functionality requires C++11 support.*/ template< typename iType, class Lambda, typename ReducerType > KOKKOS_INLINE_FUNCTION -void parallel_reduce(const Impl::ThreadVectorRangeBoundariesStruct<iType,Impl::ROCmTeamMember >& +typename std::enable_if< Kokkos::is_reducer< ReducerType >::value >::type +parallel_reduce(const Impl::ThreadVectorRangeBoundariesStruct<iType,Impl::ROCmTeamMember >& loop_boundaries, const Lambda & lambda, ReducerType const & reducer) { reducer.init( reducer.reference() ); @@ -1523,86 +1754,46 @@ void parallel_scan(const Impl::ThreadVectorRangeBoundariesStruct<iType,Impl::ROC typedef Kokkos::Impl::FunctorValueTraits< FunctorType , void > ValueTraits ; typedef typename ValueTraits::value_type value_type ; - value_type scan_val = value_type(); -#if (__ROCM_ARCH__ >= 800) -// adopt the cuda vector shuffle method - const int VectorLength = loop_boundaries.increment; - int lid = loop_boundaries.thread.lindex(); - int vector_rank = lid%VectorLength; - - iType loop_bound = ((loop_boundaries.end+VectorLength-1)/VectorLength) * VectorLength; - value_type val ; - for(int _i = vector_rank; _i < loop_bound; _i += VectorLength) { - val = value_type(); - if(_i<loop_boundaries.end) - lambda(_i , val , false); - - value_type tmp = val; - value_type result_i; - - if(vector_rank == 0) - result_i = tmp; - if (VectorLength > 1) { - const value_type tmp2 = shfl_up(tmp, 1,VectorLength); - if(vector_rank > 0) - tmp+=tmp2; - } - if(vector_rank == 1) - result_i = tmp; - if (VectorLength > 3) { - const value_type tmp2 = shfl_up(tmp, 2,VectorLength); - if(vector_rank > 1) - tmp+=tmp2; - } - if ((vector_rank >= 2) && - (vector_rank < 4)) - result_i = tmp; - if (VectorLength > 7) { - const value_type tmp2 = shfl_up(tmp, 4,VectorLength); - if(vector_rank > 3) - tmp+=tmp2; - } - if ((vector_rank >= 4) && - (vector_rank < 8)) - result_i = tmp; - if (VectorLength > 15) { - const value_type tmp2 = shfl_up(tmp, 8,VectorLength); - if(vector_rank > 7) - tmp+=tmp2; - } - if ((vector_rank >= 8) && - (vector_rank < 16)) - result_i = tmp; - if (VectorLength > 31) { - const value_type tmp2 = shfl_up(tmp, 16,VectorLength); - if(vector_rank > 15) - tmp+=tmp2; - } - if ((vector_rank >=16) && - (vector_rank < 32)) - result_i = tmp; - if (VectorLength > 63) { - const value_type tmp2 = shfl_up(tmp, 32,VectorLength); - if(vector_rank > 31) - tmp+=tmp2; + value_type val = value_type(); + const int vector_length = loop_boundaries.thread.vector_length(); + const int vector_rank = loop_boundaries.thread.vector_rank(); + + iType end = ((loop_boundaries.end+vector_length-1)/vector_length) * vector_length; + value_type accum = value_type(); + + for ( int i = vector_rank ; i < end ; i += vector_length ) { + + value_type val = 0 ; + + // First acquire per-lane contributions: + if ( i < loop_boundaries.end ) lambda( i , val , false ); + + value_type sval = val ; + + // Bottom up inclusive scan in triangular pattern + // where each thread is the root of a reduction tree + // from the zeroth "lane" to itself. + // [t] += [t-1] if t >= 1 + // [t] += [t-2] if t >= 2 + // [t] += [t-4] if t >= 4 + // ... + + for ( int j = 1 ; j < vector_length ; j <<= 1 ) { + value_type tmp = 0 ; + tmp = shfl_up(sval , j , vector_length ); + if ( j <= vector_rank ) { sval += tmp ; } } - if (vector_rank >= 32) - result_i = tmp; + // Include accumulation and remove value for exclusive scan: + val = accum + sval - val ; - val = scan_val + result_i - val; - scan_val += shfl(tmp,VectorLength-1,VectorLength); - if(_i<loop_boundaries.end) - lambda(_i , val , true); - } -#else -// for kaveri, call the LDS based thread_scan routine - for( iType i = loop_boundaries.start; i < loop_boundaries.end; i+=loop_boundaries.increment) { - lambda(i,scan_val,true); - } - scan_val = loop_boundaries.thread.team_scan(scan_val); + // Provide exclusive scan value: + if ( i < loop_boundaries.end ) lambda( i , val , true ); -#endif + // Accumulate the last value in the inclusive scan: + sval = shfl( sval , vector_length-1 , vector_length); + accum += sval ; + } } } // namespace Kokkos diff --git a/packages/kokkos/core/src/ROCm/Kokkos_ROCm_Reduce.hpp b/packages/kokkos/core/src/ROCm/Kokkos_ROCm_Reduce.hpp index 7dd69e757054e3fe7946b30151165ee192d0616e..0321f3d53f733a34ff082785f1aa01fc6ce1cd14 100644 --- a/packages/kokkos/core/src/ROCm/Kokkos_ROCm_Reduce.hpp +++ b/packages/kokkos/core/src/ROCm/Kokkos_ROCm_Reduce.hpp @@ -57,7 +57,6 @@ #include <ROCm/Kokkos_ROCm_Tile.hpp> #include <ROCm/Kokkos_ROCm_Invoke.hpp> #include <ROCm/Kokkos_ROCm_Join.hpp> - ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// namespace Kokkos { @@ -75,7 +74,7 @@ T& reduce_value(T* x, std::false_type) [[hc]] return *x; } -#if KOKKOS_ROCM_HAS_WORKAROUNDS +#ifdef KOKKOS_IMPL_ROCM_CLANG_WORKAROUND struct always_true { template<class... Ts> @@ -149,7 +148,7 @@ void reduce_enqueue( // Store the tile result in the global memory. if (local == 0) { -#if KOKKOS_ROCM_HAS_WORKAROUNDS +#ifdef KOKKOS_IMPL_ROCM_CLANG_WORKAROUND // Workaround for assigning from LDS memory: std::copy should work // directly buffer.action_at(0, [&](T* x) @@ -158,7 +157,7 @@ void reduce_enqueue( // new ROCM 15 address space changes aren't implemented in std algorithms yet auto * src = reinterpret_cast<char *>(x); auto * dest = reinterpret_cast<char *>(result.data()+tile*output_length); - for(int i=0; i<sizeof(T);i++) dest[i] = src[i]; + for(int i=0; i<sizeof(T)*output_length;i++) dest[i] = src[i]; #else // Workaround: copy_if used to avoid memmove std::copy_if(x, x+output_length, result.data()+tile*output_length, always_true{} ); @@ -169,12 +168,10 @@ void reduce_enqueue( #endif } - }); if (output_result != nullptr) ValueInit::init(ReducerConditional::select(f, reducer), output_result); fut.wait(); - copy(result,result_cpu.data()); if (output_result != nullptr) { for(std::size_t i=0;i<td.num_tiles;i++) diff --git a/packages/kokkos/core/src/ROCm/Kokkos_ROCm_ReduceScan.hpp b/packages/kokkos/core/src/ROCm/Kokkos_ROCm_ReduceScan.hpp index 3f67089b9204a3396e6d829a1c82e17dc2a04cc6..33efa0d6f057c94601b85144b0d7709f40e02d9f 100644 --- a/packages/kokkos/core/src/ROCm/Kokkos_ROCm_ReduceScan.hpp +++ b/packages/kokkos/core/src/ROCm/Kokkos_ROCm_ReduceScan.hpp @@ -62,6 +62,76 @@ namespace Kokkos { namespace Impl { +//#if __KALMAR_ACCELERATOR__ == 1 +KOKKOS_INLINE_FUNCTION +void __syncthreads() [[hc]] +{ + amp_barrier(CLK_LOCAL_MEM_FENCE); +} + +#define LT0 ((threadIdx_x+threadIdx_y+threadIdx_z)?0:1) + + +// returns non-zero if and only if predicate is non-zero for all threads +// note that syncthreads_or uses the first 64 bits of dynamic group memory. +// this reserved memory must be accounted for everwhere +// that get_dynamic_group_segment_base_pointer is called. +KOKKOS_INLINE_FUNCTION +uint64_t __syncthreads_or(uint64_t pred) +{ + uint64_t *shared_var = (uint64_t *)hc::get_dynamic_group_segment_base_pointer(); + if(LT0) *shared_var = 0; + amp_barrier(CLK_LOCAL_MEM_FENCE); +#if __KALMAR_ACCELERATOR__ == 1 + if (pred) hc::atomic_or_uint64(shared_var,1); +#endif + amp_barrier(CLK_LOCAL_MEM_FENCE); + return (*shared_var); +} + +KOKKOS_INLINE_FUNCTION +void __threadfence() +{ + amp_barrier(CLK_LOCAL_MEM_FENCE | CLK_GLOBAL_MEM_FENCE); +} + +KOKKOS_INLINE_FUNCTION +void __threadfence_block() +{ + amp_barrier(CLK_LOCAL_MEM_FENCE | CLK_GLOBAL_MEM_FENCE); +} +//#endif +struct ROCm_atomic_CAS { + template<class OP> + KOKKOS_INLINE_FUNCTION + unsigned long operator () (volatile unsigned long * dest, OP &&op){ + unsigned long read,compare,val; + compare = *dest; + read = compare; + do { + compare = read; + val = op(compare); +#if __KALMAR_ACCELERATOR__ == 1 + hc::atomic_compare_exchange((uint64_t *)dest,&read,val); +#endif + } while (read != compare); + return val; + } +}; + + template<class OP> + KOKKOS_INLINE_FUNCTION + unsigned long atomic_cas_op (volatile unsigned long * dest, OP &&op) { + ROCm_atomic_CAS cas_op; + return cas_op(dest, std::forward<OP>(op)); + } + + KOKKOS_INLINE_FUNCTION + unsigned long atomicInc (volatile unsigned long * dest, const unsigned long& val) { + return atomic_cas_op(dest, [=](unsigned long old){return ((old>=val)?0:(old+1));}); + } + + //---------------------------------------------------------------------------- template< typename T > @@ -375,18 +445,7 @@ bool rocm_inter_block_reduction( ROCmTeamMember& team, #endif } #endif -#if 0 -//---------------------------------------------------------------------------- -// See section B.17 of ROCm C Programming Guide Version 3.2 -// for discussion of -// __launch_bounds__(maxThreadsPerBlock,minBlocksPerMultiprocessor) -// function qualifier which could be used to improve performance. -//---------------------------------------------------------------------------- -// Maximize shared memory and minimize L1 cache: -// rocmFuncSetCacheConfig(MyKernel, rocmFuncCachePreferShared ); -// For 2.0 capability: 48 KB shared and 16 KB L1 -//---------------------------------------------------------------------------- //---------------------------------------------------------------------------- /* * Algorithmic constraints: @@ -406,87 +465,105 @@ void rocm_intra_block_reduce_scan( const FunctorType & functor , typedef typename ValueTraits::pointer_type pointer_type ; const unsigned value_count = ValueTraits::value_count( functor ); - const unsigned BlockSizeMask = team.team_size() - 1 ; + const unsigned BlockSizeMask = blockDim_y - 1 ; // Must have power of two thread count - if ( BlockSizeMask & team.team_size() ) { Kokkos::abort("ROCm::rocm_intra_block_scan requires power-of-two blockDim"); } + if ( BlockSizeMask & blockDim_y ) { Kokkos::abort("ROCm::rocm_intra_block_scan requires power-of-two blockDim"); } #define BLOCK_REDUCE_STEP( R , TD , S ) \ - if ( ! ( R & ((1<<(S+1))-1) ) ) { ValueJoin::join( functor , TD , (TD - (value_count<<S)) ); } + if ( ! (( R & ((1<<(S+1))-1) )|(blockDim_y<(1<<(S+1)))) ) { ValueJoin::join( functor , TD , (TD - (value_count<<S)) ); } #define BLOCK_SCAN_STEP( TD , N , S ) \ if ( N == (1<<S) ) { ValueJoin::join( functor , TD , (TD - (value_count<<S))); } +#define KOKKOS_IMPL_ROCM_SYNCWF __threadfence_block() - const unsigned rtid_intra = team.team_rank() ^ BlockSizeMask ; - const pointer_type tdata_intra = base_data + value_count * team.team_rank() ; + const unsigned rtid_intra = threadIdx_y ^ BlockSizeMask ; + const pointer_type tdata_intra = base_data + value_count * threadIdx_y ; - { // Intra-workgroup reduction: + { // Intra-workgroup reduction: min blocksize of 64 + KOKKOS_IMPL_ROCM_SYNCWF; BLOCK_REDUCE_STEP(rtid_intra,tdata_intra,0) + KOKKOS_IMPL_ROCM_SYNCWF; BLOCK_REDUCE_STEP(rtid_intra,tdata_intra,1) + KOKKOS_IMPL_ROCM_SYNCWF; BLOCK_REDUCE_STEP(rtid_intra,tdata_intra,2) + KOKKOS_IMPL_ROCM_SYNCWF; BLOCK_REDUCE_STEP(rtid_intra,tdata_intra,3) + KOKKOS_IMPL_ROCM_SYNCWF; BLOCK_REDUCE_STEP(rtid_intra,tdata_intra,4) + KOKKOS_IMPL_ROCM_SYNCWF; + BLOCK_REDUCE_STEP(rtid_intra,tdata_intra,5) + KOKKOS_IMPL_ROCM_SYNCWF; } - team.team_barrier(); // Wait for all workgroups to reduce + __syncthreads(); // Wait for all workgroups to reduce { // Inter-workgroup reduce-scan by a single workgroup to avoid extra synchronizations - const unsigned rtid_inter = ( team.team_rank() ^ BlockSizeMask ) << ROCmTraits::WarpIndexShift ; + if(threadIdx_y < value_count) { + for(int i=blockDim_y-65; i>0; i-= 64) + ValueJoin::join( functor , base_data + (blockDim_y-1)*value_count + threadIdx_y , base_data + i*value_count + threadIdx_y ); + } + __syncthreads(); +#if 0 + const unsigned rtid_inter = ( threadIdx_y ^ BlockSizeMask ) << ROCmTraits::WavefrontIndexShift ; + + if ( rtid_inter < blockDim_y ) { - if ( rtid_inter < team.team_size() ) { const pointer_type tdata_inter = base_data + value_count * ( rtid_inter ^ BlockSizeMask ); +// +// remove these comments +// for rocm, we start with a block size of 64, so the 5 step is already done. +// The remaining steps are only done if block size is > 64, so we leave them +// in place until we tune blocksize for performance, then remove the ones +// that will never be used. +// if ( (1<<6) < BlockSizeMask ) { __threadfence_block(); BLOCK_REDUCE_STEP(rtid_inter,tdata_inter,6) } +// if ( (1<<7) < BlockSizeMask ) { __threadfence_block(); BLOCK_REDUCE_STEP(rtid_inter,tdata_inter,7) } +// if ( (1<<8) < BlockSizeMask ) { __threadfence_block(); BLOCK_REDUCE_STEP(rtid_inter,tdata_inter,8) } +// if ( (1<<9) < BlockSizeMask ) { __threadfence_block(); BLOCK_REDUCE_STEP(rtid_inter,tdata_inter,9) } - if ( (1<<5) < BlockSizeMask ) { BLOCK_REDUCE_STEP(rtid_inter,tdata_inter,5) } - if ( (1<<6) < BlockSizeMask ) { __threadfence_block(); BLOCK_REDUCE_STEP(rtid_inter,tdata_inter,6) } - if ( (1<<7) < BlockSizeMask ) { __threadfence_block(); BLOCK_REDUCE_STEP(rtid_inter,tdata_inter,7) } - if ( (1<<8) < BlockSizeMask ) { __threadfence_block(); BLOCK_REDUCE_STEP(rtid_inter,tdata_inter,8) } if ( DoScan ) { - int n = ( rtid_inter & 32 ) ? 32 : ( - ( rtid_inter & 64 ) ? 64 : ( + int n = ( rtid_inter & 64 ) ? 64 : ( ( rtid_inter & 128 ) ? 128 : ( - ( rtid_inter & 256 ) ? 256 : 0 ))); + ( rtid_inter & 256 ) ? 256 : 0 )); - if ( ! ( rtid_inter + n < team.team_size() ) ) n = 0 ; + if ( ! ( rtid_inter + n < blockDim_y ) ) n = 0 ; __threadfence_block(); BLOCK_SCAN_STEP(tdata_inter,n,8) __threadfence_block(); BLOCK_SCAN_STEP(tdata_inter,n,7) __threadfence_block(); BLOCK_SCAN_STEP(tdata_inter,n,6) - __threadfence_block(); BLOCK_SCAN_STEP(tdata_inter,n,5) +// __threadfence_block(); BLOCK_SCAN_STEP(tdata_inter,n,5) } } +#endif } - team.team_barrier(); // Wait for inter-workgroup reduce-scan to complete + __syncthreads(); // Wait for inter-workgroup reduce-scan to complete if ( DoScan ) { int n = ( rtid_intra & 1 ) ? 1 : ( ( rtid_intra & 2 ) ? 2 : ( ( rtid_intra & 4 ) ? 4 : ( ( rtid_intra & 8 ) ? 8 : ( - ( rtid_intra & 16 ) ? 16 : 0 )))); - - if ( ! ( rtid_intra + n < team.team_size() ) ) n = 0 ; - #ifdef KOKKOS_IMPL_ROCM_CLANG_WORKAROUND - BLOCK_SCAN_STEP(tdata_intra,n,4) team.team_barrier();//__threadfence_block(); - BLOCK_SCAN_STEP(tdata_intra,n,3) team.team_barrier();//__threadfence_block(); - BLOCK_SCAN_STEP(tdata_intra,n,2) team.team_barrier();//__threadfence_block(); - BLOCK_SCAN_STEP(tdata_intra,n,1) team.team_barrier();//__threadfence_block(); - BLOCK_SCAN_STEP(tdata_intra,n,0) team.team_barrier(); - #else - BLOCK_SCAN_STEP(tdata_intra,n,4) __threadfence_block(); + ( rtid_intra & 16 ) ? 16 : ( + ( rtid_intra & 32 ) ? 32 : 0 ))))); + + if ( ! ( rtid_intra + n < blockDim_y ) ) n = 0 ; + +// BLOCK_SCAN_STEP(tdata_intra,n,5) __threadfence_block(); +// BLOCK_SCAN_STEP(tdata_intra,n,4) __threadfence_block(); BLOCK_SCAN_STEP(tdata_intra,n,3) __threadfence_block(); BLOCK_SCAN_STEP(tdata_intra,n,2) __threadfence_block(); BLOCK_SCAN_STEP(tdata_intra,n,1) __threadfence_block(); BLOCK_SCAN_STEP(tdata_intra,n,0) __threadfence_block(); - #endif } #undef BLOCK_SCAN_STEP #undef BLOCK_REDUCE_STEP +#undef KOKKOS_IMPL_ROCM_SYNCWF } //---------------------------------------------------------------------------- @@ -497,16 +574,18 @@ void rocm_intra_block_reduce_scan( const FunctorType & functor , * * Global reduce result is in the last threads' 'shared_data' location. */ +using ROCM = Kokkos::Experimental::ROCm ; + template< bool DoScan , class FunctorType , class ArgTag > KOKKOS_INLINE_FUNCTION bool rocm_single_inter_block_reduce_scan( const FunctorType & functor , - const ROCm::size_type block_id , - const ROCm::size_type block_count , - ROCm::size_type * const shared_data , - ROCm::size_type * const global_data , - ROCm::size_type * const global_flags ) + const ROCM::size_type block_id , + const ROCM::size_type block_count , + typename FunctorValueTraits<FunctorType, ArgTag>::value_type * const shared_data , + typename FunctorValueTraits<FunctorType, ArgTag>::value_type * const global_data , + ROCM::size_type * const global_flags ) { - typedef ROCm::size_type size_type ; + typedef ROCM::size_type size_type ; typedef FunctorValueTraits< FunctorType , ArgTag > ValueTraits ; typedef FunctorValueJoin< FunctorType , ArgTag > ValueJoin ; typedef FunctorValueInit< FunctorType , ArgTag > ValueInit ; @@ -517,16 +596,17 @@ bool rocm_single_inter_block_reduce_scan( const FunctorType & functor , typedef typename ValueTraits::value_type value_type ; // '__ffs' = position of the least significant bit set to 1. - // 'team.team_size()' is guaranteed to be a power of two so this + // blockDim_y is guaranteed to be a power of two so this // is the integral shift value that can replace an integral divide. - const unsigned BlockSizeShift = __ffs( team.team_size() ) - 1 ; - const unsigned BlockSizeMask = team.team_size() - 1 ; + // const unsigned long BlockSizeShift = __ffs( blockDim_y ) - 1 ; + const unsigned long BlockSizeShift = __lastbit_u32_u32( blockDim_y ) ; + const unsigned long BlockSizeMask = blockDim_y - 1 ; // Must have power of two thread count - if ( BlockSizeMask & team.team_size() ) { Kokkos::abort("ROCm::rocm_single_inter_block_reduce_scan requires power-of-two blockDim"); } + if ( BlockSizeMask & blockDim_y ) { Kokkos::abort("ROCm::rocm_single_inter_block_reduce_scan requires power-of-two blockDim"); } - const integral_nonzero_constant< size_type , ValueTraits::StaticValueSize / sizeof(size_type) > - word_count( ValueTraits::value_size( functor ) / sizeof(size_type) ); + const integral_nonzero_constant< size_type , ValueTraits::StaticValueSize / sizeof(value_type) > + word_count( ValueTraits::value_size( functor )/ sizeof(value_type) ); // Reduce the accumulation for the entire block. rocm_intra_block_reduce_scan<false,FunctorType,ArgTag>( functor , pointer_type(shared_data) ); @@ -534,54 +614,47 @@ bool rocm_single_inter_block_reduce_scan( const FunctorType & functor , { // Write accumulation total to global scratch space. // Accumulation total is the last thread's data. - size_type * const shared = shared_data + word_count.value * BlockSizeMask ; - size_type * const global = global_data + word_count.value * block_id ; - -#if (__ROCM_ARCH__ < 500) - for ( size_type i = team.team_rank() ; i < word_count.value ; i += team.team_size() ) { global[i] = shared[i] ; } -#else - for ( size_type i = 0 ; i < word_count.value ; i += 1 ) { global[i] = shared[i] ; } -#endif + value_type * const shared = shared_data + + word_count.value * BlockSizeMask ; + value_type * const global = global_data + word_count.value * block_id ; + for ( int i = int(threadIdx_y) ; i < word_count.value ; i += blockDim_y ) { global[i] = shared[i] ; } } // Contributing blocks note that their contribution has been completed via an atomic-increment flag // If this block is not the last block to contribute to this group then the block is done. - team.team_barrier(); + const bool is_last_block = - ! team.team_reduce( team.team_rank() ? 0 : ( 1 + atomicInc( global_flags , block_count - 1 ) < block_count ) ,Impl::JoinAdd<ValueType>()); - + ! __syncthreads_or( threadIdx_y ? 0 : ( 1 + atomicInc( global_flags , block_count - 1 ) < block_count ) ); if ( is_last_block ) { - const size_type b = ( long(block_count) * long(team.team_rank()) ) >> BlockSizeShift ; - const size_type e = ( long(block_count) * long( team.team_rank() + 1 ) ) >> BlockSizeShift ; + const size_type b = ( long(block_count) * long(threadIdx_y )) >> BlockSizeShift ; + const size_type e = ( long(block_count) * long(threadIdx_y + 1 ) ) >> BlockSizeShift ; { - void * const shared_ptr = shared_data + word_count.value * team.team_rank() ; - reference_type shared_value = ValueInit::init( functor , shared_ptr ); + value_type * const shared_ptr = shared_data + word_count.value * threadIdx_y ; + ValueInit::init( functor , shared_ptr ); + for ( size_type i = b ; i < e ; ++i ) { ValueJoin::join( functor , shared_ptr , global_data + word_count.value * i ); } } - rocm_intra_block_reduce_scan<DoScan,FunctorType,ArgTag>( functor , pointer_type(shared_data) ); if ( DoScan ) { + value_type * const shared_value = shared_data + word_count.value * ( threadIdx_y ? threadIdx_y - 1 : blockDim_y ); - size_type * const shared_value = shared_data + word_count.value * ( team.team_rank() ? team.team_rank() - 1 : team.team_size() ); - - if ( ! team.team_rank() ) { ValueInit::init( functor , shared_value ); } + if ( ! threadIdx_y ) { ValueInit::init( functor , shared_value ); } // Join previous inclusive scan value to each member for ( size_type i = b ; i < e ; ++i ) { - size_type * const global_value = global_data + word_count.value * i ; + value_type * const global_value = global_data + word_count.value * i ; ValueJoin::join( functor , shared_value , global_value ); ValueOps ::copy( functor , global_value , shared_value ); } } } - return is_last_block ; } @@ -592,7 +665,6 @@ unsigned rocm_single_inter_block_reduce_scan_shmem( const FunctorType & functor { return ( BlockSize + 2 ) * Impl::FunctorValueTraits< FunctorType , ArgTag >::value_size( functor ); } -#endif } // namespace Impl } // namespace Kokkos diff --git a/packages/kokkos/core/src/ROCm/Kokkos_ROCm_Scan.hpp b/packages/kokkos/core/src/ROCm/Kokkos_ROCm_Scan.hpp index 9890598bc980fcda3e2f1446d46689cc2d1332d2..f24db42cee09adefbbf7604a263a165b9a2d3f1e 100644 --- a/packages/kokkos/core/src/ROCm/Kokkos_ROCm_Scan.hpp +++ b/packages/kokkos/core/src/ROCm/Kokkos_ROCm_Scan.hpp @@ -98,7 +98,109 @@ void scan_enqueue( { auto j = i + d - 1; auto k = i + d2 - 1; -// join(k, j); // no longer needed with ROCm 1.6 + + ValueJoin::join(f, &buffer[k], &buffer[j]); + } + } + t_idx.barrier.wait(); + + result[tile] = buffer[buffer.size()-1]; + buffer[buffer.size()-1] = 0; + // Down sweep phase + for(std::size_t d=buffer.size()/2;d>0;d/=2) + { + auto d2 = 2*d; + auto i = local*d2; + if(i<len) + { + auto j = i + d - 1; + auto k = i + d2 - 1; + auto t = buffer[k]; + + ValueJoin::join(f, &buffer[k], &buffer[j]); + buffer[j] = t; + } + t_idx.barrier.wait(); + } + // Copy tiles into global memory + if (global < len) scratch[global] = buffer[local]; + }).wait(); + copy(result,result_cpu.data()); + + for(int i=1; i<td.num_tiles; i++) + ValueJoin::join(f, &result_cpu[i], &result_cpu[i-1]); + + copy(result_cpu.data(),result); + size_t launch_len = (((len - 1) / td.tile_size) + 1) * td.tile_size; + hc::parallel_for_each(hc::extent<1>(launch_len).tile(td.tile_size), [&,f,len,td](hc::tiled_index<1> t_idx) [[hc]] + { + const auto global = t_idx.global[0]; + const auto tile = t_idx.tile[0]; + + if (global < len) + { + auto final_state = scratch[global]; + + if (tile != 0) ValueJoin::join(f, &final_state, &result[tile-1]); + rocm_invoke<Tag>(f, transform_index(t_idx, td.tile_size, td.num_tiles), final_state, true); + } + }).wait(); +} + +template< class Tag, class ReturnType, class F, class TransformIndex> +void scan_enqueue( + const int len, + const F & f, + ReturnType & return_val, + TransformIndex transform_index) +{ + typedef Kokkos::Impl::FunctorValueTraits< F, Tag> ValueTraits; + typedef Kokkos::Impl::FunctorValueInit< F, Tag> ValueInit; + typedef Kokkos::Impl::FunctorValueJoin< F, Tag> ValueJoin; + typedef Kokkos::Impl::FunctorValueOps< F, Tag> ValueOps; + + typedef typename ValueTraits::value_type value_type; + typedef typename ValueTraits::pointer_type pointer_type; + typedef typename ValueTraits::reference_type reference_type; + + const auto td = get_tile_desc<value_type>(len); + std::vector<value_type> result_cpu(td.num_tiles); + hc::array<value_type> result(td.num_tiles); + hc::array<value_type> scratch(len); + std::vector<ReturnType> total_cpu(1); + hc::array<ReturnType> total(1); + + tile_for<value_type>(td, [&,f,len,td](hc::tiled_index<1> t_idx, tile_buffer<value_type> buffer) [[hc]] + { + const auto local = t_idx.local[0]; + const auto global = t_idx.global[0]; + const auto tile = t_idx.tile[0]; + + // Join tile buffer elements + const auto join = [&](std::size_t i, std::size_t j) + { + buffer.action_at(i, j, [&](value_type& x, const value_type& y) + { + ValueJoin::join(f, &x, &y); + }); + }; + + // Copy into tile + buffer.action_at(local, [&](value_type& state) + { + ValueInit::init(f, &state); + if (global < len) rocm_invoke<Tag>(f, transform_index(t_idx, td.tile_size, td.num_tiles), state, false); + }); + t_idx.barrier.wait(); + // Up sweep phase + for(std::size_t d=1;d<buffer.size();d*=2) + { + auto d2 = 2*d; + auto i = local*d2; + if(i<len) + { + auto j = i + d - 1; + auto k = i + d2 - 1; ValueJoin::join(f, &buffer[k], &buffer[j]); } } @@ -116,7 +218,6 @@ void scan_enqueue( auto j = i + d - 1; auto k = i + d2 - 1; auto t = buffer[k]; -// join(k, j); // no longer needed with ROCm 1.6 ValueJoin::join(f, &buffer[k], &buffer[j]); buffer[j] = t; } @@ -127,17 +228,13 @@ void scan_enqueue( }).wait(); copy(result,result_cpu.data()); -// The std::partial_sum was segfaulting, despite that this is cpu code. -// if(td.num_tiles>1) -// std::partial_sum(result_cpu.data(), result_cpu.data()+(td.num_tiles-1)*sizeof(value_type), result_cpu.data(), make_join_operator<ValueJoin>(f)); -// use this implementation instead. for(int i=1; i<td.num_tiles; i++) ValueJoin::join(f, &result_cpu[i], &result_cpu[i-1]); copy(result_cpu.data(),result); - hc::parallel_for_each(hc::extent<1>(len).tile(td.tile_size), [&,f,len,td](hc::tiled_index<1> t_idx) [[hc]] + size_t launch_len = (((len - 1) / td.tile_size) + 1) * td.tile_size; + hc::parallel_for_each(hc::extent<1>(launch_len).tile(td.tile_size), [&,f,len,td](hc::tiled_index<1> t_idx) [[hc]] { -// const auto local = t_idx.local[0]; const auto global = t_idx.global[0]; const auto tile = t_idx.tile[0]; @@ -145,12 +242,13 @@ void scan_enqueue( { auto final_state = scratch[global]; -// the join is locking up, at least with 1.6 - if (tile != 0) final_state += result[tile-1]; -// if (tile != 0) ValueJoin::join(f, &final_state, &result[tile-1]); + if (tile != 0) ValueJoin::join(f, &final_state, &result[tile-1]); rocm_invoke<Tag>(f, transform_index(t_idx, td.tile_size, td.num_tiles), final_state, true); + if(global==(len-1)) total[0] = final_state; } }).wait(); + copy(total,total_cpu.data()); + return_val = total_cpu[0]; } } // namespace Impl diff --git a/packages/kokkos/core/src/ROCm/Kokkos_ROCm_Space.cpp b/packages/kokkos/core/src/ROCm/Kokkos_ROCm_Space.cpp index 12f34373ce7536633cac85233b9721b25cca0f23..2fe0c4192d6b530fded431557c7f54f58225ec1c 100644 --- a/packages/kokkos/core/src/ROCm/Kokkos_ROCm_Space.cpp +++ b/packages/kokkos/core/src/ROCm/Kokkos_ROCm_Space.cpp @@ -362,6 +362,8 @@ SharedAllocationRecord( const Kokkos::Experimental::ROCmSpace & arg_space , arg_label.c_str() , SharedAllocationHeader::maximum_label_length ); + // Set last element zero, in case c_str is too long + header.m_label[SharedAllocationHeader::maximum_label_length - 1] = (char) 0; // Copy to device memory Kokkos::Impl::DeepCopy<Kokkos::Experimental::ROCmSpace,HostSpace>( RecordBase::m_alloc_ptr , & header , sizeof(SharedAllocationHeader) ); @@ -399,6 +401,8 @@ SharedAllocationRecord( const Kokkos::Experimental::ROCmHostPinnedSpace & arg_sp , arg_label.c_str() , SharedAllocationHeader::maximum_label_length ); + // Set last element zero, in case c_str is too long + RecordBase::m_alloc_ptr->m_label[SharedAllocationHeader::maximum_label_length - 1] = (char) 0; } //---------------------------------------------------------------------------- diff --git a/packages/kokkos/core/src/ROCm/Kokkos_ROCm_Tile.hpp b/packages/kokkos/core/src/ROCm/Kokkos_ROCm_Tile.hpp index db16db3f91d5b12c722d1d5585a99d25ad2444be..b4436ae156c2821e51fa307dfa6ce2b5dbf2cbb6 100644 --- a/packages/kokkos/core/src/ROCm/Kokkos_ROCm_Tile.hpp +++ b/packages/kokkos/core/src/ROCm/Kokkos_ROCm_Tile.hpp @@ -278,7 +278,7 @@ struct single_action void action_at(std::size_t i, Action a) [[hc]] { auto& value = static_cast<Derived&>(*this)[i]; -#if KOKKOS_ROCM_HAS_WORKAROUNDS +#ifdef KOKKOS_IMPL_ROCM_CLANG_WORKAROUND T state = value; a(state); value = state; @@ -347,7 +347,7 @@ struct tile_buffer<T[]> #if defined (ROCM15) a(value); #else -#if KOKKOS_ROCM_HAS_WORKAROUNDS +#ifdef KOKKOS_IMPL_ROCM_CLANG_WORKAROUND if (m > get_max_tile_array_size()) return; T state[get_max_tile_array_size()]; // std::copy(value, value+m, state); @@ -372,7 +372,6 @@ struct tile_buffer<T[]> #if defined (ROCM15) a(value); #else -//#if KOKKOS_ROCM_HAS_WORKAROUNDS if (m > get_max_tile_array_size()) return; T state[get_max_tile_array_size()]; // std::copy(value, value+m, state); diff --git a/packages/kokkos/core/src/Threads/Kokkos_ThreadsTeam.hpp b/packages/kokkos/core/src/Threads/Kokkos_ThreadsTeam.hpp index e63f868c59d1f8efab3beb96bcc222113126fb33..e88abdba5083928cbc6b60438aef983de821454e 100644 --- a/packages/kokkos/core/src/Threads/Kokkos_ThreadsTeam.hpp +++ b/packages/kokkos/core/src/Threads/Kokkos_ThreadsTeam.hpp @@ -175,6 +175,27 @@ public: #endif } + template<class Closure, class ValueType> + KOKKOS_INLINE_FUNCTION + void team_broadcast(Closure const & f, ValueType& value, const int& thread_id) const + { +#if ! defined( KOKKOS_ACTIVE_EXECUTION_MEMORY_SPACE_HOST ) + { } +#else + // Make sure there is enough scratch space: + typedef typename if_c< sizeof(ValueType) < TEAM_REDUCE_SIZE + , ValueType , void >::type type ; + f( value ); + if ( m_team_base ) { + type * const local_value = ((type*) m_team_base[0]->scratch_memory()); + if(team_rank() == thread_id) *local_value = value; + memory_fence(); + team_barrier(); + value = *local_value; + } +#endif + } + template< typename Type > KOKKOS_INLINE_FUNCTION typename std::enable_if< !Kokkos::is_reducer< Type >::value , Type>::type @@ -626,39 +647,77 @@ public: //---------------------------------------- +#ifdef KOKKOS_ENABLE_DEPRECATED_CODE template< class FunctorType > inline static int team_size_max( const FunctorType & ) { -#ifdef KOKKOS_ENABLE_DEPRECATED_CODE - int pool_size = traits::execution_space::thread_pool_size(1); -#else - int pool_size = traits::execution_space::impl_thread_pool_size(1); -#endif - int max_host_team_size = Impl::HostThreadTeamData::max_team_members; - return pool_size<max_host_team_size?pool_size:max_host_team_size; - } - + int pool_size = traits::execution_space::thread_pool_size(1); + int max_host_team_size = Impl::HostThreadTeamData::max_team_members; + return pool_size<max_host_team_size?pool_size:max_host_team_size; + } template< class FunctorType > - static int team_size_recommended( const FunctorType & ) - { -#ifdef KOKKOS_ENABLE_DEPRECATED_CODE - return traits::execution_space::thread_pool_size(2); -#else - return traits::execution_space::impl_thread_pool_size(2); -#endif - } - + inline static + int team_size_recommended( const FunctorType & ) + { + return traits::execution_space::thread_pool_size(2); + } template< class FunctorType > inline static int team_size_recommended( const FunctorType &, const int& ) - { + { + return traits::execution_space::thread_pool_size(2); + } +#endif + + template<class FunctorType> + int team_size_max( const FunctorType&, const ParallelForTag& ) const { +#ifdef KOKKOS_ENABLE_DEPRECATED_CODE + int pool_size = traits::execution_space::thread_pool_size(1); +#else + int pool_size = traits::execution_space::impl_thread_pool_size(1); +#endif + int max_host_team_size = Impl::HostThreadTeamData::max_team_members; + return pool_size<max_host_team_size?pool_size:max_host_team_size; + } + template<class FunctorType> + int team_size_max( const FunctorType&, const ParallelReduceTag& ) const { #ifdef KOKKOS_ENABLE_DEPRECATED_CODE - return traits::execution_space::thread_pool_size(2); + int pool_size = traits::execution_space::thread_pool_size(1); #else - return traits::execution_space::impl_thread_pool_size(2); + int pool_size = traits::execution_space::impl_thread_pool_size(1); #endif + int max_host_team_size = Impl::HostThreadTeamData::max_team_members; + return pool_size<max_host_team_size?pool_size:max_host_team_size; + } + template<class FunctorType> + int team_size_recommended( const FunctorType&, const ParallelForTag& ) const { +#ifdef KOKKOS_ENABLE_DEPRECATED_CODE + return traits::execution_space::thread_pool_size(2); +#else + return traits::execution_space::impl_thread_pool_size(2); +#endif + } + template<class FunctorType> + int team_size_recommended( const FunctorType&, const ParallelReduceTag& ) const { +#ifdef KOKKOS_ENABLE_DEPRECATED_CODE + return traits::execution_space::thread_pool_size(2); +#else + return traits::execution_space::impl_thread_pool_size(2); +#endif + } + + + inline static + int vector_length_max() + { return 1024; } // Use arbitrary large number, is meant as a vectorizable length + + inline static + int scratch_size_max(int level) + { return (level==0? + 1024*32: // Roughly L1 size + 20*1024*1024); // Limit to keep compatibility with CUDA } //---------------------------------------- diff --git a/packages/kokkos/core/src/eti/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_double_LayoutLeft_Rank1.cpp b/packages/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_double_LayoutLeft_Rank1.cpp similarity index 100% rename from packages/kokkos/core/src/eti/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_double_LayoutLeft_Rank1.cpp rename to packages/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_double_LayoutLeft_Rank1.cpp diff --git a/packages/kokkos/core/src/eti/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_double_LayoutLeft_Rank2.cpp b/packages/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_double_LayoutLeft_Rank2.cpp similarity index 100% rename from packages/kokkos/core/src/eti/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_double_LayoutLeft_Rank2.cpp rename to packages/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_double_LayoutLeft_Rank2.cpp diff --git a/packages/kokkos/core/src/eti/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_double_LayoutLeft_Rank3.cpp b/packages/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_double_LayoutLeft_Rank3.cpp similarity index 100% rename from packages/kokkos/core/src/eti/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_double_LayoutLeft_Rank3.cpp rename to packages/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_double_LayoutLeft_Rank3.cpp diff --git a/packages/kokkos/core/src/eti/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_double_LayoutLeft_Rank4.cpp b/packages/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_double_LayoutLeft_Rank4.cpp similarity index 100% rename from packages/kokkos/core/src/eti/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_double_LayoutLeft_Rank4.cpp rename to packages/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_double_LayoutLeft_Rank4.cpp diff --git a/packages/kokkos/core/src/eti/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_double_LayoutLeft_Rank5.cpp b/packages/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_double_LayoutLeft_Rank5.cpp similarity index 100% rename from packages/kokkos/core/src/eti/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_double_LayoutLeft_Rank5.cpp rename to packages/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_double_LayoutLeft_Rank5.cpp diff --git a/packages/kokkos/core/src/eti/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_double_LayoutLeft_Rank8.cpp b/packages/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_double_LayoutLeft_Rank8.cpp similarity index 100% rename from packages/kokkos/core/src/eti/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_double_LayoutLeft_Rank8.cpp rename to packages/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_double_LayoutLeft_Rank8.cpp diff --git a/packages/kokkos/core/src/eti/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_double_LayoutRight_Rank1.cpp b/packages/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_double_LayoutRight_Rank1.cpp similarity index 100% rename from packages/kokkos/core/src/eti/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_double_LayoutRight_Rank1.cpp rename to packages/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_double_LayoutRight_Rank1.cpp diff --git a/packages/kokkos/core/src/eti/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_double_LayoutRight_Rank2.cpp b/packages/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_double_LayoutRight_Rank2.cpp similarity index 100% rename from packages/kokkos/core/src/eti/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_double_LayoutRight_Rank2.cpp rename to packages/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_double_LayoutRight_Rank2.cpp diff --git a/packages/kokkos/core/src/eti/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_double_LayoutRight_Rank3.cpp b/packages/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_double_LayoutRight_Rank3.cpp similarity index 100% rename from packages/kokkos/core/src/eti/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_double_LayoutRight_Rank3.cpp rename to packages/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_double_LayoutRight_Rank3.cpp diff --git a/packages/kokkos/core/src/eti/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_double_LayoutRight_Rank4.cpp b/packages/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_double_LayoutRight_Rank4.cpp similarity index 100% rename from packages/kokkos/core/src/eti/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_double_LayoutRight_Rank4.cpp rename to packages/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_double_LayoutRight_Rank4.cpp diff --git a/packages/kokkos/core/src/eti/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_double_LayoutRight_Rank5.cpp b/packages/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_double_LayoutRight_Rank5.cpp similarity index 100% rename from packages/kokkos/core/src/eti/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_double_LayoutRight_Rank5.cpp rename to packages/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_double_LayoutRight_Rank5.cpp diff --git a/packages/kokkos/core/src/eti/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_double_LayoutRight_Rank8.cpp b/packages/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_double_LayoutRight_Rank8.cpp similarity index 100% rename from packages/kokkos/core/src/eti/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_double_LayoutRight_Rank8.cpp rename to packages/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_double_LayoutRight_Rank8.cpp diff --git a/packages/kokkos/core/src/eti/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_double_LayoutStride_Rank1.cpp b/packages/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_double_LayoutStride_Rank1.cpp similarity index 100% rename from packages/kokkos/core/src/eti/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_double_LayoutStride_Rank1.cpp rename to packages/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_double_LayoutStride_Rank1.cpp diff --git a/packages/kokkos/core/src/eti/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_double_LayoutStride_Rank2.cpp b/packages/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_double_LayoutStride_Rank2.cpp similarity index 100% rename from packages/kokkos/core/src/eti/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_double_LayoutStride_Rank2.cpp rename to packages/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_double_LayoutStride_Rank2.cpp diff --git a/packages/kokkos/core/src/eti/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_double_LayoutStride_Rank3.cpp b/packages/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_double_LayoutStride_Rank3.cpp similarity index 100% rename from packages/kokkos/core/src/eti/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_double_LayoutStride_Rank3.cpp rename to packages/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_double_LayoutStride_Rank3.cpp diff --git a/packages/kokkos/core/src/eti/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_double_LayoutStride_Rank4.cpp b/packages/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_double_LayoutStride_Rank4.cpp similarity index 100% rename from packages/kokkos/core/src/eti/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_double_LayoutStride_Rank4.cpp rename to packages/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_double_LayoutStride_Rank4.cpp diff --git a/packages/kokkos/core/src/eti/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_double_LayoutStride_Rank5.cpp b/packages/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_double_LayoutStride_Rank5.cpp similarity index 100% rename from packages/kokkos/core/src/eti/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_double_LayoutStride_Rank5.cpp rename to packages/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_double_LayoutStride_Rank5.cpp diff --git a/packages/kokkos/core/src/eti/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_double_LayoutStride_Rank8.cpp b/packages/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_double_LayoutStride_Rank8.cpp similarity index 100% rename from packages/kokkos/core/src/eti/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_double_LayoutStride_Rank8.cpp rename to packages/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_double_LayoutStride_Rank8.cpp diff --git a/packages/kokkos/core/src/eti/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_float_LayoutLeft_Rank1.cpp b/packages/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_float_LayoutLeft_Rank1.cpp similarity index 100% rename from packages/kokkos/core/src/eti/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_float_LayoutLeft_Rank1.cpp rename to packages/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_float_LayoutLeft_Rank1.cpp diff --git a/packages/kokkos/core/src/eti/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_float_LayoutLeft_Rank2.cpp b/packages/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_float_LayoutLeft_Rank2.cpp similarity index 100% rename from packages/kokkos/core/src/eti/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_float_LayoutLeft_Rank2.cpp rename to packages/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_float_LayoutLeft_Rank2.cpp diff --git a/packages/kokkos/core/src/eti/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_float_LayoutLeft_Rank3.cpp b/packages/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_float_LayoutLeft_Rank3.cpp similarity index 100% rename from packages/kokkos/core/src/eti/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_float_LayoutLeft_Rank3.cpp rename to packages/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_float_LayoutLeft_Rank3.cpp diff --git a/packages/kokkos/core/src/eti/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_float_LayoutLeft_Rank4.cpp b/packages/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_float_LayoutLeft_Rank4.cpp similarity index 100% rename from packages/kokkos/core/src/eti/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_float_LayoutLeft_Rank4.cpp rename to packages/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_float_LayoutLeft_Rank4.cpp diff --git a/packages/kokkos/core/src/eti/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_float_LayoutLeft_Rank5.cpp b/packages/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_float_LayoutLeft_Rank5.cpp similarity index 100% rename from packages/kokkos/core/src/eti/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_float_LayoutLeft_Rank5.cpp rename to packages/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_float_LayoutLeft_Rank5.cpp diff --git a/packages/kokkos/core/src/eti/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_float_LayoutLeft_Rank8.cpp b/packages/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_float_LayoutLeft_Rank8.cpp similarity index 100% rename from packages/kokkos/core/src/eti/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_float_LayoutLeft_Rank8.cpp rename to packages/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_float_LayoutLeft_Rank8.cpp diff --git a/packages/kokkos/core/src/eti/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_float_LayoutRight_Rank1.cpp b/packages/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_float_LayoutRight_Rank1.cpp similarity index 100% rename from packages/kokkos/core/src/eti/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_float_LayoutRight_Rank1.cpp rename to packages/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_float_LayoutRight_Rank1.cpp diff --git a/packages/kokkos/core/src/eti/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_float_LayoutRight_Rank2.cpp b/packages/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_float_LayoutRight_Rank2.cpp similarity index 100% rename from packages/kokkos/core/src/eti/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_float_LayoutRight_Rank2.cpp rename to packages/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_float_LayoutRight_Rank2.cpp diff --git a/packages/kokkos/core/src/eti/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_float_LayoutRight_Rank3.cpp b/packages/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_float_LayoutRight_Rank3.cpp similarity index 100% rename from packages/kokkos/core/src/eti/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_float_LayoutRight_Rank3.cpp rename to packages/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_float_LayoutRight_Rank3.cpp diff --git a/packages/kokkos/core/src/eti/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_float_LayoutRight_Rank4.cpp b/packages/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_float_LayoutRight_Rank4.cpp similarity index 100% rename from packages/kokkos/core/src/eti/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_float_LayoutRight_Rank4.cpp rename to packages/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_float_LayoutRight_Rank4.cpp diff --git a/packages/kokkos/core/src/eti/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_float_LayoutRight_Rank5.cpp b/packages/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_float_LayoutRight_Rank5.cpp similarity index 100% rename from packages/kokkos/core/src/eti/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_float_LayoutRight_Rank5.cpp rename to packages/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_float_LayoutRight_Rank5.cpp diff --git a/packages/kokkos/core/src/eti/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_float_LayoutRight_Rank8.cpp b/packages/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_float_LayoutRight_Rank8.cpp similarity index 100% rename from packages/kokkos/core/src/eti/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_float_LayoutRight_Rank8.cpp rename to packages/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_float_LayoutRight_Rank8.cpp diff --git a/packages/kokkos/core/src/eti/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_float_LayoutStride_Rank1.cpp b/packages/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_float_LayoutStride_Rank1.cpp similarity index 100% rename from packages/kokkos/core/src/eti/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_float_LayoutStride_Rank1.cpp rename to packages/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_float_LayoutStride_Rank1.cpp diff --git a/packages/kokkos/core/src/eti/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_float_LayoutStride_Rank2.cpp b/packages/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_float_LayoutStride_Rank2.cpp similarity index 100% rename from packages/kokkos/core/src/eti/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_float_LayoutStride_Rank2.cpp rename to packages/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_float_LayoutStride_Rank2.cpp diff --git a/packages/kokkos/core/src/eti/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_float_LayoutStride_Rank3.cpp b/packages/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_float_LayoutStride_Rank3.cpp similarity index 100% rename from packages/kokkos/core/src/eti/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_float_LayoutStride_Rank3.cpp rename to packages/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_float_LayoutStride_Rank3.cpp diff --git a/packages/kokkos/core/src/eti/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_float_LayoutStride_Rank4.cpp b/packages/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_float_LayoutStride_Rank4.cpp similarity index 100% rename from packages/kokkos/core/src/eti/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_float_LayoutStride_Rank4.cpp rename to packages/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_float_LayoutStride_Rank4.cpp diff --git a/packages/kokkos/core/src/eti/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_float_LayoutStride_Rank5.cpp b/packages/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_float_LayoutStride_Rank5.cpp similarity index 100% rename from packages/kokkos/core/src/eti/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_float_LayoutStride_Rank5.cpp rename to packages/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_float_LayoutStride_Rank5.cpp diff --git a/packages/kokkos/core/src/eti/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_float_LayoutStride_Rank8.cpp b/packages/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_float_LayoutStride_Rank8.cpp similarity index 100% rename from packages/kokkos/core/src/eti/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_float_LayoutStride_Rank8.cpp rename to packages/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_float_LayoutStride_Rank8.cpp diff --git a/packages/kokkos/core/src/eti/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_int64_t_LayoutLeft_Rank1.cpp b/packages/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_int64_t_LayoutLeft_Rank1.cpp similarity index 100% rename from packages/kokkos/core/src/eti/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_int64_t_LayoutLeft_Rank1.cpp rename to packages/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_int64_t_LayoutLeft_Rank1.cpp diff --git a/packages/kokkos/core/src/eti/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_int64_t_LayoutLeft_Rank2.cpp b/packages/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_int64_t_LayoutLeft_Rank2.cpp similarity index 100% rename from packages/kokkos/core/src/eti/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_int64_t_LayoutLeft_Rank2.cpp rename to packages/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_int64_t_LayoutLeft_Rank2.cpp diff --git a/packages/kokkos/core/src/eti/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_int64_t_LayoutLeft_Rank3.cpp b/packages/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_int64_t_LayoutLeft_Rank3.cpp similarity index 100% rename from packages/kokkos/core/src/eti/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_int64_t_LayoutLeft_Rank3.cpp rename to packages/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_int64_t_LayoutLeft_Rank3.cpp diff --git a/packages/kokkos/core/src/eti/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_int64_t_LayoutLeft_Rank4.cpp b/packages/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_int64_t_LayoutLeft_Rank4.cpp similarity index 100% rename from packages/kokkos/core/src/eti/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_int64_t_LayoutLeft_Rank4.cpp rename to packages/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_int64_t_LayoutLeft_Rank4.cpp diff --git a/packages/kokkos/core/src/eti/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_int64_t_LayoutLeft_Rank5.cpp b/packages/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_int64_t_LayoutLeft_Rank5.cpp similarity index 100% rename from packages/kokkos/core/src/eti/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_int64_t_LayoutLeft_Rank5.cpp rename to packages/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_int64_t_LayoutLeft_Rank5.cpp diff --git a/packages/kokkos/core/src/eti/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_int64_t_LayoutLeft_Rank8.cpp b/packages/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_int64_t_LayoutLeft_Rank8.cpp similarity index 100% rename from packages/kokkos/core/src/eti/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_int64_t_LayoutLeft_Rank8.cpp rename to packages/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_int64_t_LayoutLeft_Rank8.cpp diff --git a/packages/kokkos/core/src/eti/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_int64_t_LayoutRight_Rank1.cpp b/packages/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_int64_t_LayoutRight_Rank1.cpp similarity index 100% rename from packages/kokkos/core/src/eti/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_int64_t_LayoutRight_Rank1.cpp rename to packages/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_int64_t_LayoutRight_Rank1.cpp diff --git a/packages/kokkos/core/src/eti/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_int64_t_LayoutRight_Rank2.cpp b/packages/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_int64_t_LayoutRight_Rank2.cpp similarity index 100% rename from packages/kokkos/core/src/eti/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_int64_t_LayoutRight_Rank2.cpp rename to packages/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_int64_t_LayoutRight_Rank2.cpp diff --git a/packages/kokkos/core/src/eti/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_int64_t_LayoutRight_Rank3.cpp b/packages/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_int64_t_LayoutRight_Rank3.cpp similarity index 100% rename from packages/kokkos/core/src/eti/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_int64_t_LayoutRight_Rank3.cpp rename to packages/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_int64_t_LayoutRight_Rank3.cpp diff --git a/packages/kokkos/core/src/eti/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_int64_t_LayoutRight_Rank4.cpp b/packages/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_int64_t_LayoutRight_Rank4.cpp similarity index 100% rename from packages/kokkos/core/src/eti/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_int64_t_LayoutRight_Rank4.cpp rename to packages/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_int64_t_LayoutRight_Rank4.cpp diff --git a/packages/kokkos/core/src/eti/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_int64_t_LayoutRight_Rank5.cpp b/packages/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_int64_t_LayoutRight_Rank5.cpp similarity index 100% rename from packages/kokkos/core/src/eti/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_int64_t_LayoutRight_Rank5.cpp rename to packages/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_int64_t_LayoutRight_Rank5.cpp diff --git a/packages/kokkos/core/src/eti/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_int64_t_LayoutRight_Rank8.cpp b/packages/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_int64_t_LayoutRight_Rank8.cpp similarity index 100% rename from packages/kokkos/core/src/eti/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_int64_t_LayoutRight_Rank8.cpp rename to packages/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_int64_t_LayoutRight_Rank8.cpp diff --git a/packages/kokkos/core/src/eti/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_int64_t_LayoutStride_Rank1.cpp b/packages/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_int64_t_LayoutStride_Rank1.cpp similarity index 100% rename from packages/kokkos/core/src/eti/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_int64_t_LayoutStride_Rank1.cpp rename to packages/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_int64_t_LayoutStride_Rank1.cpp diff --git a/packages/kokkos/core/src/eti/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_int64_t_LayoutStride_Rank2.cpp b/packages/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_int64_t_LayoutStride_Rank2.cpp similarity index 100% rename from packages/kokkos/core/src/eti/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_int64_t_LayoutStride_Rank2.cpp rename to packages/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_int64_t_LayoutStride_Rank2.cpp diff --git a/packages/kokkos/core/src/eti/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_int64_t_LayoutStride_Rank3.cpp b/packages/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_int64_t_LayoutStride_Rank3.cpp similarity index 100% rename from packages/kokkos/core/src/eti/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_int64_t_LayoutStride_Rank3.cpp rename to packages/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_int64_t_LayoutStride_Rank3.cpp diff --git a/packages/kokkos/core/src/eti/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_int64_t_LayoutStride_Rank4.cpp b/packages/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_int64_t_LayoutStride_Rank4.cpp similarity index 100% rename from packages/kokkos/core/src/eti/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_int64_t_LayoutStride_Rank4.cpp rename to packages/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_int64_t_LayoutStride_Rank4.cpp diff --git a/packages/kokkos/core/src/eti/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_int64_t_LayoutStride_Rank5.cpp b/packages/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_int64_t_LayoutStride_Rank5.cpp similarity index 100% rename from packages/kokkos/core/src/eti/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_int64_t_LayoutStride_Rank5.cpp rename to packages/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_int64_t_LayoutStride_Rank5.cpp diff --git a/packages/kokkos/core/src/eti/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_int64_t_LayoutStride_Rank8.cpp b/packages/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_int64_t_LayoutStride_Rank8.cpp similarity index 100% rename from packages/kokkos/core/src/eti/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_int64_t_LayoutStride_Rank8.cpp rename to packages/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_int64_t_LayoutStride_Rank8.cpp diff --git a/packages/kokkos/core/src/eti/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_int_LayoutLeft_Rank1.cpp b/packages/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_int_LayoutLeft_Rank1.cpp similarity index 100% rename from packages/kokkos/core/src/eti/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_int_LayoutLeft_Rank1.cpp rename to packages/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_int_LayoutLeft_Rank1.cpp diff --git a/packages/kokkos/core/src/eti/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_int_LayoutLeft_Rank2.cpp b/packages/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_int_LayoutLeft_Rank2.cpp similarity index 100% rename from packages/kokkos/core/src/eti/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_int_LayoutLeft_Rank2.cpp rename to packages/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_int_LayoutLeft_Rank2.cpp diff --git a/packages/kokkos/core/src/eti/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_int_LayoutLeft_Rank3.cpp b/packages/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_int_LayoutLeft_Rank3.cpp similarity index 100% rename from packages/kokkos/core/src/eti/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_int_LayoutLeft_Rank3.cpp rename to packages/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_int_LayoutLeft_Rank3.cpp diff --git a/packages/kokkos/core/src/eti/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_int_LayoutLeft_Rank4.cpp b/packages/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_int_LayoutLeft_Rank4.cpp similarity index 100% rename from packages/kokkos/core/src/eti/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_int_LayoutLeft_Rank4.cpp rename to packages/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_int_LayoutLeft_Rank4.cpp diff --git a/packages/kokkos/core/src/eti/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_int_LayoutLeft_Rank5.cpp b/packages/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_int_LayoutLeft_Rank5.cpp similarity index 100% rename from packages/kokkos/core/src/eti/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_int_LayoutLeft_Rank5.cpp rename to packages/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_int_LayoutLeft_Rank5.cpp diff --git a/packages/kokkos/core/src/eti/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_int_LayoutLeft_Rank8.cpp b/packages/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_int_LayoutLeft_Rank8.cpp similarity index 100% rename from packages/kokkos/core/src/eti/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_int_LayoutLeft_Rank8.cpp rename to packages/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_int_LayoutLeft_Rank8.cpp diff --git a/packages/kokkos/core/src/eti/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_int_LayoutRight_Rank1.cpp b/packages/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_int_LayoutRight_Rank1.cpp similarity index 100% rename from packages/kokkos/core/src/eti/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_int_LayoutRight_Rank1.cpp rename to packages/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_int_LayoutRight_Rank1.cpp diff --git a/packages/kokkos/core/src/eti/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_int_LayoutRight_Rank2.cpp b/packages/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_int_LayoutRight_Rank2.cpp similarity index 100% rename from packages/kokkos/core/src/eti/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_int_LayoutRight_Rank2.cpp rename to packages/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_int_LayoutRight_Rank2.cpp diff --git a/packages/kokkos/core/src/eti/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_int_LayoutRight_Rank3.cpp b/packages/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_int_LayoutRight_Rank3.cpp similarity index 100% rename from packages/kokkos/core/src/eti/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_int_LayoutRight_Rank3.cpp rename to packages/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_int_LayoutRight_Rank3.cpp diff --git a/packages/kokkos/core/src/eti/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_int_LayoutRight_Rank4.cpp b/packages/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_int_LayoutRight_Rank4.cpp similarity index 100% rename from packages/kokkos/core/src/eti/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_int_LayoutRight_Rank4.cpp rename to packages/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_int_LayoutRight_Rank4.cpp diff --git a/packages/kokkos/core/src/eti/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_int_LayoutRight_Rank5.cpp b/packages/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_int_LayoutRight_Rank5.cpp similarity index 100% rename from packages/kokkos/core/src/eti/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_int_LayoutRight_Rank5.cpp rename to packages/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_int_LayoutRight_Rank5.cpp diff --git a/packages/kokkos/core/src/eti/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_int_LayoutRight_Rank8.cpp b/packages/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_int_LayoutRight_Rank8.cpp similarity index 100% rename from packages/kokkos/core/src/eti/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_int_LayoutRight_Rank8.cpp rename to packages/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_int_LayoutRight_Rank8.cpp diff --git a/packages/kokkos/core/src/eti/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_int_LayoutStride_Rank1.cpp b/packages/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_int_LayoutStride_Rank1.cpp similarity index 100% rename from packages/kokkos/core/src/eti/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_int_LayoutStride_Rank1.cpp rename to packages/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_int_LayoutStride_Rank1.cpp diff --git a/packages/kokkos/core/src/eti/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_int_LayoutStride_Rank2.cpp b/packages/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_int_LayoutStride_Rank2.cpp similarity index 100% rename from packages/kokkos/core/src/eti/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_int_LayoutStride_Rank2.cpp rename to packages/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_int_LayoutStride_Rank2.cpp diff --git a/packages/kokkos/core/src/eti/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_int_LayoutStride_Rank3.cpp b/packages/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_int_LayoutStride_Rank3.cpp similarity index 100% rename from packages/kokkos/core/src/eti/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_int_LayoutStride_Rank3.cpp rename to packages/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_int_LayoutStride_Rank3.cpp diff --git a/packages/kokkos/core/src/eti/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_int_LayoutStride_Rank4.cpp b/packages/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_int_LayoutStride_Rank4.cpp similarity index 100% rename from packages/kokkos/core/src/eti/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_int_LayoutStride_Rank4.cpp rename to packages/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_int_LayoutStride_Rank4.cpp diff --git a/packages/kokkos/core/src/eti/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_int_LayoutStride_Rank5.cpp b/packages/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_int_LayoutStride_Rank5.cpp similarity index 100% rename from packages/kokkos/core/src/eti/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_int_LayoutStride_Rank5.cpp rename to packages/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_int_LayoutStride_Rank5.cpp diff --git a/packages/kokkos/core/src/eti/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_int_LayoutStride_Rank8.cpp b/packages/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_int_LayoutStride_Rank8.cpp similarity index 100% rename from packages/kokkos/core/src/eti/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_int_LayoutStride_Rank8.cpp rename to packages/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_int_LayoutStride_Rank8.cpp diff --git a/packages/kokkos/core/src/eti/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int_double_LayoutLeft_Rank1.cpp b/packages/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_double_LayoutLeft_Rank1.cpp similarity index 100% rename from packages/kokkos/core/src/eti/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int_double_LayoutLeft_Rank1.cpp rename to packages/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_double_LayoutLeft_Rank1.cpp diff --git a/packages/kokkos/core/src/eti/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int_double_LayoutLeft_Rank2.cpp b/packages/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_double_LayoutLeft_Rank2.cpp similarity index 100% rename from packages/kokkos/core/src/eti/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int_double_LayoutLeft_Rank2.cpp rename to packages/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_double_LayoutLeft_Rank2.cpp diff --git a/packages/kokkos/core/src/eti/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int_double_LayoutLeft_Rank3.cpp b/packages/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_double_LayoutLeft_Rank3.cpp similarity index 100% rename from packages/kokkos/core/src/eti/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int_double_LayoutLeft_Rank3.cpp rename to packages/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_double_LayoutLeft_Rank3.cpp diff --git a/packages/kokkos/core/src/eti/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int_double_LayoutLeft_Rank4.cpp b/packages/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_double_LayoutLeft_Rank4.cpp similarity index 100% rename from packages/kokkos/core/src/eti/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int_double_LayoutLeft_Rank4.cpp rename to packages/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_double_LayoutLeft_Rank4.cpp diff --git a/packages/kokkos/core/src/eti/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int_double_LayoutLeft_Rank5.cpp b/packages/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_double_LayoutLeft_Rank5.cpp similarity index 100% rename from packages/kokkos/core/src/eti/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int_double_LayoutLeft_Rank5.cpp rename to packages/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_double_LayoutLeft_Rank5.cpp diff --git a/packages/kokkos/core/src/eti/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int_double_LayoutLeft_Rank8.cpp b/packages/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_double_LayoutLeft_Rank8.cpp similarity index 100% rename from packages/kokkos/core/src/eti/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int_double_LayoutLeft_Rank8.cpp rename to packages/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_double_LayoutLeft_Rank8.cpp diff --git a/packages/kokkos/core/src/eti/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int_double_LayoutRight_Rank1.cpp b/packages/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_double_LayoutRight_Rank1.cpp similarity index 100% rename from packages/kokkos/core/src/eti/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int_double_LayoutRight_Rank1.cpp rename to packages/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_double_LayoutRight_Rank1.cpp diff --git a/packages/kokkos/core/src/eti/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int_double_LayoutRight_Rank2.cpp b/packages/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_double_LayoutRight_Rank2.cpp similarity index 100% rename from packages/kokkos/core/src/eti/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int_double_LayoutRight_Rank2.cpp rename to packages/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_double_LayoutRight_Rank2.cpp diff --git a/packages/kokkos/core/src/eti/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int_double_LayoutRight_Rank3.cpp b/packages/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_double_LayoutRight_Rank3.cpp similarity index 100% rename from packages/kokkos/core/src/eti/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int_double_LayoutRight_Rank3.cpp rename to packages/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_double_LayoutRight_Rank3.cpp diff --git a/packages/kokkos/core/src/eti/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int_double_LayoutRight_Rank4.cpp b/packages/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_double_LayoutRight_Rank4.cpp similarity index 100% rename from packages/kokkos/core/src/eti/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int_double_LayoutRight_Rank4.cpp rename to packages/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_double_LayoutRight_Rank4.cpp diff --git a/packages/kokkos/core/src/eti/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int_double_LayoutRight_Rank5.cpp b/packages/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_double_LayoutRight_Rank5.cpp similarity index 100% rename from packages/kokkos/core/src/eti/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int_double_LayoutRight_Rank5.cpp rename to packages/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_double_LayoutRight_Rank5.cpp diff --git a/packages/kokkos/core/src/eti/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int_double_LayoutRight_Rank8.cpp b/packages/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_double_LayoutRight_Rank8.cpp similarity index 100% rename from packages/kokkos/core/src/eti/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int_double_LayoutRight_Rank8.cpp rename to packages/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_double_LayoutRight_Rank8.cpp diff --git a/packages/kokkos/core/src/eti/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int_double_LayoutStride_Rank1.cpp b/packages/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_double_LayoutStride_Rank1.cpp similarity index 100% rename from packages/kokkos/core/src/eti/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int_double_LayoutStride_Rank1.cpp rename to packages/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_double_LayoutStride_Rank1.cpp diff --git a/packages/kokkos/core/src/eti/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int_double_LayoutStride_Rank2.cpp b/packages/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_double_LayoutStride_Rank2.cpp similarity index 100% rename from packages/kokkos/core/src/eti/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int_double_LayoutStride_Rank2.cpp rename to packages/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_double_LayoutStride_Rank2.cpp diff --git a/packages/kokkos/core/src/eti/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int_double_LayoutStride_Rank3.cpp b/packages/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_double_LayoutStride_Rank3.cpp similarity index 100% rename from packages/kokkos/core/src/eti/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int_double_LayoutStride_Rank3.cpp rename to packages/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_double_LayoutStride_Rank3.cpp diff --git a/packages/kokkos/core/src/eti/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int_double_LayoutStride_Rank4.cpp b/packages/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_double_LayoutStride_Rank4.cpp similarity index 100% rename from packages/kokkos/core/src/eti/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int_double_LayoutStride_Rank4.cpp rename to packages/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_double_LayoutStride_Rank4.cpp diff --git a/packages/kokkos/core/src/eti/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int_double_LayoutStride_Rank5.cpp b/packages/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_double_LayoutStride_Rank5.cpp similarity index 100% rename from packages/kokkos/core/src/eti/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int_double_LayoutStride_Rank5.cpp rename to packages/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_double_LayoutStride_Rank5.cpp diff --git a/packages/kokkos/core/src/eti/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int_double_LayoutStride_Rank8.cpp b/packages/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_double_LayoutStride_Rank8.cpp similarity index 100% rename from packages/kokkos/core/src/eti/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int_double_LayoutStride_Rank8.cpp rename to packages/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_double_LayoutStride_Rank8.cpp diff --git a/packages/kokkos/core/src/eti/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int_float_LayoutLeft_Rank1.cpp b/packages/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_float_LayoutLeft_Rank1.cpp similarity index 100% rename from packages/kokkos/core/src/eti/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int_float_LayoutLeft_Rank1.cpp rename to packages/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_float_LayoutLeft_Rank1.cpp diff --git a/packages/kokkos/core/src/eti/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int_float_LayoutLeft_Rank2.cpp b/packages/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_float_LayoutLeft_Rank2.cpp similarity index 100% rename from packages/kokkos/core/src/eti/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int_float_LayoutLeft_Rank2.cpp rename to packages/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_float_LayoutLeft_Rank2.cpp diff --git a/packages/kokkos/core/src/eti/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int_float_LayoutLeft_Rank3.cpp b/packages/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_float_LayoutLeft_Rank3.cpp similarity index 100% rename from packages/kokkos/core/src/eti/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int_float_LayoutLeft_Rank3.cpp rename to packages/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_float_LayoutLeft_Rank3.cpp diff --git a/packages/kokkos/core/src/eti/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int_float_LayoutLeft_Rank4.cpp b/packages/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_float_LayoutLeft_Rank4.cpp similarity index 100% rename from packages/kokkos/core/src/eti/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int_float_LayoutLeft_Rank4.cpp rename to packages/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_float_LayoutLeft_Rank4.cpp diff --git a/packages/kokkos/core/src/eti/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int_float_LayoutLeft_Rank5.cpp b/packages/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_float_LayoutLeft_Rank5.cpp similarity index 100% rename from packages/kokkos/core/src/eti/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int_float_LayoutLeft_Rank5.cpp rename to packages/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_float_LayoutLeft_Rank5.cpp diff --git a/packages/kokkos/core/src/eti/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int_float_LayoutLeft_Rank8.cpp b/packages/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_float_LayoutLeft_Rank8.cpp similarity index 100% rename from packages/kokkos/core/src/eti/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int_float_LayoutLeft_Rank8.cpp rename to packages/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_float_LayoutLeft_Rank8.cpp diff --git a/packages/kokkos/core/src/eti/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int_float_LayoutRight_Rank1.cpp b/packages/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_float_LayoutRight_Rank1.cpp similarity index 100% rename from packages/kokkos/core/src/eti/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int_float_LayoutRight_Rank1.cpp rename to packages/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_float_LayoutRight_Rank1.cpp diff --git a/packages/kokkos/core/src/eti/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int_float_LayoutRight_Rank2.cpp b/packages/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_float_LayoutRight_Rank2.cpp similarity index 100% rename from packages/kokkos/core/src/eti/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int_float_LayoutRight_Rank2.cpp rename to packages/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_float_LayoutRight_Rank2.cpp diff --git a/packages/kokkos/core/src/eti/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int_float_LayoutRight_Rank3.cpp b/packages/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_float_LayoutRight_Rank3.cpp similarity index 100% rename from packages/kokkos/core/src/eti/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int_float_LayoutRight_Rank3.cpp rename to packages/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_float_LayoutRight_Rank3.cpp diff --git a/packages/kokkos/core/src/eti/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int_float_LayoutRight_Rank4.cpp b/packages/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_float_LayoutRight_Rank4.cpp similarity index 100% rename from packages/kokkos/core/src/eti/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int_float_LayoutRight_Rank4.cpp rename to packages/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_float_LayoutRight_Rank4.cpp diff --git a/packages/kokkos/core/src/eti/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int_float_LayoutRight_Rank5.cpp b/packages/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_float_LayoutRight_Rank5.cpp similarity index 100% rename from packages/kokkos/core/src/eti/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int_float_LayoutRight_Rank5.cpp rename to packages/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_float_LayoutRight_Rank5.cpp diff --git a/packages/kokkos/core/src/eti/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int_float_LayoutRight_Rank8.cpp b/packages/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_float_LayoutRight_Rank8.cpp similarity index 100% rename from packages/kokkos/core/src/eti/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int_float_LayoutRight_Rank8.cpp rename to packages/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_float_LayoutRight_Rank8.cpp diff --git a/packages/kokkos/core/src/eti/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int_float_LayoutStride_Rank1.cpp b/packages/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_float_LayoutStride_Rank1.cpp similarity index 100% rename from packages/kokkos/core/src/eti/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int_float_LayoutStride_Rank1.cpp rename to packages/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_float_LayoutStride_Rank1.cpp diff --git a/packages/kokkos/core/src/eti/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int_float_LayoutStride_Rank2.cpp b/packages/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_float_LayoutStride_Rank2.cpp similarity index 100% rename from packages/kokkos/core/src/eti/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int_float_LayoutStride_Rank2.cpp rename to packages/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_float_LayoutStride_Rank2.cpp diff --git a/packages/kokkos/core/src/eti/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int_float_LayoutStride_Rank3.cpp b/packages/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_float_LayoutStride_Rank3.cpp similarity index 100% rename from packages/kokkos/core/src/eti/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int_float_LayoutStride_Rank3.cpp rename to packages/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_float_LayoutStride_Rank3.cpp diff --git a/packages/kokkos/core/src/eti/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int_float_LayoutStride_Rank4.cpp b/packages/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_float_LayoutStride_Rank4.cpp similarity index 100% rename from packages/kokkos/core/src/eti/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int_float_LayoutStride_Rank4.cpp rename to packages/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_float_LayoutStride_Rank4.cpp diff --git a/packages/kokkos/core/src/eti/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int_float_LayoutStride_Rank5.cpp b/packages/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_float_LayoutStride_Rank5.cpp similarity index 100% rename from packages/kokkos/core/src/eti/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int_float_LayoutStride_Rank5.cpp rename to packages/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_float_LayoutStride_Rank5.cpp diff --git a/packages/kokkos/core/src/eti/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int_float_LayoutStride_Rank8.cpp b/packages/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_float_LayoutStride_Rank8.cpp similarity index 100% rename from packages/kokkos/core/src/eti/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int_float_LayoutStride_Rank8.cpp rename to packages/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_float_LayoutStride_Rank8.cpp diff --git a/packages/kokkos/core/src/eti/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int_int64_t_LayoutLeft_Rank1.cpp b/packages/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_int64_t_LayoutLeft_Rank1.cpp similarity index 100% rename from packages/kokkos/core/src/eti/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int_int64_t_LayoutLeft_Rank1.cpp rename to packages/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_int64_t_LayoutLeft_Rank1.cpp diff --git a/packages/kokkos/core/src/eti/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int_int64_t_LayoutLeft_Rank2.cpp b/packages/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_int64_t_LayoutLeft_Rank2.cpp similarity index 100% rename from packages/kokkos/core/src/eti/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int_int64_t_LayoutLeft_Rank2.cpp rename to packages/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_int64_t_LayoutLeft_Rank2.cpp diff --git a/packages/kokkos/core/src/eti/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int_int64_t_LayoutLeft_Rank3.cpp b/packages/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_int64_t_LayoutLeft_Rank3.cpp similarity index 100% rename from packages/kokkos/core/src/eti/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int_int64_t_LayoutLeft_Rank3.cpp rename to packages/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_int64_t_LayoutLeft_Rank3.cpp diff --git a/packages/kokkos/core/src/eti/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int_int64_t_LayoutLeft_Rank4.cpp b/packages/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_int64_t_LayoutLeft_Rank4.cpp similarity index 100% rename from packages/kokkos/core/src/eti/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int_int64_t_LayoutLeft_Rank4.cpp rename to packages/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_int64_t_LayoutLeft_Rank4.cpp diff --git a/packages/kokkos/core/src/eti/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int_int64_t_LayoutLeft_Rank5.cpp b/packages/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_int64_t_LayoutLeft_Rank5.cpp similarity index 100% rename from packages/kokkos/core/src/eti/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int_int64_t_LayoutLeft_Rank5.cpp rename to packages/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_int64_t_LayoutLeft_Rank5.cpp diff --git a/packages/kokkos/core/src/eti/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int_int64_t_LayoutLeft_Rank8.cpp b/packages/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_int64_t_LayoutLeft_Rank8.cpp similarity index 100% rename from packages/kokkos/core/src/eti/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int_int64_t_LayoutLeft_Rank8.cpp rename to packages/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_int64_t_LayoutLeft_Rank8.cpp diff --git a/packages/kokkos/core/src/eti/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int_int64_t_LayoutRight_Rank1.cpp b/packages/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_int64_t_LayoutRight_Rank1.cpp similarity index 100% rename from packages/kokkos/core/src/eti/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int_int64_t_LayoutRight_Rank1.cpp rename to packages/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_int64_t_LayoutRight_Rank1.cpp diff --git a/packages/kokkos/core/src/eti/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int_int64_t_LayoutRight_Rank2.cpp b/packages/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_int64_t_LayoutRight_Rank2.cpp similarity index 100% rename from packages/kokkos/core/src/eti/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int_int64_t_LayoutRight_Rank2.cpp rename to packages/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_int64_t_LayoutRight_Rank2.cpp diff --git a/packages/kokkos/core/src/eti/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int_int64_t_LayoutRight_Rank3.cpp b/packages/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_int64_t_LayoutRight_Rank3.cpp similarity index 100% rename from packages/kokkos/core/src/eti/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int_int64_t_LayoutRight_Rank3.cpp rename to packages/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_int64_t_LayoutRight_Rank3.cpp diff --git a/packages/kokkos/core/src/eti/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int_int64_t_LayoutRight_Rank4.cpp b/packages/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_int64_t_LayoutRight_Rank4.cpp similarity index 100% rename from packages/kokkos/core/src/eti/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int_int64_t_LayoutRight_Rank4.cpp rename to packages/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_int64_t_LayoutRight_Rank4.cpp diff --git a/packages/kokkos/core/src/eti/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int_int64_t_LayoutRight_Rank5.cpp b/packages/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_int64_t_LayoutRight_Rank5.cpp similarity index 100% rename from packages/kokkos/core/src/eti/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int_int64_t_LayoutRight_Rank5.cpp rename to packages/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_int64_t_LayoutRight_Rank5.cpp diff --git a/packages/kokkos/core/src/eti/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int_int64_t_LayoutRight_Rank8.cpp b/packages/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_int64_t_LayoutRight_Rank8.cpp similarity index 100% rename from packages/kokkos/core/src/eti/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int_int64_t_LayoutRight_Rank8.cpp rename to packages/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_int64_t_LayoutRight_Rank8.cpp diff --git a/packages/kokkos/core/src/eti/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int_int64_t_LayoutStride_Rank1.cpp b/packages/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_int64_t_LayoutStride_Rank1.cpp similarity index 100% rename from packages/kokkos/core/src/eti/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int_int64_t_LayoutStride_Rank1.cpp rename to packages/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_int64_t_LayoutStride_Rank1.cpp diff --git a/packages/kokkos/core/src/eti/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int_int64_t_LayoutStride_Rank2.cpp b/packages/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_int64_t_LayoutStride_Rank2.cpp similarity index 100% rename from packages/kokkos/core/src/eti/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int_int64_t_LayoutStride_Rank2.cpp rename to packages/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_int64_t_LayoutStride_Rank2.cpp diff --git a/packages/kokkos/core/src/eti/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int_int64_t_LayoutStride_Rank3.cpp b/packages/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_int64_t_LayoutStride_Rank3.cpp similarity index 100% rename from packages/kokkos/core/src/eti/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int_int64_t_LayoutStride_Rank3.cpp rename to packages/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_int64_t_LayoutStride_Rank3.cpp diff --git a/packages/kokkos/core/src/eti/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int_int64_t_LayoutStride_Rank4.cpp b/packages/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_int64_t_LayoutStride_Rank4.cpp similarity index 100% rename from packages/kokkos/core/src/eti/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int_int64_t_LayoutStride_Rank4.cpp rename to packages/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_int64_t_LayoutStride_Rank4.cpp diff --git a/packages/kokkos/core/src/eti/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int_int64_t_LayoutStride_Rank5.cpp b/packages/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_int64_t_LayoutStride_Rank5.cpp similarity index 100% rename from packages/kokkos/core/src/eti/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int_int64_t_LayoutStride_Rank5.cpp rename to packages/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_int64_t_LayoutStride_Rank5.cpp diff --git a/packages/kokkos/core/src/eti/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int_int64_t_LayoutStride_Rank8.cpp b/packages/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_int64_t_LayoutStride_Rank8.cpp similarity index 100% rename from packages/kokkos/core/src/eti/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int_int64_t_LayoutStride_Rank8.cpp rename to packages/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_int64_t_LayoutStride_Rank8.cpp diff --git a/packages/kokkos/core/src/eti/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int_int_LayoutLeft_Rank1.cpp b/packages/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_int_LayoutLeft_Rank1.cpp similarity index 100% rename from packages/kokkos/core/src/eti/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int_int_LayoutLeft_Rank1.cpp rename to packages/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_int_LayoutLeft_Rank1.cpp diff --git a/packages/kokkos/core/src/eti/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int_int_LayoutLeft_Rank2.cpp b/packages/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_int_LayoutLeft_Rank2.cpp similarity index 100% rename from packages/kokkos/core/src/eti/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int_int_LayoutLeft_Rank2.cpp rename to packages/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_int_LayoutLeft_Rank2.cpp diff --git a/packages/kokkos/core/src/eti/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int_int_LayoutLeft_Rank3.cpp b/packages/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_int_LayoutLeft_Rank3.cpp similarity index 100% rename from packages/kokkos/core/src/eti/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int_int_LayoutLeft_Rank3.cpp rename to packages/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_int_LayoutLeft_Rank3.cpp diff --git a/packages/kokkos/core/src/eti/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int_int_LayoutLeft_Rank4.cpp b/packages/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_int_LayoutLeft_Rank4.cpp similarity index 100% rename from packages/kokkos/core/src/eti/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int_int_LayoutLeft_Rank4.cpp rename to packages/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_int_LayoutLeft_Rank4.cpp diff --git a/packages/kokkos/core/src/eti/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int_int_LayoutLeft_Rank5.cpp b/packages/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_int_LayoutLeft_Rank5.cpp similarity index 100% rename from packages/kokkos/core/src/eti/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int_int_LayoutLeft_Rank5.cpp rename to packages/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_int_LayoutLeft_Rank5.cpp diff --git a/packages/kokkos/core/src/eti/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int_int_LayoutLeft_Rank8.cpp b/packages/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_int_LayoutLeft_Rank8.cpp similarity index 100% rename from packages/kokkos/core/src/eti/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int_int_LayoutLeft_Rank8.cpp rename to packages/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_int_LayoutLeft_Rank8.cpp diff --git a/packages/kokkos/core/src/eti/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int_int_LayoutRight_Rank1.cpp b/packages/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_int_LayoutRight_Rank1.cpp similarity index 100% rename from packages/kokkos/core/src/eti/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int_int_LayoutRight_Rank1.cpp rename to packages/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_int_LayoutRight_Rank1.cpp diff --git a/packages/kokkos/core/src/eti/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int_int_LayoutRight_Rank2.cpp b/packages/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_int_LayoutRight_Rank2.cpp similarity index 100% rename from packages/kokkos/core/src/eti/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int_int_LayoutRight_Rank2.cpp rename to packages/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_int_LayoutRight_Rank2.cpp diff --git a/packages/kokkos/core/src/eti/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int_int_LayoutRight_Rank3.cpp b/packages/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_int_LayoutRight_Rank3.cpp similarity index 100% rename from packages/kokkos/core/src/eti/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int_int_LayoutRight_Rank3.cpp rename to packages/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_int_LayoutRight_Rank3.cpp diff --git a/packages/kokkos/core/src/eti/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int_int_LayoutRight_Rank4.cpp b/packages/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_int_LayoutRight_Rank4.cpp similarity index 100% rename from packages/kokkos/core/src/eti/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int_int_LayoutRight_Rank4.cpp rename to packages/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_int_LayoutRight_Rank4.cpp diff --git a/packages/kokkos/core/src/eti/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int_int_LayoutRight_Rank5.cpp b/packages/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_int_LayoutRight_Rank5.cpp similarity index 100% rename from packages/kokkos/core/src/eti/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int_int_LayoutRight_Rank5.cpp rename to packages/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_int_LayoutRight_Rank5.cpp diff --git a/packages/kokkos/core/src/eti/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int_int_LayoutRight_Rank8.cpp b/packages/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_int_LayoutRight_Rank8.cpp similarity index 100% rename from packages/kokkos/core/src/eti/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int_int_LayoutRight_Rank8.cpp rename to packages/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_int_LayoutRight_Rank8.cpp diff --git a/packages/kokkos/core/src/eti/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int_int_LayoutStride_Rank1.cpp b/packages/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_int_LayoutStride_Rank1.cpp similarity index 100% rename from packages/kokkos/core/src/eti/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int_int_LayoutStride_Rank1.cpp rename to packages/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_int_LayoutStride_Rank1.cpp diff --git a/packages/kokkos/core/src/eti/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int_int_LayoutStride_Rank2.cpp b/packages/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_int_LayoutStride_Rank2.cpp similarity index 100% rename from packages/kokkos/core/src/eti/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int_int_LayoutStride_Rank2.cpp rename to packages/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_int_LayoutStride_Rank2.cpp diff --git a/packages/kokkos/core/src/eti/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int_int_LayoutStride_Rank3.cpp b/packages/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_int_LayoutStride_Rank3.cpp similarity index 100% rename from packages/kokkos/core/src/eti/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int_int_LayoutStride_Rank3.cpp rename to packages/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_int_LayoutStride_Rank3.cpp diff --git a/packages/kokkos/core/src/eti/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int_int_LayoutStride_Rank4.cpp b/packages/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_int_LayoutStride_Rank4.cpp similarity index 100% rename from packages/kokkos/core/src/eti/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int_int_LayoutStride_Rank4.cpp rename to packages/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_int_LayoutStride_Rank4.cpp diff --git a/packages/kokkos/core/src/eti/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int_int_LayoutStride_Rank5.cpp b/packages/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_int_LayoutStride_Rank5.cpp similarity index 100% rename from packages/kokkos/core/src/eti/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int_int_LayoutStride_Rank5.cpp rename to packages/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_int_LayoutStride_Rank5.cpp diff --git a/packages/kokkos/core/src/eti/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int_int_LayoutStride_Rank8.cpp b/packages/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_int_LayoutStride_Rank8.cpp similarity index 100% rename from packages/kokkos/core/src/eti/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int_int_LayoutStride_Rank8.cpp rename to packages/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_int_LayoutStride_Rank8.cpp diff --git a/packages/kokkos/core/src/eti/ROCm/Makefile.eti_Experimental::ROCm b/packages/kokkos/core/src/eti/ROCm/Makefile.eti_Experimental::ROCm deleted file mode 100644 index 054360fd172ca08c8984a05e4993a4844e04fed5..0000000000000000000000000000000000000000 --- a/packages/kokkos/core/src/eti/ROCm/Makefile.eti_Experimental::ROCm +++ /dev/null @@ -1,288 +0,0 @@ -Kokkos_Experimental::ROCm_ViewCopyETIInst_int_int_LayoutLeft_Rank1.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int_int_LayoutLeft_Rank1.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int_int_LayoutLeft_Rank1.cpp -Kokkos_Experimental::ROCm_ViewCopyETIInst_int_int_LayoutLeft_Rank2.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int_int_LayoutLeft_Rank2.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int_int_LayoutLeft_Rank2.cpp -Kokkos_Experimental::ROCm_ViewCopyETIInst_int_int_LayoutLeft_Rank3.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int_int_LayoutLeft_Rank3.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int_int_LayoutLeft_Rank3.cpp -Kokkos_Experimental::ROCm_ViewCopyETIInst_int_int_LayoutLeft_Rank4.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int_int_LayoutLeft_Rank4.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int_int_LayoutLeft_Rank4.cpp -Kokkos_Experimental::ROCm_ViewCopyETIInst_int_int_LayoutLeft_Rank5.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int_int_LayoutLeft_Rank5.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int_int_LayoutLeft_Rank5.cpp -Kokkos_Experimental::ROCm_ViewCopyETIInst_int_int_LayoutLeft_Rank8.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int_int_LayoutLeft_Rank8.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int_int_LayoutLeft_Rank8.cpp -Kokkos_Experimental::ROCm_ViewCopyETIInst_int_int_LayoutRight_Rank1.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int_int_LayoutRight_Rank1.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int_int_LayoutRight_Rank1.cpp -Kokkos_Experimental::ROCm_ViewCopyETIInst_int_int_LayoutRight_Rank2.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int_int_LayoutRight_Rank2.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int_int_LayoutRight_Rank2.cpp -Kokkos_Experimental::ROCm_ViewCopyETIInst_int_int_LayoutRight_Rank3.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int_int_LayoutRight_Rank3.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int_int_LayoutRight_Rank3.cpp -Kokkos_Experimental::ROCm_ViewCopyETIInst_int_int_LayoutRight_Rank4.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int_int_LayoutRight_Rank4.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int_int_LayoutRight_Rank4.cpp -Kokkos_Experimental::ROCm_ViewCopyETIInst_int_int_LayoutRight_Rank5.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int_int_LayoutRight_Rank5.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int_int_LayoutRight_Rank5.cpp -Kokkos_Experimental::ROCm_ViewCopyETIInst_int_int_LayoutRight_Rank8.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int_int_LayoutRight_Rank8.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int_int_LayoutRight_Rank8.cpp -Kokkos_Experimental::ROCm_ViewCopyETIInst_int_int_LayoutStride_Rank1.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int_int_LayoutStride_Rank1.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int_int_LayoutStride_Rank1.cpp -Kokkos_Experimental::ROCm_ViewCopyETIInst_int_int_LayoutStride_Rank2.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int_int_LayoutStride_Rank2.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int_int_LayoutStride_Rank2.cpp -Kokkos_Experimental::ROCm_ViewCopyETIInst_int_int_LayoutStride_Rank3.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int_int_LayoutStride_Rank3.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int_int_LayoutStride_Rank3.cpp -Kokkos_Experimental::ROCm_ViewCopyETIInst_int_int_LayoutStride_Rank4.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int_int_LayoutStride_Rank4.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int_int_LayoutStride_Rank4.cpp -Kokkos_Experimental::ROCm_ViewCopyETIInst_int_int_LayoutStride_Rank5.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int_int_LayoutStride_Rank5.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int_int_LayoutStride_Rank5.cpp -Kokkos_Experimental::ROCm_ViewCopyETIInst_int_int_LayoutStride_Rank8.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int_int_LayoutStride_Rank8.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int_int_LayoutStride_Rank8.cpp -Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_int_LayoutLeft_Rank1.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_int_LayoutLeft_Rank1.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_int_LayoutLeft_Rank1.cpp -Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_int_LayoutLeft_Rank2.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_int_LayoutLeft_Rank2.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_int_LayoutLeft_Rank2.cpp -Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_int_LayoutLeft_Rank3.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_int_LayoutLeft_Rank3.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_int_LayoutLeft_Rank3.cpp -Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_int_LayoutLeft_Rank4.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_int_LayoutLeft_Rank4.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_int_LayoutLeft_Rank4.cpp -Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_int_LayoutLeft_Rank5.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_int_LayoutLeft_Rank5.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_int_LayoutLeft_Rank5.cpp -Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_int_LayoutLeft_Rank8.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_int_LayoutLeft_Rank8.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_int_LayoutLeft_Rank8.cpp -Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_int_LayoutRight_Rank1.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_int_LayoutRight_Rank1.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_int_LayoutRight_Rank1.cpp -Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_int_LayoutRight_Rank2.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_int_LayoutRight_Rank2.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_int_LayoutRight_Rank2.cpp -Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_int_LayoutRight_Rank3.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_int_LayoutRight_Rank3.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_int_LayoutRight_Rank3.cpp -Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_int_LayoutRight_Rank4.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_int_LayoutRight_Rank4.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_int_LayoutRight_Rank4.cpp -Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_int_LayoutRight_Rank5.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_int_LayoutRight_Rank5.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_int_LayoutRight_Rank5.cpp -Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_int_LayoutRight_Rank8.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_int_LayoutRight_Rank8.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_int_LayoutRight_Rank8.cpp -Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_int_LayoutStride_Rank1.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_int_LayoutStride_Rank1.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_int_LayoutStride_Rank1.cpp -Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_int_LayoutStride_Rank2.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_int_LayoutStride_Rank2.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_int_LayoutStride_Rank2.cpp -Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_int_LayoutStride_Rank3.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_int_LayoutStride_Rank3.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_int_LayoutStride_Rank3.cpp -Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_int_LayoutStride_Rank4.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_int_LayoutStride_Rank4.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_int_LayoutStride_Rank4.cpp -Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_int_LayoutStride_Rank5.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_int_LayoutStride_Rank5.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_int_LayoutStride_Rank5.cpp -Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_int_LayoutStride_Rank8.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_int_LayoutStride_Rank8.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_int_LayoutStride_Rank8.cpp -Kokkos_Experimental::ROCm_ViewCopyETIInst_int_int64_t_LayoutLeft_Rank1.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int_int64_t_LayoutLeft_Rank1.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int_int64_t_LayoutLeft_Rank1.cpp -Kokkos_Experimental::ROCm_ViewCopyETIInst_int_int64_t_LayoutLeft_Rank2.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int_int64_t_LayoutLeft_Rank2.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int_int64_t_LayoutLeft_Rank2.cpp -Kokkos_Experimental::ROCm_ViewCopyETIInst_int_int64_t_LayoutLeft_Rank3.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int_int64_t_LayoutLeft_Rank3.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int_int64_t_LayoutLeft_Rank3.cpp -Kokkos_Experimental::ROCm_ViewCopyETIInst_int_int64_t_LayoutLeft_Rank4.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int_int64_t_LayoutLeft_Rank4.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int_int64_t_LayoutLeft_Rank4.cpp -Kokkos_Experimental::ROCm_ViewCopyETIInst_int_int64_t_LayoutLeft_Rank5.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int_int64_t_LayoutLeft_Rank5.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int_int64_t_LayoutLeft_Rank5.cpp -Kokkos_Experimental::ROCm_ViewCopyETIInst_int_int64_t_LayoutLeft_Rank8.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int_int64_t_LayoutLeft_Rank8.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int_int64_t_LayoutLeft_Rank8.cpp -Kokkos_Experimental::ROCm_ViewCopyETIInst_int_int64_t_LayoutRight_Rank1.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int_int64_t_LayoutRight_Rank1.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int_int64_t_LayoutRight_Rank1.cpp -Kokkos_Experimental::ROCm_ViewCopyETIInst_int_int64_t_LayoutRight_Rank2.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int_int64_t_LayoutRight_Rank2.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int_int64_t_LayoutRight_Rank2.cpp -Kokkos_Experimental::ROCm_ViewCopyETIInst_int_int64_t_LayoutRight_Rank3.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int_int64_t_LayoutRight_Rank3.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int_int64_t_LayoutRight_Rank3.cpp -Kokkos_Experimental::ROCm_ViewCopyETIInst_int_int64_t_LayoutRight_Rank4.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int_int64_t_LayoutRight_Rank4.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int_int64_t_LayoutRight_Rank4.cpp -Kokkos_Experimental::ROCm_ViewCopyETIInst_int_int64_t_LayoutRight_Rank5.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int_int64_t_LayoutRight_Rank5.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int_int64_t_LayoutRight_Rank5.cpp -Kokkos_Experimental::ROCm_ViewCopyETIInst_int_int64_t_LayoutRight_Rank8.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int_int64_t_LayoutRight_Rank8.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int_int64_t_LayoutRight_Rank8.cpp -Kokkos_Experimental::ROCm_ViewCopyETIInst_int_int64_t_LayoutStride_Rank1.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int_int64_t_LayoutStride_Rank1.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int_int64_t_LayoutStride_Rank1.cpp -Kokkos_Experimental::ROCm_ViewCopyETIInst_int_int64_t_LayoutStride_Rank2.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int_int64_t_LayoutStride_Rank2.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int_int64_t_LayoutStride_Rank2.cpp -Kokkos_Experimental::ROCm_ViewCopyETIInst_int_int64_t_LayoutStride_Rank3.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int_int64_t_LayoutStride_Rank3.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int_int64_t_LayoutStride_Rank3.cpp -Kokkos_Experimental::ROCm_ViewCopyETIInst_int_int64_t_LayoutStride_Rank4.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int_int64_t_LayoutStride_Rank4.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int_int64_t_LayoutStride_Rank4.cpp -Kokkos_Experimental::ROCm_ViewCopyETIInst_int_int64_t_LayoutStride_Rank5.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int_int64_t_LayoutStride_Rank5.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int_int64_t_LayoutStride_Rank5.cpp -Kokkos_Experimental::ROCm_ViewCopyETIInst_int_int64_t_LayoutStride_Rank8.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int_int64_t_LayoutStride_Rank8.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int_int64_t_LayoutStride_Rank8.cpp -Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_int64_t_LayoutLeft_Rank1.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_int64_t_LayoutLeft_Rank1.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_int64_t_LayoutLeft_Rank1.cpp -Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_int64_t_LayoutLeft_Rank2.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_int64_t_LayoutLeft_Rank2.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_int64_t_LayoutLeft_Rank2.cpp -Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_int64_t_LayoutLeft_Rank3.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_int64_t_LayoutLeft_Rank3.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_int64_t_LayoutLeft_Rank3.cpp -Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_int64_t_LayoutLeft_Rank4.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_int64_t_LayoutLeft_Rank4.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_int64_t_LayoutLeft_Rank4.cpp -Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_int64_t_LayoutLeft_Rank5.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_int64_t_LayoutLeft_Rank5.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_int64_t_LayoutLeft_Rank5.cpp -Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_int64_t_LayoutLeft_Rank8.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_int64_t_LayoutLeft_Rank8.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_int64_t_LayoutLeft_Rank8.cpp -Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_int64_t_LayoutRight_Rank1.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_int64_t_LayoutRight_Rank1.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_int64_t_LayoutRight_Rank1.cpp -Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_int64_t_LayoutRight_Rank2.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_int64_t_LayoutRight_Rank2.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_int64_t_LayoutRight_Rank2.cpp -Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_int64_t_LayoutRight_Rank3.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_int64_t_LayoutRight_Rank3.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_int64_t_LayoutRight_Rank3.cpp -Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_int64_t_LayoutRight_Rank4.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_int64_t_LayoutRight_Rank4.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_int64_t_LayoutRight_Rank4.cpp -Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_int64_t_LayoutRight_Rank5.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_int64_t_LayoutRight_Rank5.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_int64_t_LayoutRight_Rank5.cpp -Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_int64_t_LayoutRight_Rank8.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_int64_t_LayoutRight_Rank8.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_int64_t_LayoutRight_Rank8.cpp -Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_int64_t_LayoutStride_Rank1.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_int64_t_LayoutStride_Rank1.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_int64_t_LayoutStride_Rank1.cpp -Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_int64_t_LayoutStride_Rank2.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_int64_t_LayoutStride_Rank2.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_int64_t_LayoutStride_Rank2.cpp -Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_int64_t_LayoutStride_Rank3.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_int64_t_LayoutStride_Rank3.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_int64_t_LayoutStride_Rank3.cpp -Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_int64_t_LayoutStride_Rank4.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_int64_t_LayoutStride_Rank4.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_int64_t_LayoutStride_Rank4.cpp -Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_int64_t_LayoutStride_Rank5.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_int64_t_LayoutStride_Rank5.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_int64_t_LayoutStride_Rank5.cpp -Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_int64_t_LayoutStride_Rank8.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_int64_t_LayoutStride_Rank8.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_int64_t_LayoutStride_Rank8.cpp -Kokkos_Experimental::ROCm_ViewCopyETIInst_int_float_LayoutLeft_Rank1.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int_float_LayoutLeft_Rank1.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int_float_LayoutLeft_Rank1.cpp -Kokkos_Experimental::ROCm_ViewCopyETIInst_int_float_LayoutLeft_Rank2.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int_float_LayoutLeft_Rank2.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int_float_LayoutLeft_Rank2.cpp -Kokkos_Experimental::ROCm_ViewCopyETIInst_int_float_LayoutLeft_Rank3.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int_float_LayoutLeft_Rank3.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int_float_LayoutLeft_Rank3.cpp -Kokkos_Experimental::ROCm_ViewCopyETIInst_int_float_LayoutLeft_Rank4.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int_float_LayoutLeft_Rank4.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int_float_LayoutLeft_Rank4.cpp -Kokkos_Experimental::ROCm_ViewCopyETIInst_int_float_LayoutLeft_Rank5.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int_float_LayoutLeft_Rank5.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int_float_LayoutLeft_Rank5.cpp -Kokkos_Experimental::ROCm_ViewCopyETIInst_int_float_LayoutLeft_Rank8.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int_float_LayoutLeft_Rank8.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int_float_LayoutLeft_Rank8.cpp -Kokkos_Experimental::ROCm_ViewCopyETIInst_int_float_LayoutRight_Rank1.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int_float_LayoutRight_Rank1.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int_float_LayoutRight_Rank1.cpp -Kokkos_Experimental::ROCm_ViewCopyETIInst_int_float_LayoutRight_Rank2.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int_float_LayoutRight_Rank2.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int_float_LayoutRight_Rank2.cpp -Kokkos_Experimental::ROCm_ViewCopyETIInst_int_float_LayoutRight_Rank3.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int_float_LayoutRight_Rank3.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int_float_LayoutRight_Rank3.cpp -Kokkos_Experimental::ROCm_ViewCopyETIInst_int_float_LayoutRight_Rank4.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int_float_LayoutRight_Rank4.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int_float_LayoutRight_Rank4.cpp -Kokkos_Experimental::ROCm_ViewCopyETIInst_int_float_LayoutRight_Rank5.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int_float_LayoutRight_Rank5.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int_float_LayoutRight_Rank5.cpp -Kokkos_Experimental::ROCm_ViewCopyETIInst_int_float_LayoutRight_Rank8.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int_float_LayoutRight_Rank8.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int_float_LayoutRight_Rank8.cpp -Kokkos_Experimental::ROCm_ViewCopyETIInst_int_float_LayoutStride_Rank1.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int_float_LayoutStride_Rank1.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int_float_LayoutStride_Rank1.cpp -Kokkos_Experimental::ROCm_ViewCopyETIInst_int_float_LayoutStride_Rank2.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int_float_LayoutStride_Rank2.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int_float_LayoutStride_Rank2.cpp -Kokkos_Experimental::ROCm_ViewCopyETIInst_int_float_LayoutStride_Rank3.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int_float_LayoutStride_Rank3.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int_float_LayoutStride_Rank3.cpp -Kokkos_Experimental::ROCm_ViewCopyETIInst_int_float_LayoutStride_Rank4.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int_float_LayoutStride_Rank4.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int_float_LayoutStride_Rank4.cpp -Kokkos_Experimental::ROCm_ViewCopyETIInst_int_float_LayoutStride_Rank5.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int_float_LayoutStride_Rank5.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int_float_LayoutStride_Rank5.cpp -Kokkos_Experimental::ROCm_ViewCopyETIInst_int_float_LayoutStride_Rank8.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int_float_LayoutStride_Rank8.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int_float_LayoutStride_Rank8.cpp -Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_float_LayoutLeft_Rank1.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_float_LayoutLeft_Rank1.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_float_LayoutLeft_Rank1.cpp -Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_float_LayoutLeft_Rank2.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_float_LayoutLeft_Rank2.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_float_LayoutLeft_Rank2.cpp -Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_float_LayoutLeft_Rank3.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_float_LayoutLeft_Rank3.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_float_LayoutLeft_Rank3.cpp -Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_float_LayoutLeft_Rank4.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_float_LayoutLeft_Rank4.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_float_LayoutLeft_Rank4.cpp -Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_float_LayoutLeft_Rank5.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_float_LayoutLeft_Rank5.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_float_LayoutLeft_Rank5.cpp -Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_float_LayoutLeft_Rank8.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_float_LayoutLeft_Rank8.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_float_LayoutLeft_Rank8.cpp -Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_float_LayoutRight_Rank1.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_float_LayoutRight_Rank1.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_float_LayoutRight_Rank1.cpp -Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_float_LayoutRight_Rank2.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_float_LayoutRight_Rank2.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_float_LayoutRight_Rank2.cpp -Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_float_LayoutRight_Rank3.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_float_LayoutRight_Rank3.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_float_LayoutRight_Rank3.cpp -Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_float_LayoutRight_Rank4.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_float_LayoutRight_Rank4.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_float_LayoutRight_Rank4.cpp -Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_float_LayoutRight_Rank5.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_float_LayoutRight_Rank5.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_float_LayoutRight_Rank5.cpp -Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_float_LayoutRight_Rank8.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_float_LayoutRight_Rank8.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_float_LayoutRight_Rank8.cpp -Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_float_LayoutStride_Rank1.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_float_LayoutStride_Rank1.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_float_LayoutStride_Rank1.cpp -Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_float_LayoutStride_Rank2.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_float_LayoutStride_Rank2.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_float_LayoutStride_Rank2.cpp -Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_float_LayoutStride_Rank3.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_float_LayoutStride_Rank3.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_float_LayoutStride_Rank3.cpp -Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_float_LayoutStride_Rank4.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_float_LayoutStride_Rank4.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_float_LayoutStride_Rank4.cpp -Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_float_LayoutStride_Rank5.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_float_LayoutStride_Rank5.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_float_LayoutStride_Rank5.cpp -Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_float_LayoutStride_Rank8.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_float_LayoutStride_Rank8.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_float_LayoutStride_Rank8.cpp -Kokkos_Experimental::ROCm_ViewCopyETIInst_int_double_LayoutLeft_Rank1.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int_double_LayoutLeft_Rank1.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int_double_LayoutLeft_Rank1.cpp -Kokkos_Experimental::ROCm_ViewCopyETIInst_int_double_LayoutLeft_Rank2.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int_double_LayoutLeft_Rank2.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int_double_LayoutLeft_Rank2.cpp -Kokkos_Experimental::ROCm_ViewCopyETIInst_int_double_LayoutLeft_Rank3.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int_double_LayoutLeft_Rank3.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int_double_LayoutLeft_Rank3.cpp -Kokkos_Experimental::ROCm_ViewCopyETIInst_int_double_LayoutLeft_Rank4.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int_double_LayoutLeft_Rank4.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int_double_LayoutLeft_Rank4.cpp -Kokkos_Experimental::ROCm_ViewCopyETIInst_int_double_LayoutLeft_Rank5.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int_double_LayoutLeft_Rank5.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int_double_LayoutLeft_Rank5.cpp -Kokkos_Experimental::ROCm_ViewCopyETIInst_int_double_LayoutLeft_Rank8.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int_double_LayoutLeft_Rank8.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int_double_LayoutLeft_Rank8.cpp -Kokkos_Experimental::ROCm_ViewCopyETIInst_int_double_LayoutRight_Rank1.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int_double_LayoutRight_Rank1.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int_double_LayoutRight_Rank1.cpp -Kokkos_Experimental::ROCm_ViewCopyETIInst_int_double_LayoutRight_Rank2.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int_double_LayoutRight_Rank2.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int_double_LayoutRight_Rank2.cpp -Kokkos_Experimental::ROCm_ViewCopyETIInst_int_double_LayoutRight_Rank3.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int_double_LayoutRight_Rank3.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int_double_LayoutRight_Rank3.cpp -Kokkos_Experimental::ROCm_ViewCopyETIInst_int_double_LayoutRight_Rank4.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int_double_LayoutRight_Rank4.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int_double_LayoutRight_Rank4.cpp -Kokkos_Experimental::ROCm_ViewCopyETIInst_int_double_LayoutRight_Rank5.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int_double_LayoutRight_Rank5.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int_double_LayoutRight_Rank5.cpp -Kokkos_Experimental::ROCm_ViewCopyETIInst_int_double_LayoutRight_Rank8.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int_double_LayoutRight_Rank8.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int_double_LayoutRight_Rank8.cpp -Kokkos_Experimental::ROCm_ViewCopyETIInst_int_double_LayoutStride_Rank1.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int_double_LayoutStride_Rank1.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int_double_LayoutStride_Rank1.cpp -Kokkos_Experimental::ROCm_ViewCopyETIInst_int_double_LayoutStride_Rank2.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int_double_LayoutStride_Rank2.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int_double_LayoutStride_Rank2.cpp -Kokkos_Experimental::ROCm_ViewCopyETIInst_int_double_LayoutStride_Rank3.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int_double_LayoutStride_Rank3.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int_double_LayoutStride_Rank3.cpp -Kokkos_Experimental::ROCm_ViewCopyETIInst_int_double_LayoutStride_Rank4.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int_double_LayoutStride_Rank4.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int_double_LayoutStride_Rank4.cpp -Kokkos_Experimental::ROCm_ViewCopyETIInst_int_double_LayoutStride_Rank5.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int_double_LayoutStride_Rank5.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int_double_LayoutStride_Rank5.cpp -Kokkos_Experimental::ROCm_ViewCopyETIInst_int_double_LayoutStride_Rank8.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int_double_LayoutStride_Rank8.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int_double_LayoutStride_Rank8.cpp -Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_double_LayoutLeft_Rank1.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_double_LayoutLeft_Rank1.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_double_LayoutLeft_Rank1.cpp -Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_double_LayoutLeft_Rank2.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_double_LayoutLeft_Rank2.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_double_LayoutLeft_Rank2.cpp -Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_double_LayoutLeft_Rank3.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_double_LayoutLeft_Rank3.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_double_LayoutLeft_Rank3.cpp -Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_double_LayoutLeft_Rank4.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_double_LayoutLeft_Rank4.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_double_LayoutLeft_Rank4.cpp -Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_double_LayoutLeft_Rank5.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_double_LayoutLeft_Rank5.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_double_LayoutLeft_Rank5.cpp -Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_double_LayoutLeft_Rank8.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_double_LayoutLeft_Rank8.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_double_LayoutLeft_Rank8.cpp -Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_double_LayoutRight_Rank1.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_double_LayoutRight_Rank1.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_double_LayoutRight_Rank1.cpp -Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_double_LayoutRight_Rank2.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_double_LayoutRight_Rank2.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_double_LayoutRight_Rank2.cpp -Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_double_LayoutRight_Rank3.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_double_LayoutRight_Rank3.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_double_LayoutRight_Rank3.cpp -Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_double_LayoutRight_Rank4.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_double_LayoutRight_Rank4.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_double_LayoutRight_Rank4.cpp -Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_double_LayoutRight_Rank5.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_double_LayoutRight_Rank5.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_double_LayoutRight_Rank5.cpp -Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_double_LayoutRight_Rank8.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_double_LayoutRight_Rank8.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_double_LayoutRight_Rank8.cpp -Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_double_LayoutStride_Rank1.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_double_LayoutStride_Rank1.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_double_LayoutStride_Rank1.cpp -Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_double_LayoutStride_Rank2.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_double_LayoutStride_Rank2.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_double_LayoutStride_Rank2.cpp -Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_double_LayoutStride_Rank3.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_double_LayoutStride_Rank3.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_double_LayoutStride_Rank3.cpp -Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_double_LayoutStride_Rank4.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_double_LayoutStride_Rank4.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_double_LayoutStride_Rank4.cpp -Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_double_LayoutStride_Rank5.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_double_LayoutStride_Rank5.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_double_LayoutStride_Rank5.cpp -Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_double_LayoutStride_Rank8.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_double_LayoutStride_Rank8.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_double_LayoutStride_Rank8.cpp diff --git a/packages/kokkos/core/src/eti/ROCm/Makefile.eti_ROCm b/packages/kokkos/core/src/eti/ROCm/Makefile.eti_ROCm new file mode 100644 index 0000000000000000000000000000000000000000..0423c6feb6fe26f6896f9be4f3e21033494f48d2 --- /dev/null +++ b/packages/kokkos/core/src/eti/ROCm/Makefile.eti_ROCm @@ -0,0 +1,288 @@ +Kokkos_ROCm_ViewCopyETIInst_int_int_LayoutLeft_Rank1.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_int_LayoutLeft_Rank1.cpp + $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_int_LayoutLeft_Rank1.cpp +Kokkos_ROCm_ViewCopyETIInst_int_int_LayoutLeft_Rank2.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_int_LayoutLeft_Rank2.cpp + $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_int_LayoutLeft_Rank2.cpp +Kokkos_ROCm_ViewCopyETIInst_int_int_LayoutLeft_Rank3.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_int_LayoutLeft_Rank3.cpp + $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_int_LayoutLeft_Rank3.cpp +Kokkos_ROCm_ViewCopyETIInst_int_int_LayoutLeft_Rank4.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_int_LayoutLeft_Rank4.cpp + $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_int_LayoutLeft_Rank4.cpp +Kokkos_ROCm_ViewCopyETIInst_int_int_LayoutLeft_Rank5.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_int_LayoutLeft_Rank5.cpp + $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_int_LayoutLeft_Rank5.cpp +Kokkos_ROCm_ViewCopyETIInst_int_int_LayoutLeft_Rank8.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_int_LayoutLeft_Rank8.cpp + $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_int_LayoutLeft_Rank8.cpp +Kokkos_ROCm_ViewCopyETIInst_int_int_LayoutRight_Rank1.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_int_LayoutRight_Rank1.cpp + $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_int_LayoutRight_Rank1.cpp +Kokkos_ROCm_ViewCopyETIInst_int_int_LayoutRight_Rank2.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_int_LayoutRight_Rank2.cpp + $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_int_LayoutRight_Rank2.cpp +Kokkos_ROCm_ViewCopyETIInst_int_int_LayoutRight_Rank3.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_int_LayoutRight_Rank3.cpp + $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_int_LayoutRight_Rank3.cpp +Kokkos_ROCm_ViewCopyETIInst_int_int_LayoutRight_Rank4.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_int_LayoutRight_Rank4.cpp + $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_int_LayoutRight_Rank4.cpp +Kokkos_ROCm_ViewCopyETIInst_int_int_LayoutRight_Rank5.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_int_LayoutRight_Rank5.cpp + $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_int_LayoutRight_Rank5.cpp +Kokkos_ROCm_ViewCopyETIInst_int_int_LayoutRight_Rank8.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_int_LayoutRight_Rank8.cpp + $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_int_LayoutRight_Rank8.cpp +Kokkos_ROCm_ViewCopyETIInst_int_int_LayoutStride_Rank1.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_int_LayoutStride_Rank1.cpp + $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_int_LayoutStride_Rank1.cpp +Kokkos_ROCm_ViewCopyETIInst_int_int_LayoutStride_Rank2.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_int_LayoutStride_Rank2.cpp + $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_int_LayoutStride_Rank2.cpp +Kokkos_ROCm_ViewCopyETIInst_int_int_LayoutStride_Rank3.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_int_LayoutStride_Rank3.cpp + $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_int_LayoutStride_Rank3.cpp +Kokkos_ROCm_ViewCopyETIInst_int_int_LayoutStride_Rank4.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_int_LayoutStride_Rank4.cpp + $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_int_LayoutStride_Rank4.cpp +Kokkos_ROCm_ViewCopyETIInst_int_int_LayoutStride_Rank5.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_int_LayoutStride_Rank5.cpp + $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_int_LayoutStride_Rank5.cpp +Kokkos_ROCm_ViewCopyETIInst_int_int_LayoutStride_Rank8.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_int_LayoutStride_Rank8.cpp + $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_int_LayoutStride_Rank8.cpp +Kokkos_ROCm_ViewCopyETIInst_int64_t_int_LayoutLeft_Rank1.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_int_LayoutLeft_Rank1.cpp + $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_int_LayoutLeft_Rank1.cpp +Kokkos_ROCm_ViewCopyETIInst_int64_t_int_LayoutLeft_Rank2.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_int_LayoutLeft_Rank2.cpp + $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_int_LayoutLeft_Rank2.cpp +Kokkos_ROCm_ViewCopyETIInst_int64_t_int_LayoutLeft_Rank3.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_int_LayoutLeft_Rank3.cpp + $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_int_LayoutLeft_Rank3.cpp +Kokkos_ROCm_ViewCopyETIInst_int64_t_int_LayoutLeft_Rank4.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_int_LayoutLeft_Rank4.cpp + $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_int_LayoutLeft_Rank4.cpp +Kokkos_ROCm_ViewCopyETIInst_int64_t_int_LayoutLeft_Rank5.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_int_LayoutLeft_Rank5.cpp + $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_int_LayoutLeft_Rank5.cpp +Kokkos_ROCm_ViewCopyETIInst_int64_t_int_LayoutLeft_Rank8.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_int_LayoutLeft_Rank8.cpp + $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_int_LayoutLeft_Rank8.cpp +Kokkos_ROCm_ViewCopyETIInst_int64_t_int_LayoutRight_Rank1.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_int_LayoutRight_Rank1.cpp + $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_int_LayoutRight_Rank1.cpp +Kokkos_ROCm_ViewCopyETIInst_int64_t_int_LayoutRight_Rank2.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_int_LayoutRight_Rank2.cpp + $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_int_LayoutRight_Rank2.cpp +Kokkos_ROCm_ViewCopyETIInst_int64_t_int_LayoutRight_Rank3.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_int_LayoutRight_Rank3.cpp + $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_int_LayoutRight_Rank3.cpp +Kokkos_ROCm_ViewCopyETIInst_int64_t_int_LayoutRight_Rank4.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_int_LayoutRight_Rank4.cpp + $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_int_LayoutRight_Rank4.cpp +Kokkos_ROCm_ViewCopyETIInst_int64_t_int_LayoutRight_Rank5.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_int_LayoutRight_Rank5.cpp + $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_int_LayoutRight_Rank5.cpp +Kokkos_ROCm_ViewCopyETIInst_int64_t_int_LayoutRight_Rank8.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_int_LayoutRight_Rank8.cpp + $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_int_LayoutRight_Rank8.cpp +Kokkos_ROCm_ViewCopyETIInst_int64_t_int_LayoutStride_Rank1.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_int_LayoutStride_Rank1.cpp + $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_int_LayoutStride_Rank1.cpp +Kokkos_ROCm_ViewCopyETIInst_int64_t_int_LayoutStride_Rank2.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_int_LayoutStride_Rank2.cpp + $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_int_LayoutStride_Rank2.cpp +Kokkos_ROCm_ViewCopyETIInst_int64_t_int_LayoutStride_Rank3.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_int_LayoutStride_Rank3.cpp + $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_int_LayoutStride_Rank3.cpp +Kokkos_ROCm_ViewCopyETIInst_int64_t_int_LayoutStride_Rank4.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_int_LayoutStride_Rank4.cpp + $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_int_LayoutStride_Rank4.cpp +Kokkos_ROCm_ViewCopyETIInst_int64_t_int_LayoutStride_Rank5.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_int_LayoutStride_Rank5.cpp + $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_int_LayoutStride_Rank5.cpp +Kokkos_ROCm_ViewCopyETIInst_int64_t_int_LayoutStride_Rank8.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_int_LayoutStride_Rank8.cpp + $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_int_LayoutStride_Rank8.cpp +Kokkos_ROCm_ViewCopyETIInst_int_int64_t_LayoutLeft_Rank1.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_int64_t_LayoutLeft_Rank1.cpp + $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_int64_t_LayoutLeft_Rank1.cpp +Kokkos_ROCm_ViewCopyETIInst_int_int64_t_LayoutLeft_Rank2.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_int64_t_LayoutLeft_Rank2.cpp + $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_int64_t_LayoutLeft_Rank2.cpp +Kokkos_ROCm_ViewCopyETIInst_int_int64_t_LayoutLeft_Rank3.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_int64_t_LayoutLeft_Rank3.cpp + $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_int64_t_LayoutLeft_Rank3.cpp +Kokkos_ROCm_ViewCopyETIInst_int_int64_t_LayoutLeft_Rank4.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_int64_t_LayoutLeft_Rank4.cpp + $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_int64_t_LayoutLeft_Rank4.cpp +Kokkos_ROCm_ViewCopyETIInst_int_int64_t_LayoutLeft_Rank5.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_int64_t_LayoutLeft_Rank5.cpp + $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_int64_t_LayoutLeft_Rank5.cpp +Kokkos_ROCm_ViewCopyETIInst_int_int64_t_LayoutLeft_Rank8.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_int64_t_LayoutLeft_Rank8.cpp + $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_int64_t_LayoutLeft_Rank8.cpp +Kokkos_ROCm_ViewCopyETIInst_int_int64_t_LayoutRight_Rank1.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_int64_t_LayoutRight_Rank1.cpp + $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_int64_t_LayoutRight_Rank1.cpp +Kokkos_ROCm_ViewCopyETIInst_int_int64_t_LayoutRight_Rank2.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_int64_t_LayoutRight_Rank2.cpp + $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_int64_t_LayoutRight_Rank2.cpp +Kokkos_ROCm_ViewCopyETIInst_int_int64_t_LayoutRight_Rank3.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_int64_t_LayoutRight_Rank3.cpp + $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_int64_t_LayoutRight_Rank3.cpp +Kokkos_ROCm_ViewCopyETIInst_int_int64_t_LayoutRight_Rank4.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_int64_t_LayoutRight_Rank4.cpp + $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_int64_t_LayoutRight_Rank4.cpp +Kokkos_ROCm_ViewCopyETIInst_int_int64_t_LayoutRight_Rank5.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_int64_t_LayoutRight_Rank5.cpp + $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_int64_t_LayoutRight_Rank5.cpp +Kokkos_ROCm_ViewCopyETIInst_int_int64_t_LayoutRight_Rank8.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_int64_t_LayoutRight_Rank8.cpp + $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_int64_t_LayoutRight_Rank8.cpp +Kokkos_ROCm_ViewCopyETIInst_int_int64_t_LayoutStride_Rank1.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_int64_t_LayoutStride_Rank1.cpp + $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_int64_t_LayoutStride_Rank1.cpp +Kokkos_ROCm_ViewCopyETIInst_int_int64_t_LayoutStride_Rank2.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_int64_t_LayoutStride_Rank2.cpp + $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_int64_t_LayoutStride_Rank2.cpp +Kokkos_ROCm_ViewCopyETIInst_int_int64_t_LayoutStride_Rank3.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_int64_t_LayoutStride_Rank3.cpp + $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_int64_t_LayoutStride_Rank3.cpp +Kokkos_ROCm_ViewCopyETIInst_int_int64_t_LayoutStride_Rank4.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_int64_t_LayoutStride_Rank4.cpp + $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_int64_t_LayoutStride_Rank4.cpp +Kokkos_ROCm_ViewCopyETIInst_int_int64_t_LayoutStride_Rank5.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_int64_t_LayoutStride_Rank5.cpp + $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_int64_t_LayoutStride_Rank5.cpp +Kokkos_ROCm_ViewCopyETIInst_int_int64_t_LayoutStride_Rank8.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_int64_t_LayoutStride_Rank8.cpp + $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_int64_t_LayoutStride_Rank8.cpp +Kokkos_ROCm_ViewCopyETIInst_int64_t_int64_t_LayoutLeft_Rank1.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_int64_t_LayoutLeft_Rank1.cpp + $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_int64_t_LayoutLeft_Rank1.cpp +Kokkos_ROCm_ViewCopyETIInst_int64_t_int64_t_LayoutLeft_Rank2.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_int64_t_LayoutLeft_Rank2.cpp + $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_int64_t_LayoutLeft_Rank2.cpp +Kokkos_ROCm_ViewCopyETIInst_int64_t_int64_t_LayoutLeft_Rank3.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_int64_t_LayoutLeft_Rank3.cpp + $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_int64_t_LayoutLeft_Rank3.cpp +Kokkos_ROCm_ViewCopyETIInst_int64_t_int64_t_LayoutLeft_Rank4.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_int64_t_LayoutLeft_Rank4.cpp + $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_int64_t_LayoutLeft_Rank4.cpp +Kokkos_ROCm_ViewCopyETIInst_int64_t_int64_t_LayoutLeft_Rank5.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_int64_t_LayoutLeft_Rank5.cpp + $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_int64_t_LayoutLeft_Rank5.cpp +Kokkos_ROCm_ViewCopyETIInst_int64_t_int64_t_LayoutLeft_Rank8.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_int64_t_LayoutLeft_Rank8.cpp + $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_int64_t_LayoutLeft_Rank8.cpp +Kokkos_ROCm_ViewCopyETIInst_int64_t_int64_t_LayoutRight_Rank1.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_int64_t_LayoutRight_Rank1.cpp + $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_int64_t_LayoutRight_Rank1.cpp +Kokkos_ROCm_ViewCopyETIInst_int64_t_int64_t_LayoutRight_Rank2.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_int64_t_LayoutRight_Rank2.cpp + $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_int64_t_LayoutRight_Rank2.cpp +Kokkos_ROCm_ViewCopyETIInst_int64_t_int64_t_LayoutRight_Rank3.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_int64_t_LayoutRight_Rank3.cpp + $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_int64_t_LayoutRight_Rank3.cpp +Kokkos_ROCm_ViewCopyETIInst_int64_t_int64_t_LayoutRight_Rank4.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_int64_t_LayoutRight_Rank4.cpp + $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_int64_t_LayoutRight_Rank4.cpp +Kokkos_ROCm_ViewCopyETIInst_int64_t_int64_t_LayoutRight_Rank5.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_int64_t_LayoutRight_Rank5.cpp + $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_int64_t_LayoutRight_Rank5.cpp +Kokkos_ROCm_ViewCopyETIInst_int64_t_int64_t_LayoutRight_Rank8.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_int64_t_LayoutRight_Rank8.cpp + $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_int64_t_LayoutRight_Rank8.cpp +Kokkos_ROCm_ViewCopyETIInst_int64_t_int64_t_LayoutStride_Rank1.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_int64_t_LayoutStride_Rank1.cpp + $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_int64_t_LayoutStride_Rank1.cpp +Kokkos_ROCm_ViewCopyETIInst_int64_t_int64_t_LayoutStride_Rank2.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_int64_t_LayoutStride_Rank2.cpp + $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_int64_t_LayoutStride_Rank2.cpp +Kokkos_ROCm_ViewCopyETIInst_int64_t_int64_t_LayoutStride_Rank3.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_int64_t_LayoutStride_Rank3.cpp + $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_int64_t_LayoutStride_Rank3.cpp +Kokkos_ROCm_ViewCopyETIInst_int64_t_int64_t_LayoutStride_Rank4.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_int64_t_LayoutStride_Rank4.cpp + $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_int64_t_LayoutStride_Rank4.cpp +Kokkos_ROCm_ViewCopyETIInst_int64_t_int64_t_LayoutStride_Rank5.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_int64_t_LayoutStride_Rank5.cpp + $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_int64_t_LayoutStride_Rank5.cpp +Kokkos_ROCm_ViewCopyETIInst_int64_t_int64_t_LayoutStride_Rank8.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_int64_t_LayoutStride_Rank8.cpp + $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_int64_t_LayoutStride_Rank8.cpp +Kokkos_ROCm_ViewCopyETIInst_int_float_LayoutLeft_Rank1.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_float_LayoutLeft_Rank1.cpp + $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_float_LayoutLeft_Rank1.cpp +Kokkos_ROCm_ViewCopyETIInst_int_float_LayoutLeft_Rank2.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_float_LayoutLeft_Rank2.cpp + $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_float_LayoutLeft_Rank2.cpp +Kokkos_ROCm_ViewCopyETIInst_int_float_LayoutLeft_Rank3.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_float_LayoutLeft_Rank3.cpp + $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_float_LayoutLeft_Rank3.cpp +Kokkos_ROCm_ViewCopyETIInst_int_float_LayoutLeft_Rank4.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_float_LayoutLeft_Rank4.cpp + $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_float_LayoutLeft_Rank4.cpp +Kokkos_ROCm_ViewCopyETIInst_int_float_LayoutLeft_Rank5.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_float_LayoutLeft_Rank5.cpp + $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_float_LayoutLeft_Rank5.cpp +Kokkos_ROCm_ViewCopyETIInst_int_float_LayoutLeft_Rank8.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_float_LayoutLeft_Rank8.cpp + $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_float_LayoutLeft_Rank8.cpp +Kokkos_ROCm_ViewCopyETIInst_int_float_LayoutRight_Rank1.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_float_LayoutRight_Rank1.cpp + $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_float_LayoutRight_Rank1.cpp +Kokkos_ROCm_ViewCopyETIInst_int_float_LayoutRight_Rank2.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_float_LayoutRight_Rank2.cpp + $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_float_LayoutRight_Rank2.cpp +Kokkos_ROCm_ViewCopyETIInst_int_float_LayoutRight_Rank3.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_float_LayoutRight_Rank3.cpp + $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_float_LayoutRight_Rank3.cpp +Kokkos_ROCm_ViewCopyETIInst_int_float_LayoutRight_Rank4.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_float_LayoutRight_Rank4.cpp + $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_float_LayoutRight_Rank4.cpp +Kokkos_ROCm_ViewCopyETIInst_int_float_LayoutRight_Rank5.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_float_LayoutRight_Rank5.cpp + $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_float_LayoutRight_Rank5.cpp +Kokkos_ROCm_ViewCopyETIInst_int_float_LayoutRight_Rank8.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_float_LayoutRight_Rank8.cpp + $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_float_LayoutRight_Rank8.cpp +Kokkos_ROCm_ViewCopyETIInst_int_float_LayoutStride_Rank1.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_float_LayoutStride_Rank1.cpp + $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_float_LayoutStride_Rank1.cpp +Kokkos_ROCm_ViewCopyETIInst_int_float_LayoutStride_Rank2.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_float_LayoutStride_Rank2.cpp + $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_float_LayoutStride_Rank2.cpp +Kokkos_ROCm_ViewCopyETIInst_int_float_LayoutStride_Rank3.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_float_LayoutStride_Rank3.cpp + $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_float_LayoutStride_Rank3.cpp +Kokkos_ROCm_ViewCopyETIInst_int_float_LayoutStride_Rank4.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_float_LayoutStride_Rank4.cpp + $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_float_LayoutStride_Rank4.cpp +Kokkos_ROCm_ViewCopyETIInst_int_float_LayoutStride_Rank5.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_float_LayoutStride_Rank5.cpp + $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_float_LayoutStride_Rank5.cpp +Kokkos_ROCm_ViewCopyETIInst_int_float_LayoutStride_Rank8.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_float_LayoutStride_Rank8.cpp + $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_float_LayoutStride_Rank8.cpp +Kokkos_ROCm_ViewCopyETIInst_int64_t_float_LayoutLeft_Rank1.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_float_LayoutLeft_Rank1.cpp + $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_float_LayoutLeft_Rank1.cpp +Kokkos_ROCm_ViewCopyETIInst_int64_t_float_LayoutLeft_Rank2.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_float_LayoutLeft_Rank2.cpp + $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_float_LayoutLeft_Rank2.cpp +Kokkos_ROCm_ViewCopyETIInst_int64_t_float_LayoutLeft_Rank3.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_float_LayoutLeft_Rank3.cpp + $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_float_LayoutLeft_Rank3.cpp +Kokkos_ROCm_ViewCopyETIInst_int64_t_float_LayoutLeft_Rank4.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_float_LayoutLeft_Rank4.cpp + $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_float_LayoutLeft_Rank4.cpp +Kokkos_ROCm_ViewCopyETIInst_int64_t_float_LayoutLeft_Rank5.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_float_LayoutLeft_Rank5.cpp + $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_float_LayoutLeft_Rank5.cpp +Kokkos_ROCm_ViewCopyETIInst_int64_t_float_LayoutLeft_Rank8.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_float_LayoutLeft_Rank8.cpp + $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_float_LayoutLeft_Rank8.cpp +Kokkos_ROCm_ViewCopyETIInst_int64_t_float_LayoutRight_Rank1.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_float_LayoutRight_Rank1.cpp + $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_float_LayoutRight_Rank1.cpp +Kokkos_ROCm_ViewCopyETIInst_int64_t_float_LayoutRight_Rank2.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_float_LayoutRight_Rank2.cpp + $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_float_LayoutRight_Rank2.cpp +Kokkos_ROCm_ViewCopyETIInst_int64_t_float_LayoutRight_Rank3.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_float_LayoutRight_Rank3.cpp + $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_float_LayoutRight_Rank3.cpp +Kokkos_ROCm_ViewCopyETIInst_int64_t_float_LayoutRight_Rank4.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_float_LayoutRight_Rank4.cpp + $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_float_LayoutRight_Rank4.cpp +Kokkos_ROCm_ViewCopyETIInst_int64_t_float_LayoutRight_Rank5.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_float_LayoutRight_Rank5.cpp + $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_float_LayoutRight_Rank5.cpp +Kokkos_ROCm_ViewCopyETIInst_int64_t_float_LayoutRight_Rank8.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_float_LayoutRight_Rank8.cpp + $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_float_LayoutRight_Rank8.cpp +Kokkos_ROCm_ViewCopyETIInst_int64_t_float_LayoutStride_Rank1.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_float_LayoutStride_Rank1.cpp + $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_float_LayoutStride_Rank1.cpp +Kokkos_ROCm_ViewCopyETIInst_int64_t_float_LayoutStride_Rank2.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_float_LayoutStride_Rank2.cpp + $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_float_LayoutStride_Rank2.cpp +Kokkos_ROCm_ViewCopyETIInst_int64_t_float_LayoutStride_Rank3.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_float_LayoutStride_Rank3.cpp + $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_float_LayoutStride_Rank3.cpp +Kokkos_ROCm_ViewCopyETIInst_int64_t_float_LayoutStride_Rank4.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_float_LayoutStride_Rank4.cpp + $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_float_LayoutStride_Rank4.cpp +Kokkos_ROCm_ViewCopyETIInst_int64_t_float_LayoutStride_Rank5.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_float_LayoutStride_Rank5.cpp + $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_float_LayoutStride_Rank5.cpp +Kokkos_ROCm_ViewCopyETIInst_int64_t_float_LayoutStride_Rank8.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_float_LayoutStride_Rank8.cpp + $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_float_LayoutStride_Rank8.cpp +Kokkos_ROCm_ViewCopyETIInst_int_double_LayoutLeft_Rank1.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_double_LayoutLeft_Rank1.cpp + $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_double_LayoutLeft_Rank1.cpp +Kokkos_ROCm_ViewCopyETIInst_int_double_LayoutLeft_Rank2.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_double_LayoutLeft_Rank2.cpp + $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_double_LayoutLeft_Rank2.cpp +Kokkos_ROCm_ViewCopyETIInst_int_double_LayoutLeft_Rank3.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_double_LayoutLeft_Rank3.cpp + $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_double_LayoutLeft_Rank3.cpp +Kokkos_ROCm_ViewCopyETIInst_int_double_LayoutLeft_Rank4.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_double_LayoutLeft_Rank4.cpp + $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_double_LayoutLeft_Rank4.cpp +Kokkos_ROCm_ViewCopyETIInst_int_double_LayoutLeft_Rank5.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_double_LayoutLeft_Rank5.cpp + $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_double_LayoutLeft_Rank5.cpp +Kokkos_ROCm_ViewCopyETIInst_int_double_LayoutLeft_Rank8.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_double_LayoutLeft_Rank8.cpp + $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_double_LayoutLeft_Rank8.cpp +Kokkos_ROCm_ViewCopyETIInst_int_double_LayoutRight_Rank1.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_double_LayoutRight_Rank1.cpp + $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_double_LayoutRight_Rank1.cpp +Kokkos_ROCm_ViewCopyETIInst_int_double_LayoutRight_Rank2.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_double_LayoutRight_Rank2.cpp + $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_double_LayoutRight_Rank2.cpp +Kokkos_ROCm_ViewCopyETIInst_int_double_LayoutRight_Rank3.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_double_LayoutRight_Rank3.cpp + $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_double_LayoutRight_Rank3.cpp +Kokkos_ROCm_ViewCopyETIInst_int_double_LayoutRight_Rank4.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_double_LayoutRight_Rank4.cpp + $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_double_LayoutRight_Rank4.cpp +Kokkos_ROCm_ViewCopyETIInst_int_double_LayoutRight_Rank5.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_double_LayoutRight_Rank5.cpp + $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_double_LayoutRight_Rank5.cpp +Kokkos_ROCm_ViewCopyETIInst_int_double_LayoutRight_Rank8.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_double_LayoutRight_Rank8.cpp + $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_double_LayoutRight_Rank8.cpp +Kokkos_ROCm_ViewCopyETIInst_int_double_LayoutStride_Rank1.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_double_LayoutStride_Rank1.cpp + $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_double_LayoutStride_Rank1.cpp +Kokkos_ROCm_ViewCopyETIInst_int_double_LayoutStride_Rank2.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_double_LayoutStride_Rank2.cpp + $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_double_LayoutStride_Rank2.cpp +Kokkos_ROCm_ViewCopyETIInst_int_double_LayoutStride_Rank3.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_double_LayoutStride_Rank3.cpp + $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_double_LayoutStride_Rank3.cpp +Kokkos_ROCm_ViewCopyETIInst_int_double_LayoutStride_Rank4.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_double_LayoutStride_Rank4.cpp + $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_double_LayoutStride_Rank4.cpp +Kokkos_ROCm_ViewCopyETIInst_int_double_LayoutStride_Rank5.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_double_LayoutStride_Rank5.cpp + $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_double_LayoutStride_Rank5.cpp +Kokkos_ROCm_ViewCopyETIInst_int_double_LayoutStride_Rank8.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_double_LayoutStride_Rank8.cpp + $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_double_LayoutStride_Rank8.cpp +Kokkos_ROCm_ViewCopyETIInst_int64_t_double_LayoutLeft_Rank1.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_double_LayoutLeft_Rank1.cpp + $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_double_LayoutLeft_Rank1.cpp +Kokkos_ROCm_ViewCopyETIInst_int64_t_double_LayoutLeft_Rank2.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_double_LayoutLeft_Rank2.cpp + $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_double_LayoutLeft_Rank2.cpp +Kokkos_ROCm_ViewCopyETIInst_int64_t_double_LayoutLeft_Rank3.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_double_LayoutLeft_Rank3.cpp + $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_double_LayoutLeft_Rank3.cpp +Kokkos_ROCm_ViewCopyETIInst_int64_t_double_LayoutLeft_Rank4.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_double_LayoutLeft_Rank4.cpp + $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_double_LayoutLeft_Rank4.cpp +Kokkos_ROCm_ViewCopyETIInst_int64_t_double_LayoutLeft_Rank5.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_double_LayoutLeft_Rank5.cpp + $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_double_LayoutLeft_Rank5.cpp +Kokkos_ROCm_ViewCopyETIInst_int64_t_double_LayoutLeft_Rank8.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_double_LayoutLeft_Rank8.cpp + $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_double_LayoutLeft_Rank8.cpp +Kokkos_ROCm_ViewCopyETIInst_int64_t_double_LayoutRight_Rank1.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_double_LayoutRight_Rank1.cpp + $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_double_LayoutRight_Rank1.cpp +Kokkos_ROCm_ViewCopyETIInst_int64_t_double_LayoutRight_Rank2.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_double_LayoutRight_Rank2.cpp + $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_double_LayoutRight_Rank2.cpp +Kokkos_ROCm_ViewCopyETIInst_int64_t_double_LayoutRight_Rank3.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_double_LayoutRight_Rank3.cpp + $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_double_LayoutRight_Rank3.cpp +Kokkos_ROCm_ViewCopyETIInst_int64_t_double_LayoutRight_Rank4.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_double_LayoutRight_Rank4.cpp + $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_double_LayoutRight_Rank4.cpp +Kokkos_ROCm_ViewCopyETIInst_int64_t_double_LayoutRight_Rank5.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_double_LayoutRight_Rank5.cpp + $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_double_LayoutRight_Rank5.cpp +Kokkos_ROCm_ViewCopyETIInst_int64_t_double_LayoutRight_Rank8.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_double_LayoutRight_Rank8.cpp + $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_double_LayoutRight_Rank8.cpp +Kokkos_ROCm_ViewCopyETIInst_int64_t_double_LayoutStride_Rank1.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_double_LayoutStride_Rank1.cpp + $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_double_LayoutStride_Rank1.cpp +Kokkos_ROCm_ViewCopyETIInst_int64_t_double_LayoutStride_Rank2.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_double_LayoutStride_Rank2.cpp + $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_double_LayoutStride_Rank2.cpp +Kokkos_ROCm_ViewCopyETIInst_int64_t_double_LayoutStride_Rank3.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_double_LayoutStride_Rank3.cpp + $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_double_LayoutStride_Rank3.cpp +Kokkos_ROCm_ViewCopyETIInst_int64_t_double_LayoutStride_Rank4.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_double_LayoutStride_Rank4.cpp + $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_double_LayoutStride_Rank4.cpp +Kokkos_ROCm_ViewCopyETIInst_int64_t_double_LayoutStride_Rank5.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_double_LayoutStride_Rank5.cpp + $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_double_LayoutStride_Rank5.cpp +Kokkos_ROCm_ViewCopyETIInst_int64_t_double_LayoutStride_Rank8.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_double_LayoutStride_Rank8.cpp + $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_double_LayoutStride_Rank8.cpp diff --git a/packages/kokkos/core/src/impl/Kokkos_Atomic_Compare_Exchange_Strong.hpp b/packages/kokkos/core/src/impl/Kokkos_Atomic_Compare_Exchange_Strong.hpp index ad115dd8ffc96efc25a9ac2fd316d13a0b58dfc3..e2028db8c8ff214e3bbebdefb408cb0b669d07cf 100644 --- a/packages/kokkos/core/src/impl/Kokkos_Atomic_Compare_Exchange_Strong.hpp +++ b/packages/kokkos/core/src/impl/Kokkos_Atomic_Compare_Exchange_Strong.hpp @@ -107,7 +107,12 @@ T atomic_compare_exchange( volatile T * const dest , const T & compare , T return_val; // This is a way to (hopefully) avoid dead lock in a warp int done = 0; - unsigned int active = KOKKOS_IMPL_CUDA_BALLOT(1); +#ifdef KOKKOS_IMPL_CUDA_SYNCWARP_NEEDS_MASK + unsigned int mask = KOKKOS_IMPL_CUDA_ACTIVEMASK; + unsigned int active = KOKKOS_IMPL_CUDA_BALLOT_MASK(mask,1); +#else + unsigned int active = KOKKOS_IMPL_CUDA_BALLOT_MASK(1); +#endif unsigned int done_active = 0; while (active!=done_active) { if(!done) { @@ -119,7 +124,11 @@ T atomic_compare_exchange( volatile T * const dest , const T & compare , done = 1; } } - done_active = KOKKOS_IMPL_CUDA_BALLOT(done); +#ifdef KOKKOS_IMPL_CUDA_SYNCWARP_NEEDS_MASK + done_active = KOKKOS_IMPL_CUDA_BALLOT_MASK(mask,done); +#else + done_active = KOKKOS_IMPL_CUDA_BALLOT_MASK(done); +#endif } return return_val; } diff --git a/packages/kokkos/core/src/impl/Kokkos_Atomic_Exchange.hpp b/packages/kokkos/core/src/impl/Kokkos_Atomic_Exchange.hpp index 801a8091ddcba27ca09be73951cca8ae00e7d2ca..4e41cb125856b88121ec2565d53ff07e3b7a87a7 100644 --- a/packages/kokkos/core/src/impl/Kokkos_Atomic_Exchange.hpp +++ b/packages/kokkos/core/src/impl/Kokkos_Atomic_Exchange.hpp @@ -130,7 +130,12 @@ T atomic_exchange( volatile T * const dest , #endif int done = 0; - unsigned int active = KOKKOS_IMPL_CUDA_BALLOT(1); +#ifdef KOKKOS_IMPL_CUDA_SYNCWARP_NEEDS_MASK + unsigned int mask = KOKKOS_IMPL_CUDA_ACTIVEMASK; + unsigned int active = KOKKOS_IMPL_CUDA_BALLOT_MASK(mask,1); +#else + unsigned int active = KOKKOS_IMPL_CUDA_BALLOT_MASK(1); +#endif unsigned int done_active = 0; while (active!=done_active) { if(!done) { @@ -141,7 +146,11 @@ T atomic_exchange( volatile T * const dest , done = 1; } } - done_active = KOKKOS_IMPL_CUDA_BALLOT(done); +#ifdef KOKKOS_IMPL_CUDA_SYNCWARP_NEEDS_MASK + done_active = KOKKOS_IMPL_CUDA_BALLOT_MASK(mask,done); +#else + done_active = KOKKOS_IMPL_CUDA_BALLOT_MASK(done); +#endif } return return_val; } diff --git a/packages/kokkos/core/src/impl/Kokkos_Atomic_Fetch_Add.hpp b/packages/kokkos/core/src/impl/Kokkos_Atomic_Fetch_Add.hpp index 8249e709da910437583d70d52068a6d6408f5cf6..e2e23bb5fdb0a83aea5ec4d8956422b1d35c9123 100644 --- a/packages/kokkos/core/src/impl/Kokkos_Atomic_Fetch_Add.hpp +++ b/packages/kokkos/core/src/impl/Kokkos_Atomic_Fetch_Add.hpp @@ -143,7 +143,12 @@ T atomic_fetch_add( volatile T * const dest , T return_val; // This is a way to (hopefully) avoid dead lock in a warp int done = 0; - unsigned int active = KOKKOS_IMPL_CUDA_BALLOT(1); +#ifdef KOKKOS_IMPL_CUDA_SYNCWARP_NEEDS_MASK + unsigned int mask = KOKKOS_IMPL_CUDA_ACTIVEMASK; + unsigned int active = KOKKOS_IMPL_CUDA_BALLOT_MASK(mask,1); +#else + unsigned int active = KOKKOS_IMPL_CUDA_BALLOT_MASK(1); +#endif unsigned int done_active = 0; while (active!=done_active) { if(!done) { @@ -155,7 +160,12 @@ T atomic_fetch_add( volatile T * const dest , done = 1; } } - done_active = KOKKOS_IMPL_CUDA_BALLOT(done); + +#ifdef KOKKOS_IMPL_CUDA_SYNCWARP_NEEDS_MASK + done_active = KOKKOS_IMPL_CUDA_BALLOT_MASK(mask,done); +#else + done_active = KOKKOS_IMPL_CUDA_BALLOT_MASK(done); +#endif } return return_val; } diff --git a/packages/kokkos/core/src/impl/Kokkos_Atomic_Fetch_Sub.hpp b/packages/kokkos/core/src/impl/Kokkos_Atomic_Fetch_Sub.hpp index 3f58c55396d5ca2f841b066f043ab8d0e6b9e660..dd69c967c54ab2476d9f5656b8fa3266b3de71c7 100644 --- a/packages/kokkos/core/src/impl/Kokkos_Atomic_Fetch_Sub.hpp +++ b/packages/kokkos/core/src/impl/Kokkos_Atomic_Fetch_Sub.hpp @@ -135,7 +135,12 @@ T atomic_fetch_sub( volatile T * const dest , T return_val; // This is a way to (hopefully) avoid dead lock in a warp int done = 0; - unsigned int active = KOKKOS_IMPL_CUDA_BALLOT(1); +#ifdef KOKKOS_IMPL_CUDA_SYNCWARP_NEEDS_MASK + unsigned int mask = KOKKOS_IMPL_CUDA_ACTIVEMASK; + unsigned int active = KOKKOS_IMPL_CUDA_BALLOT_MASK(mask,1); +#else + unsigned int active = KOKKOS_IMPL_CUDA_BALLOT_MASK(1); +#endif unsigned int done_active = 0; while (active!=done_active) { if(!done) { @@ -146,7 +151,11 @@ T atomic_fetch_sub( volatile T * const dest , done = 1; } } - done_active = KOKKOS_IMPL_CUDA_BALLOT(done); +#ifdef KOKKOS_IMPL_CUDA_SYNCWARP_NEEDS_MASK + done_active = KOKKOS_IMPL_CUDA_BALLOT_MASK(mask,done); +#else + done_active = KOKKOS_IMPL_CUDA_BALLOT_MASK(done); +#endif } return return_val; } diff --git a/packages/kokkos/core/src/impl/Kokkos_Atomic_Generic.hpp b/packages/kokkos/core/src/impl/Kokkos_Atomic_Generic.hpp index 6140d45896f5041bfb2c31b76e5c192e1179c77f..74e9db303d7445cde738a0aa1b7f1a26931c717d 100644 --- a/packages/kokkos/core/src/impl/Kokkos_Atomic_Generic.hpp +++ b/packages/kokkos/core/src/impl/Kokkos_Atomic_Generic.hpp @@ -246,7 +246,12 @@ T atomic_fetch_oper( const Oper& op, volatile T * const dest , // This is a way to (hopefully) avoid dead lock in a warp T return_val; int done = 0; - unsigned int active = KOKKOS_IMPL_CUDA_BALLOT(1); +#ifdef KOKKOS_IMPL_CUDA_SYNCWARP_NEEDS_MASK + unsigned int mask = KOKKOS_IMPL_CUDA_ACTIVEMASK; + unsigned int active = KOKKOS_IMPL_CUDA_BALLOT_MASK(mask,1); +#else + unsigned int active = KOKKOS_IMPL_CUDA_BALLOT_MASK(1); +#endif unsigned int done_active = 0; while (active!=done_active) { if(!done) { @@ -257,7 +262,11 @@ T atomic_fetch_oper( const Oper& op, volatile T * const dest , done=1; } } - done_active = KOKKOS_IMPL_CUDA_BALLOT(done); +#ifdef KOKKOS_IMPL_CUDA_SYNCWARP_NEEDS_MASK + done_active = KOKKOS_IMPL_CUDA_BALLOT_MASK(mask,done); +#else + done_active = KOKKOS_IMPL_CUDA_BALLOT_MASK(done); +#endif } return return_val; #endif @@ -285,7 +294,12 @@ T atomic_oper_fetch( const Oper& op, volatile T * const dest , T return_val; // This is a way to (hopefully) avoid dead lock in a warp int done = 0; - unsigned int active = KOKKOS_IMPL_CUDA_BALLOT(1); +#ifdef KOKKOS_IMPL_CUDA_SYNCWARP_NEEDS_MASK + unsigned int mask = KOKKOS_IMPL_CUDA_ACTIVEMASK; + unsigned int active = KOKKOS_IMPL_CUDA_BALLOT_MASK(mask,1); +#else + unsigned int active = KOKKOS_IMPL_CUDA_BALLOT_MASK(1); +#endif unsigned int done_active = 0; while (active!=done_active) { if(!done) { @@ -296,7 +310,11 @@ T atomic_oper_fetch( const Oper& op, volatile T * const dest , done=1; } } - done_active = KOKKOS_IMPL_CUDA_BALLOT(done); +#ifdef KOKKOS_IMPL_CUDA_SYNCWARP_NEEDS_MASK + done_active = KOKKOS_IMPL_CUDA_BALLOT_MASK(mask,done); +#else + done_active = KOKKOS_IMPL_CUDA_BALLOT_MASK(done); +#endif } return return_val; #endif diff --git a/packages/kokkos/core/src/impl/Kokkos_Atomic_Windows.hpp b/packages/kokkos/core/src/impl/Kokkos_Atomic_Windows.hpp index eeec2d1f4b57fa7ac7a4b03008d921ebe7d6a1e8..b18134f40ccff9a288e7e8824a7133afecacddd3 100644 --- a/packages/kokkos/core/src/impl/Kokkos_Atomic_Windows.hpp +++ b/packages/kokkos/core/src/impl/Kokkos_Atomic_Windows.hpp @@ -45,13 +45,17 @@ #ifdef _WIN32 +#ifndef NOMINMAX #define NOMINMAX +#endif #include <winsock2.h> -#include <Windows.h> +#include <windows.h> namespace Kokkos { namespace Impl { +#ifdef _MSC_VER _declspec(align(16)) +#endif struct cas128_t { LONGLONG lower; @@ -60,7 +64,11 @@ namespace Kokkos { bool operator != (const cas128_t& a) const { return (lower != a.lower) || upper != a.upper; } - }; + } +#ifdef __GNUC__ + __attribute__ ((aligned (16))) +#endif + ; } template < typename T > diff --git a/packages/kokkos/core/src/impl/Kokkos_Core.cpp b/packages/kokkos/core/src/impl/Kokkos_Core.cpp index 8184dad3ecd44070a95af61afd942a41f03d19ff..628e070a0d551c440ad9001ca65782a1acf60f60 100644 --- a/packages/kokkos/core/src/impl/Kokkos_Core.cpp +++ b/packages/kokkos/core/src/impl/Kokkos_Core.cpp @@ -780,8 +780,20 @@ void print_configuration( std::ostream & out , const bool detail ) #else msg << "no" << std::endl; #endif - msg << " KOKKOS_ENABLE_CXX1Z: "; -#ifdef KOKKOS_ENABLE_CXX1Z + msg << " KOKKOS_ENABLE_CXX14: "; +#ifdef KOKKOS_ENABLE_CXX14 + msg << "yes" << std::endl; +#else + msg << "no" << std::endl; +#endif + msg << " KOKKOS_ENABLE_CXX17: "; +#ifdef KOKKOS_ENABLE_CXX17 + msg << "yes" << std::endl; +#else + msg << "no" << std::endl; +#endif + msg << " KOKKOS_ENABLE_CXX20: "; +#ifdef KOKKOS_ENABLE_CXX20 msg << "yes" << std::endl; #else msg << "no" << std::endl; diff --git a/packages/kokkos/core/src/impl/Kokkos_HBWSpace.cpp b/packages/kokkos/core/src/impl/Kokkos_HBWSpace.cpp index 699902e320a89a95897d623095de9d31afecfe7a..680e937db447439cc4562c90a4862d24fc42654c 100644 --- a/packages/kokkos/core/src/impl/Kokkos_HBWSpace.cpp +++ b/packages/kokkos/core/src/impl/Kokkos_HBWSpace.cpp @@ -235,6 +235,8 @@ SharedAllocationRecord( const Kokkos::Experimental::HBWSpace & arg_space , arg_label.c_str() , SharedAllocationHeader::maximum_label_length ); + // Set last element zero, in case c_str is too long + RecordBase::m_alloc_ptr->m_label[SharedAllocationHeader::maximum_label_length - 1] = (char) 0; } //---------------------------------------------------------------------------- diff --git a/packages/kokkos/core/src/impl/Kokkos_HostSpace.cpp b/packages/kokkos/core/src/impl/Kokkos_HostSpace.cpp index da9ce6b9fbc3cb3f514e5dc1a60101c0e9aad2bd..d8cb7593bf4dc86edb83e777b5096c990c06aeca 100644 --- a/packages/kokkos/core/src/impl/Kokkos_HostSpace.cpp +++ b/packages/kokkos/core/src/impl/Kokkos_HostSpace.cpp @@ -356,6 +356,8 @@ SharedAllocationRecord( const Kokkos::HostSpace & arg_space , arg_label.c_str() , SharedAllocationHeader::maximum_label_length ); + // Set last element zero, in case c_str is too long + RecordBase::m_alloc_ptr->m_label[SharedAllocationHeader::maximum_label_length - 1] = (char) 0; } //---------------------------------------------------------------------------- diff --git a/packages/kokkos/core/src/impl/Kokkos_HostThreadTeam.hpp b/packages/kokkos/core/src/impl/Kokkos_HostThreadTeam.hpp index 558eef9e4adbbe2226eb2ea4b4bc925de2022aaa..fff48e87f601b7c2aec724311d3ef0dba577440d 100644 --- a/packages/kokkos/core/src/impl/Kokkos_HostThreadTeam.hpp +++ b/packages/kokkos/core/src/impl/Kokkos_HostThreadTeam.hpp @@ -144,6 +144,30 @@ public: return m_team_rank == 0; } + + inline + bool team_rendezvous(const int source_team_rank) const noexcept + { + int * ptr = (int *)(m_team_scratch + m_team_rendezvous); + HostBarrier::split_arrive( ptr + , m_team_size + , m_team_rendezvous_step + ); + if (m_team_rank != source_team_rank) { + HostBarrier::wait( ptr + , m_team_size + , m_team_rendezvous_step + ); + } + else { + HostBarrier::split_master_wait( ptr + , m_team_size + , m_team_rendezvous_step + ); + } + + return (m_team_rank == source_team_rank); + } inline void team_rendezvous_release() const noexcept @@ -540,15 +564,16 @@ public: { if ( 1 < m_data.m_team_size ) { T volatile * const shared_value = (T*) m_data.team_reduce(); - + // Don't overwrite shared memory until all threads arrive - if ( m_data.team_rendezvous() ) { + if ( m_data.team_rendezvous(source_team_rank) ) { + // All threads have entered 'team_rendezvous' // only this thread returned from 'team_rendezvous' // with a return value of 'true' - *shared_value = value ; + *shared_value = value; m_data.team_rendezvous_release(); // This thread released all other threads from 'team_rendezvous' @@ -574,7 +599,7 @@ public: // Don't overwrite shared memory until all threads arrive - if ( m_data.team_rendezvous() ) { + if ( m_data.team_rendezvous(source_team_rank) ) { // All threads have entered 'team_rendezvous' // only this thread returned from 'team_rendezvous' diff --git a/packages/kokkos/core/src/impl/Kokkos_OldMacros.hpp b/packages/kokkos/core/src/impl/Kokkos_OldMacros.hpp index bad158c2912eb916708cd55bfef3b1a4d78479b5..c3198c0f13f09037229f338d1072f7885b63b018 100644 --- a/packages/kokkos/core/src/impl/Kokkos_OldMacros.hpp +++ b/packages/kokkos/core/src/impl/Kokkos_OldMacros.hpp @@ -142,18 +142,13 @@ #endif #endif -#ifdef KOKKOS_HAVE_CXX1Z + +#if defined(KOKKOS_HAVE_CXX1Z) || defined(KOKKOS_ENABLE_CXX17) #ifndef KOKKOS_ENABLE_CXX1Z #define KOKKOS_ENABLE_CXX1Z KOKKOS_HAVE_CXX1Z #endif #endif -#ifdef KOKKOS_HAVE_DEBUG -#ifndef KOKKOS_DEBUG -#define KOKKOS_DEBUG KOKKOS_HAVE_DEBUG -#endif -#endif - #ifdef KOKKOS_HAVE_DEFAULT_DEVICE_TYPE_CUDA #ifndef KOKKOS_ENABLE_DEFAULT_DEVICE_TYPE_CUDA #define KOKKOS_ENABLE_DEFAULT_DEVICE_TYPE_CUDA KOKKOS_HAVE_DEFAULT_DEVICE_TYPE_CUDA @@ -482,6 +477,12 @@ #define KOKKOS_HAVE_DEBUG 1 #endif +#ifdef KOKKOS_HAVE_DEBUG +#ifndef KOKKOS_DEBUG +#define KOKKOS_DEBUG KOKKOS_HAVE_DEBUG +#endif +#endif + #if (!defined(KOKKOS_HAVE_HWLOC)) && defined(KOKKOS_ENABLE_HWLOC) #define KOKKOS_HAVE_HWLOC 1 #endif diff --git a/packages/kokkos/core/src/impl/Kokkos_Serial_Task.cpp b/packages/kokkos/core/src/impl/Kokkos_Serial_Task.cpp index 7b85909ed53feeb3edb5d2da479ca0a6c8e24682..d84a8546225808b9ac8a26de72fe61e394050989 100644 --- a/packages/kokkos/core/src/impl/Kokkos_Serial_Task.cpp +++ b/packages/kokkos/core/src/impl/Kokkos_Serial_Task.cpp @@ -60,10 +60,10 @@ template class TaskQueue< Kokkos::Serial > ; void TaskQueueSpecialization< Kokkos::Serial >::execute ( TaskQueue< Kokkos::Serial > * const queue ) { - using execution_space = Kokkos::Serial ; - using queue_type = TaskQueue< execution_space > ; + using exec_space = Kokkos::Serial ; + using tqs_queue_type = TaskQueue< exec_space > ; using task_root_type = TaskBase< void , void , void > ; - using Member = Impl::HostThreadTeamMember< execution_space > ; + using Member = Impl::HostThreadTeamMember< exec_space > ; task_root_type * const end = (task_root_type *) task_root_type::EndTag ; @@ -83,9 +83,9 @@ void TaskQueueSpecialization< Kokkos::Serial >::execute task_root_type * task = end ; - for ( int i = 0 ; i < queue_type::NumQueue && end == task ; ++i ) { + for ( int i = 0 ; i < tqs_queue_type::NumQueue && end == task ; ++i ) { for ( int j = 0 ; j < 2 && end == task ; ++j ) { - task = queue_type::pop_ready_task( & queue->m_ready[i][j] ); + task = tqs_queue_type::pop_ready_task( & queue->m_ready[i][j] ); } } @@ -120,10 +120,10 @@ void TaskQueueSpecialization< Kokkos::Serial > :: iff_single_thread_recursive_execute( TaskQueue< Kokkos::Serial > * const queue ) { - using execution_space = Kokkos::Serial ; - using queue_type = TaskQueue< execution_space > ; + using exec_space = Kokkos::Serial ; + using tqs_queue_type = TaskQueue< exec_space > ; using task_root_type = TaskBase< void , void , void > ; - using Member = Impl::HostThreadTeamMember< execution_space > ; + using Member = Impl::HostThreadTeamMember< exec_space > ; task_root_type * const end = (task_root_type *) task_root_type::EndTag ; @@ -139,9 +139,9 @@ void TaskQueueSpecialization< Kokkos::Serial > :: task = end ; - for ( int i = 0 ; i < queue_type::NumQueue && end == task ; ++i ) { + for ( int i = 0 ; i < tqs_queue_type::NumQueue && end == task ; ++i ) { for ( int j = 0 ; j < 2 && end == task ; ++j ) { - task = queue_type::pop_ready_task( & queue->m_ready[i][j] ); + task = tqs_queue_type::pop_ready_task( & queue->m_ready[i][j] ); } } diff --git a/packages/kokkos/core/src/impl/Kokkos_ViewArray.hpp b/packages/kokkos/core/src/impl/Kokkos_ViewArray.hpp index 3c306ec94b64dcdd2afb33362f4a4582dae7abc7..d4e3a03d384e3b2fb785eec8fefb80e5517d3135 100644 --- a/packages/kokkos/core/src/impl/Kokkos_ViewArray.hpp +++ b/packages/kokkos/core/src/impl/Kokkos_ViewArray.hpp @@ -123,8 +123,8 @@ private: typedef typename Traits::value_type::pointer handle_type ; - handle_type m_handle ; - offset_type m_offset ; + handle_type m_impl_handle ; + offset_type m_impl_offset ; size_t m_stride ; typedef typename Traits::value_type::value_type scalar_type ; @@ -140,8 +140,8 @@ private: KOKKOS_INLINE_FUNCTION ViewMapping( const handle_type & arg_handle , const offset_type & arg_offset ) - : m_handle( arg_handle ) - , m_offset( arg_offset ) + : m_impl_handle( arg_handle ) + , m_impl_offset( arg_offset ) , m_stride( is_contiguous_reference ? 0 : arg_offset.span() ) {} @@ -154,44 +154,44 @@ public: template< typename iType > KOKKOS_INLINE_FUNCTION constexpr size_t extent( const iType & r ) const - { return m_offset.m_dim.extent(r); } + { return m_impl_offset.m_dim.extent(r); } KOKKOS_INLINE_FUNCTION constexpr typename Traits::array_layout layout() const - { return m_offset.layout(); } + { return m_impl_offset.layout(); } - KOKKOS_INLINE_FUNCTION constexpr size_t dimension_0() const { return m_offset.dimension_0(); } - KOKKOS_INLINE_FUNCTION constexpr size_t dimension_1() const { return m_offset.dimension_1(); } - KOKKOS_INLINE_FUNCTION constexpr size_t dimension_2() const { return m_offset.dimension_2(); } - KOKKOS_INLINE_FUNCTION constexpr size_t dimension_3() const { return m_offset.dimension_3(); } - KOKKOS_INLINE_FUNCTION constexpr size_t dimension_4() const { return m_offset.dimension_4(); } - KOKKOS_INLINE_FUNCTION constexpr size_t dimension_5() const { return m_offset.dimension_5(); } - KOKKOS_INLINE_FUNCTION constexpr size_t dimension_6() const { return m_offset.dimension_6(); } - KOKKOS_INLINE_FUNCTION constexpr size_t dimension_7() const { return m_offset.dimension_7(); } + KOKKOS_INLINE_FUNCTION constexpr size_t dimension_0() const { return m_impl_offset.dimension_0(); } + KOKKOS_INLINE_FUNCTION constexpr size_t dimension_1() const { return m_impl_offset.dimension_1(); } + KOKKOS_INLINE_FUNCTION constexpr size_t dimension_2() const { return m_impl_offset.dimension_2(); } + KOKKOS_INLINE_FUNCTION constexpr size_t dimension_3() const { return m_impl_offset.dimension_3(); } + KOKKOS_INLINE_FUNCTION constexpr size_t dimension_4() const { return m_impl_offset.dimension_4(); } + KOKKOS_INLINE_FUNCTION constexpr size_t dimension_5() const { return m_impl_offset.dimension_5(); } + KOKKOS_INLINE_FUNCTION constexpr size_t dimension_6() const { return m_impl_offset.dimension_6(); } + KOKKOS_INLINE_FUNCTION constexpr size_t dimension_7() const { return m_impl_offset.dimension_7(); } // Is a regular layout with uniform striding for each index. using is_regular = typename offset_type::is_regular ; - KOKKOS_INLINE_FUNCTION constexpr size_t stride_0() const { return m_offset.stride_0(); } - KOKKOS_INLINE_FUNCTION constexpr size_t stride_1() const { return m_offset.stride_1(); } - KOKKOS_INLINE_FUNCTION constexpr size_t stride_2() const { return m_offset.stride_2(); } - KOKKOS_INLINE_FUNCTION constexpr size_t stride_3() const { return m_offset.stride_3(); } - KOKKOS_INLINE_FUNCTION constexpr size_t stride_4() const { return m_offset.stride_4(); } - KOKKOS_INLINE_FUNCTION constexpr size_t stride_5() const { return m_offset.stride_5(); } - KOKKOS_INLINE_FUNCTION constexpr size_t stride_6() const { return m_offset.stride_6(); } - KOKKOS_INLINE_FUNCTION constexpr size_t stride_7() const { return m_offset.stride_7(); } + KOKKOS_INLINE_FUNCTION constexpr size_t stride_0() const { return m_impl_offset.stride_0(); } + KOKKOS_INLINE_FUNCTION constexpr size_t stride_1() const { return m_impl_offset.stride_1(); } + KOKKOS_INLINE_FUNCTION constexpr size_t stride_2() const { return m_impl_offset.stride_2(); } + KOKKOS_INLINE_FUNCTION constexpr size_t stride_3() const { return m_impl_offset.stride_3(); } + KOKKOS_INLINE_FUNCTION constexpr size_t stride_4() const { return m_impl_offset.stride_4(); } + KOKKOS_INLINE_FUNCTION constexpr size_t stride_5() const { return m_impl_offset.stride_5(); } + KOKKOS_INLINE_FUNCTION constexpr size_t stride_6() const { return m_impl_offset.stride_6(); } + KOKKOS_INLINE_FUNCTION constexpr size_t stride_7() const { return m_impl_offset.stride_7(); } //---------------------------------------- // Range span /** \brief Span of the mapped range */ KOKKOS_INLINE_FUNCTION constexpr size_t span() const - { return m_offset.span() * Array_N ; } + { return m_impl_offset.span() * Array_N ; } /** \brief Is the mapped range span contiguous */ KOKKOS_INLINE_FUNCTION constexpr bool span_is_contiguous() const - { return m_offset.span_is_contiguous(); } + { return m_impl_offset.span_is_contiguous(); } typedef typename std::conditional< is_contiguous_reference , contiguous_reference , strided_reference >::type reference_type ; @@ -199,63 +199,63 @@ public: /** \brief If data references are lvalue_reference than can query pointer to memory */ KOKKOS_INLINE_FUNCTION constexpr pointer_type data() const - { return m_handle ; } + { return m_impl_handle ; } //---------------------------------------- // The View class performs all rank and bounds checking before // calling these element reference methods. KOKKOS_FORCEINLINE_FUNCTION - reference_type reference() const { return reference_type( m_handle + 0 , Array_N , 0 ); } + reference_type reference() const { return reference_type( m_impl_handle + 0 , Array_N , 0 ); } template< typename I0 > KOKKOS_FORCEINLINE_FUNCTION reference_type reference( const I0 & i0 ) const - { return reference_type( m_handle + m_offset(i0) * Array_S , Array_N , m_stride ); } + { return reference_type( m_impl_handle + m_impl_offset(i0) * Array_S , Array_N , m_stride ); } template< typename I0 , typename I1 > KOKKOS_FORCEINLINE_FUNCTION reference_type reference( const I0 & i0 , const I1 & i1 ) const - { return reference_type( m_handle + m_offset(i0,i1) * Array_S , Array_N , m_stride ); } + { return reference_type( m_impl_handle + m_impl_offset(i0,i1) * Array_S , Array_N , m_stride ); } template< typename I0 , typename I1 , typename I2 > KOKKOS_FORCEINLINE_FUNCTION reference_type reference( const I0 & i0 , const I1 & i1 , const I2 & i2 ) const - { return reference_type( m_handle + m_offset(i0,i1,i2) * Array_S , Array_N , m_stride ); } + { return reference_type( m_impl_handle + m_impl_offset(i0,i1,i2) * Array_S , Array_N , m_stride ); } template< typename I0 , typename I1 , typename I2 , typename I3 > KOKKOS_FORCEINLINE_FUNCTION reference_type reference( const I0 & i0 , const I1 & i1 , const I2 & i2 , const I3 & i3 ) const - { return reference_type( m_handle + m_offset(i0,i1,i2,i3) * Array_S , Array_N , m_stride ); } + { return reference_type( m_impl_handle + m_impl_offset(i0,i1,i2,i3) * Array_S , Array_N , m_stride ); } template< typename I0 , typename I1 , typename I2 , typename I3 , typename I4 > KOKKOS_FORCEINLINE_FUNCTION reference_type reference( const I0 & i0 , const I1 & i1 , const I2 & i2 , const I3 & i3 , const I4 & i4 ) const - { return reference_type( m_handle + m_offset(i0,i1,i2,i3,i4) * Array_S , Array_N , m_stride ); } + { return reference_type( m_impl_handle + m_impl_offset(i0,i1,i2,i3,i4) * Array_S , Array_N , m_stride ); } template< typename I0 , typename I1 , typename I2 , typename I3 , typename I4 , typename I5 > KOKKOS_FORCEINLINE_FUNCTION reference_type reference( const I0 & i0 , const I1 & i1 , const I2 & i2 , const I3 & i3 , const I4 & i4 , const I5 & i5 ) const - { return reference_type( m_handle + m_offset(i0,i1,i2,i3,i4,i5) * Array_S , Array_N , m_stride ); } + { return reference_type( m_impl_handle + m_impl_offset(i0,i1,i2,i3,i4,i5) * Array_S , Array_N , m_stride ); } template< typename I0 , typename I1 , typename I2 , typename I3 , typename I4 , typename I5 , typename I6 > KOKKOS_FORCEINLINE_FUNCTION reference_type reference( const I0 & i0 , const I1 & i1 , const I2 & i2 , const I3 & i3 , const I4 & i4 , const I5 & i5 , const I6 & i6 ) const - { return reference_type( m_handle + m_offset(i0,i1,i2,i3,i4,i5,i6) * Array_S , Array_N , m_stride ); } + { return reference_type( m_impl_handle + m_impl_offset(i0,i1,i2,i3,i4,i5,i6) * Array_S , Array_N , m_stride ); } template< typename I0 , typename I1 , typename I2 , typename I3 , typename I4 , typename I5 , typename I6 , typename I7 > KOKKOS_FORCEINLINE_FUNCTION reference_type reference( const I0 & i0 , const I1 & i1 , const I2 & i2 , const I3 & i3 , const I4 & i4 , const I5 & i5 , const I6 & i6 , const I7 & i7 ) const - { return reference_type( m_handle + m_offset(i0,i1,i2,i3,i4,i5,i6,i7) * Array_S , Array_N , m_stride ); } + { return reference_type( m_impl_handle + m_impl_offset(i0,i1,i2,i3,i4,i5,i6,i7) * Array_S , Array_N , m_stride ); } //---------------------------------------- @@ -269,31 +269,31 @@ public: /** \brief Span, in bytes, of the referenced memory */ KOKKOS_INLINE_FUNCTION constexpr size_t memory_span() const { - return ( m_offset.span() * Array_N * MemorySpanSize + MemorySpanMask ) & ~size_t(MemorySpanMask); + return ( m_impl_offset.span() * Array_N * MemorySpanSize + MemorySpanMask ) & ~size_t(MemorySpanMask); } //---------------------------------------- KOKKOS_INLINE_FUNCTION ~ViewMapping() {} - KOKKOS_INLINE_FUNCTION ViewMapping() : m_handle(), m_offset(), m_stride(0) {} + KOKKOS_INLINE_FUNCTION ViewMapping() : m_impl_handle(), m_impl_offset(), m_stride(0) {} KOKKOS_INLINE_FUNCTION ViewMapping( const ViewMapping & rhs ) - : m_handle( rhs.m_handle ), m_offset( rhs.m_offset ), m_stride( rhs.m_stride ) {} + : m_impl_handle( rhs.m_impl_handle ), m_impl_offset( rhs.m_impl_offset ), m_stride( rhs.m_stride ) {} KOKKOS_INLINE_FUNCTION ViewMapping & operator = ( const ViewMapping & rhs ) - { m_handle = rhs.m_handle ; m_offset = rhs.m_offset ; m_stride = rhs.m_stride ; ; return *this ; } + { m_impl_handle = rhs.m_impl_handle ; m_impl_offset = rhs.m_impl_offset ; m_stride = rhs.m_stride ; ; return *this ; } KOKKOS_INLINE_FUNCTION ViewMapping( ViewMapping && rhs ) - : m_handle( rhs.m_handle ), m_offset( rhs.m_offset ), m_stride( rhs.m_stride ) {} + : m_impl_handle( rhs.m_impl_handle ), m_impl_offset( rhs.m_impl_offset ), m_stride( rhs.m_stride ) {} KOKKOS_INLINE_FUNCTION ViewMapping & operator = ( ViewMapping && rhs ) - { m_handle = rhs.m_handle ; m_offset = rhs.m_offset ; m_stride = rhs.m_stride ; return *this ; } + { m_impl_handle = rhs.m_impl_handle ; m_impl_offset = rhs.m_impl_offset ; m_stride = rhs.m_stride ; return *this ; } //---------------------------------------- template< class ... Args > KOKKOS_INLINE_FUNCTION ViewMapping( pointer_type ptr , Args ... args ) - : m_handle( ptr ) - , m_offset( std::integral_constant< unsigned , 0 >() , args... ) - , m_stride( m_offset.span() ) + : m_impl_handle( ptr ) + , m_impl_offset( std::integral_constant< unsigned , 0 >() , args... ) + , m_stride( m_impl_offset.span() ) {} //---------------------------------------- @@ -315,10 +315,10 @@ public: typedef std::integral_constant< unsigned , alloc_prop::allow_padding ? sizeof(scalar_type) : 0 > padding ; - m_offset = offset_type( padding(), arg_layout ); + m_impl_offset = offset_type( padding(), arg_layout ); const size_t alloc_size = - ( m_offset.span() * Array_N * MemorySpanSize + MemorySpanMask ) & ~size_t(MemorySpanMask); + ( m_impl_offset.span() * Array_N * MemorySpanSize + MemorySpanMask ) & ~size_t(MemorySpanMask); // Allocate memory from the memory space and create tracking record. record_type * const record = @@ -327,14 +327,14 @@ public: , alloc_size ); if ( alloc_size ) { - m_handle = + m_impl_handle = handle_type( reinterpret_cast< pointer_type >( record->data() ) ); if ( alloc_prop::initialize ) { // The functor constructs and destroys record->m_destroy = functor_type( ((Kokkos::Impl::ViewCtorProp<void,execution_space> const & )arg_prop).value - , (pointer_type) m_handle - , m_offset.span() * Array_N + , (pointer_type) m_impl_handle + , m_impl_offset.span() * Array_N ); record->m_destroy.construct_shared_allocation(); @@ -397,8 +397,8 @@ public: typedef typename DstType::offset_type dst_offset_type ; - dst.m_offset = dst_offset_type( src.m_offset ); - dst.m_handle = src.m_handle ; + dst.m_impl_offset = dst_offset_type( src.m_impl_offset ); + dst.m_impl_handle = src.m_impl_handle ; dst.m_stride = src.m_stride ; } }; @@ -448,7 +448,7 @@ public: // Array dimension becomes the last dimension. // Arguments beyond the destination rank are ignored. if ( src.span_is_contiguous() ) { // not padded - dst.m_offset = dst_offset_type( std::integral_constant<unsigned,0>() , + dst.m_impl_offset = dst_offset_type( std::integral_constant<unsigned,0>() , typename DstTraits::array_layout ( ( 0 < SrcType::Rank ? src.dimension_0() : SrcTraits::value_type::size() ) , ( 1 < SrcType::Rank ? src.dimension_1() : SrcTraits::value_type::size() ) @@ -463,7 +463,7 @@ public: else { // is padded typedef std::integral_constant<unsigned,sizeof(typename SrcTraits::value_type::value_type)> padded ; - dst.m_offset = dst_offset_type( padded() , + dst.m_impl_offset = dst_offset_type( padded() , typename DstTraits::array_layout ( ( 0 < SrcType::Rank ? src.dimension_0() : SrcTraits::value_type::size() ) , ( 1 < SrcType::Rank ? src.dimension_1() : SrcTraits::value_type::size() ) @@ -476,7 +476,7 @@ public: ) ); } - dst.m_handle = src.m_handle ; + dst.m_impl_handle = src.m_impl_handle ; } }; @@ -579,11 +579,11 @@ public: typedef typename DstType::handle_type dst_handle_type ; const SubviewExtents< SrcTraits::rank , rank > - extents( src.m_offset.m_dim , args... ); + extents( src.m_impl_offset.m_dim , args... ); - dst.m_offset = dst_offset_type( src.m_offset , extents ); - dst.m_handle = dst_handle_type( src.m_handle + - src.m_offset( extents.domain_offset(0) + dst.m_impl_offset = dst_offset_type( src.m_impl_offset , extents ); + dst.m_impl_handle = dst_handle_type( src.m_impl_handle + + src.m_impl_offset( extents.domain_offset(0) , extents.domain_offset(1) , extents.domain_offset(2) , extents.domain_offset(3) diff --git a/packages/kokkos/core/src/impl/Kokkos_ViewLayoutTiled.hpp b/packages/kokkos/core/src/impl/Kokkos_ViewLayoutTiled.hpp new file mode 100644 index 0000000000000000000000000000000000000000..a64101110ff0be63d93d4453b9acdf8b6eccb2f8 --- /dev/null +++ b/packages/kokkos/core/src/impl/Kokkos_ViewLayoutTiled.hpp @@ -0,0 +1,945 @@ +/* +//@HEADER +// ************************************************************************ +// +// Kokkos v. 2.0 +// Copyright (2014) Sandia Corporation +// +// Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, +// the U.S. Government retains certain rights in this software. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// +// 3. Neither the name of the Corporation nor the names of the +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY +// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE +// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) +// +// ************************************************************************ +//@HEADER +*/ + +#ifndef KOKKOS_EXPERIMENTAL_VIEWLAYOUTTILE_HPP +#define KOKKOS_EXPERIMENTAL_VIEWLAYOUTTILE_HPP + +#ifndef KOKKOS_ENABLE_DEPRECATED_CODE + +#include <Kokkos_Layout.hpp> +#include <Kokkos_View.hpp> + +//---------------------------------------------------------------------------- +//---------------------------------------------------------------------------- + +namespace Kokkos { + +// View offset and mapping for tiled view's + +template < Kokkos::Iterate OuterP, Kokkos::Iterate InnerP, unsigned ArgN0 , unsigned ArgN1 > +struct is_array_layout < Kokkos::Experimental::LayoutTiled<OuterP, InnerP, ArgN0, ArgN1, 0, 0, 0, 0, 0, 0, true> > : public std::true_type {}; + +template < Kokkos::Iterate OuterP, Kokkos::Iterate InnerP, unsigned ArgN0 , unsigned ArgN1 , unsigned ArgN2 > +struct is_array_layout < Kokkos::Experimental::LayoutTiled<OuterP, InnerP, ArgN0, ArgN1, ArgN2, 0, 0, 0, 0, 0, true> > : public std::true_type {}; + +template < Kokkos::Iterate OuterP, Kokkos::Iterate InnerP, unsigned ArgN0 , unsigned ArgN1 , unsigned ArgN2 , unsigned ArgN3 > +struct is_array_layout < Kokkos::Experimental::LayoutTiled<OuterP, InnerP, ArgN0, ArgN1, ArgN2, ArgN3, 0, 0, 0, 0, true> > : public std::true_type {}; + +template < Kokkos::Iterate OuterP, Kokkos::Iterate InnerP, unsigned ArgN0 , unsigned ArgN1 , unsigned ArgN2 , unsigned ArgN3 , unsigned ArgN4 > +struct is_array_layout < Kokkos::Experimental::LayoutTiled<OuterP, InnerP, ArgN0, ArgN1, ArgN2, ArgN3, ArgN4, 0, 0, 0, true> > : public std::true_type {}; + +template < Kokkos::Iterate OuterP, Kokkos::Iterate InnerP, unsigned ArgN0 , unsigned ArgN1 , unsigned ArgN2 , unsigned ArgN3 , unsigned ArgN4 , unsigned ArgN5 > +struct is_array_layout < Kokkos::Experimental::LayoutTiled<OuterP, InnerP, ArgN0, ArgN1, ArgN2, ArgN3, ArgN4, ArgN5, 0, 0, true> > : public std::true_type {}; + +template < Kokkos::Iterate OuterP, Kokkos::Iterate InnerP, unsigned ArgN0 , unsigned ArgN1 , unsigned ArgN2 , unsigned ArgN3 , unsigned ArgN4 , unsigned ArgN5 , unsigned ArgN6 > +struct is_array_layout < Kokkos::Experimental::LayoutTiled<OuterP, InnerP, ArgN0, ArgN1, ArgN2, ArgN3, ArgN4, ArgN5, ArgN6, 0, true> > : public std::true_type {}; + +template < Kokkos::Iterate OuterP, Kokkos::Iterate InnerP, unsigned ArgN0 , unsigned ArgN1 , unsigned ArgN2 , unsigned ArgN3 , unsigned ArgN4 , unsigned ArgN5 , unsigned ArgN6 , unsigned ArgN7 > +struct is_array_layout < Kokkos::Experimental::LayoutTiled<OuterP, InnerP, ArgN0, ArgN1, ArgN2, ArgN3, ArgN4, ArgN5, ArgN6, ArgN7, true> > : public std::true_type {}; + + +template< class L > +struct is_array_layout_tiled : public std::false_type {}; + +template < Kokkos::Iterate OuterP, Kokkos::Iterate InnerP, unsigned ArgN0 , unsigned ArgN1 , unsigned ArgN2 , unsigned ArgN3 , unsigned ArgN4 , unsigned ArgN5 , unsigned ArgN6 , unsigned ArgN7 , bool IsPowerTwo > +struct is_array_layout_tiled < Kokkos::Experimental::LayoutTiled<OuterP, InnerP, ArgN0, ArgN1, ArgN2, ArgN3, ArgN4, ArgN5, ArgN6, ArgN7, IsPowerTwo> > : public std::true_type {}; // Last template parameter "true" meaning this currently only supports powers-of-two + + +namespace Impl { + +template< class Dimension , class Layout > +struct ViewOffset< Dimension , Layout , + typename std::enable_if<( + ( Dimension::rank <= 8 ) + && + ( Dimension::rank >= 2 ) + && + is_array_layout< Layout >::value + && + is_array_layout_tiled< Layout >::value + )>::type > +{ +public: + +// enum { outer_pattern = Layout::outer_pattern }; +// enum { inner_pattern = Layout::inner_pattern }; + static constexpr Kokkos::Iterate outer_pattern = Layout::outer_pattern; + static constexpr Kokkos::Iterate inner_pattern = Layout::inner_pattern; + + enum { VORank = Dimension::rank }; + + enum { SHIFT_0 = Kokkos::Impl::integral_power_of_two(Layout::N0) }; + enum { SHIFT_1 = Kokkos::Impl::integral_power_of_two(Layout::N1) }; + enum { SHIFT_2 = Kokkos::Impl::integral_power_of_two(Layout::N2) }; + enum { SHIFT_3 = Kokkos::Impl::integral_power_of_two(Layout::N3) }; + enum { SHIFT_4 = Kokkos::Impl::integral_power_of_two(Layout::N4) }; + enum { SHIFT_5 = Kokkos::Impl::integral_power_of_two(Layout::N5) }; + enum { SHIFT_6 = Kokkos::Impl::integral_power_of_two(Layout::N6) }; + enum { SHIFT_7 = Kokkos::Impl::integral_power_of_two(Layout::N7) }; + enum { MASK_0 = Layout::N0 - 1 }; + enum { MASK_1 = Layout::N1 - 1 }; + enum { MASK_2 = Layout::N2 - 1 }; + enum { MASK_3 = Layout::N3 - 1 }; + enum { MASK_4 = Layout::N4 - 1 }; + enum { MASK_5 = Layout::N5 - 1 }; + enum { MASK_6 = Layout::N6 - 1 }; + enum { MASK_7 = Layout::N7 - 1 }; + + enum { SHIFT_2T = SHIFT_0 + SHIFT_1 }; + enum { SHIFT_3T = SHIFT_0 + SHIFT_1 + SHIFT_2 }; + enum { SHIFT_4T = SHIFT_0 + SHIFT_1 + SHIFT_2 + SHIFT_3 }; + enum { SHIFT_5T = SHIFT_0 + SHIFT_1 + SHIFT_2 + SHIFT_3 + SHIFT_4 }; + enum { SHIFT_6T = SHIFT_0 + SHIFT_1 + SHIFT_2 + SHIFT_3 + SHIFT_4 + SHIFT_5 }; + enum { SHIFT_7T = SHIFT_0 + SHIFT_1 + SHIFT_2 + SHIFT_3 + SHIFT_4 + SHIFT_5 + SHIFT_6 }; + enum { SHIFT_8T = SHIFT_0 + SHIFT_1 + SHIFT_2 + SHIFT_3 + SHIFT_4 + SHIFT_5 + SHIFT_6 + SHIFT_7 }; + + // Is an irregular layout that does not have uniform striding for each index. + using is_mapping_plugin = std::true_type ; + using is_regular = std::false_type ; + + typedef size_t size_type ; + typedef Dimension dimension_type ; + typedef Layout array_layout ; + + dimension_type m_dim ; + size_type m_tile_N0 ; // Num tiles dim 0 + size_type m_tile_N1 ; + size_type m_tile_N2 ; + size_type m_tile_N3 ; + size_type m_tile_N4 ; + size_type m_tile_N5 ; + size_type m_tile_N6 ; + size_type m_tile_N7 ; + + //---------------------------------------- + +#define DEBUG_OUTPUT_CHECK 0 + + // Rank 2 + template< typename I0 , typename I1 > + KOKKOS_INLINE_FUNCTION + size_type operator()( I0 const & i0 , I1 const & i1 ) const { + auto tile_offset = (outer_pattern == (Kokkos::Iterate::Left)) + ? ( ( (i0>>SHIFT_0) + m_tile_N0*((i1>>SHIFT_1)) ) << SHIFT_2T) + : ( ( (m_tile_N1*(i0>>SHIFT_0) + (i1>>SHIFT_1)) ) << SHIFT_2T) ; + // ( num_tiles[1] * ti0 + ti1 ) * FTD + + auto local_offset = (inner_pattern == (Kokkos::Iterate::Left)) + ? ( (i0 & MASK_0) + ((i1 & MASK_1)<<SHIFT_0) ) + : ( ((i0 & MASK_0) << SHIFT_1) + (i1 & MASK_1) ) ; + // ( tile_dim[1] * li0 + li1 ) + +#if DEBUG_OUTPUT_CHECK + std::cout << "Am I Outer Left? " << (outer_pattern == (Kokkos::Iterate::Left)) << std::endl; + std::cout << "Am I Inner Left? " << (inner_pattern == (Kokkos::Iterate::Left)) << std::endl; + std::cout << "i0 = " << i0 + << " i1 = " << i1 + << "\ntilei0 = " << (i0>>SHIFT_0) + << " tilei1 = " << (i1>>SHIFT_1) + << "locali0 = " << (i0 & MASK_0) + << "\nlocali1 = " << (i1 & MASK_1) + << std::endl; +#endif + + return tile_offset + local_offset; + } + + // Rank 3 + template< typename I0 , typename I1 , typename I2 > + KOKKOS_INLINE_FUNCTION + size_type operator()( I0 const & i0 , I1 const & i1 , I2 const & i2 ) const { + auto tile_offset = (outer_pattern == Kokkos::Iterate::Left) + ? ( ( (i0>>SHIFT_0) + m_tile_N0*((i1>>SHIFT_1) + m_tile_N1*(i2>>SHIFT_2)) ) << SHIFT_3T) + : ( ( m_tile_N2*(m_tile_N1*(i0>>SHIFT_0) + (i1>>SHIFT_1)) + (i2>>SHIFT_2) ) << SHIFT_3T) ; + + auto local_offset = (inner_pattern == Kokkos::Iterate::Left) + ? ( (i0 & MASK_0) + ((i1 & MASK_1)<<SHIFT_0) + ((i2 & MASK_2)<<(SHIFT_0+SHIFT_1)) ) + : ( ((i0 & MASK_0) << (SHIFT_2+SHIFT_1)) + ((i1 & MASK_1) << (SHIFT_2)) + (i2 & MASK_2) ) ; + +#if DEBUG_OUTPUT_CHECK + std::cout << "Am I Outer Left? " << (outer_pattern == (Kokkos::Iterate::Left)) << std::endl; + std::cout << "Am I Inner Left? " << (inner_pattern == (Kokkos::Iterate::Left)) << std::endl; + std::cout << "i0 = " << i0 + << " i1 = " << i1 + << " i2 = " << i2 + << "\ntilei0 = " << (i0>>SHIFT_0) + << " tilei1 = " << (i1>>SHIFT_1) + << " tilei2 = " << (i2>>SHIFT_2) + << "\nlocali0 = " << (i0 & MASK_0) + << "locali1 = " << (i1 & MASK_1) + << "locali2 = " << (i2 & MASK_2) + << std::endl; +#endif + + return tile_offset + local_offset; + } + + // Rank 4 + template< typename I0 , typename I1 , typename I2 , typename I3 > + KOKKOS_INLINE_FUNCTION + size_type operator()( I0 const & i0 , I1 const & i1 , I2 const & i2 , I3 const & i3 ) const { + auto tile_offset = (outer_pattern == Kokkos::Iterate::Left) + ? ( ( (i0>>SHIFT_0) + m_tile_N0*((i1>>SHIFT_1) + m_tile_N1*((i2>>SHIFT_2) + m_tile_N2*(i3>>SHIFT_3))) ) << SHIFT_4T) + : ( ( m_tile_N3*(m_tile_N2*(m_tile_N1*(i0>>SHIFT_0) + (i1>>SHIFT_1)) + (i2>>SHIFT_2)) + (i3>>SHIFT_3) ) << SHIFT_4T) ; + + auto local_offset = (inner_pattern == Kokkos::Iterate::Left) + ? ( (i0 & MASK_0) + ((i1 & MASK_1)<<SHIFT_0) + ((i2 & MASK_2)<<(SHIFT_0+SHIFT_1)) + ((i3 & MASK_3)<<(SHIFT_0+SHIFT_1+SHIFT_2)) ) + : ( ((i0 & MASK_0) << (SHIFT_3+SHIFT_2+SHIFT_1)) + ((i1 & MASK_1) << (SHIFT_3+SHIFT_2)) + ((i2 & MASK_2)<<(SHIFT_3)) + (i3 & MASK_3) ) ; + + return tile_offset + local_offset; + } + + // Rank 5 + template< typename I0 , typename I1 , typename I2 , typename I3 , typename I4 > + KOKKOS_INLINE_FUNCTION + size_type operator()( I0 const & i0 , I1 const & i1 , I2 const & i2 , I3 const & i3 , I4 const & i4 ) const { + auto tile_offset = (outer_pattern == Kokkos::Iterate::Left) + ? ( ( (i0>>SHIFT_0) + m_tile_N0*((i1>>SHIFT_1) + m_tile_N1*((i2>>SHIFT_2) + m_tile_N2*((i3>>SHIFT_3) + m_tile_N3*(i4>>SHIFT_4)))) ) << SHIFT_5T) + : ( ( m_tile_N4*(m_tile_N3*(m_tile_N2*(m_tile_N1*(i0>>SHIFT_0) + (i1>>SHIFT_1)) + (i2>>SHIFT_2)) + (i3>>SHIFT_3)) + (i4>>SHIFT_4) ) << SHIFT_5T) ; + + auto local_offset = (inner_pattern == Kokkos::Iterate::Left) + ? ( (i0 & MASK_0) + ((i1 & MASK_1)<<SHIFT_0) + ((i2 & MASK_2)<<(SHIFT_0+SHIFT_1)) + ((i3 & MASK_3)<<(SHIFT_0+SHIFT_1+SHIFT_2)) + ((i4 & MASK_4)<<(SHIFT_0+SHIFT_1+SHIFT_2+SHIFT_3)) ) + : ( ((i0 & MASK_0) << (SHIFT_4+SHIFT_3+SHIFT_2+SHIFT_1)) + ((i1 & MASK_1) << (SHIFT_4+SHIFT_3+SHIFT_2)) + ((i2 & MASK_2)<<(SHIFT_4+SHIFT_3)) + ((i3 & MASK_3)<<(SHIFT_4)) + (i4 & MASK_4) ) ; + + return tile_offset + local_offset; + } + + // Rank 6 + template< typename I0 , typename I1 , typename I2 , typename I3 , typename I4 , typename I5 > + KOKKOS_INLINE_FUNCTION + size_type operator()( I0 const & i0 , I1 const & i1 , I2 const & i2 , I3 const & i3 , I4 const & i4 , I5 const & i5 ) const { + auto tile_offset = (outer_pattern == Kokkos::Iterate::Left) + ? ( ( (i0>>SHIFT_0) + m_tile_N0*((i1>>SHIFT_1) + m_tile_N1*((i2>>SHIFT_2) + m_tile_N2*((i3>>SHIFT_3) + m_tile_N3*((i4>>SHIFT_4) + m_tile_N4*(i5>>SHIFT_5))))) ) << SHIFT_6T) + : ( ( m_tile_N5*(m_tile_N4*(m_tile_N3*(m_tile_N2*(m_tile_N1*(i0>>SHIFT_0) + (i1>>SHIFT_1)) + (i2>>SHIFT_2)) + (i3>>SHIFT_3)) + (i4>>SHIFT_4)) + (i5>>SHIFT_5) ) << SHIFT_6T) ; + + auto local_offset = (inner_pattern == Kokkos::Iterate::Left) + ? ( (i0 & MASK_0) + ((i1 & MASK_1)<<SHIFT_0) + ((i2 & MASK_2)<<(SHIFT_0+SHIFT_1)) + ((i3 & MASK_3)<<(SHIFT_0+SHIFT_1+SHIFT_2)) + ((i4 & MASK_4)<<(SHIFT_0+SHIFT_1+SHIFT_2+SHIFT_3)) + ((i5 & MASK_5)<<(SHIFT_0+SHIFT_1+SHIFT_2+SHIFT_3+SHIFT_4)) ) + : ( ((i0 & MASK_0) << (SHIFT_5+SHIFT_4+SHIFT_3+SHIFT_2+SHIFT_1)) + ((i1 & MASK_1) << (SHIFT_5+SHIFT_4+SHIFT_3+SHIFT_2)) + ((i2 & MASK_2)<<(SHIFT_5+SHIFT_4+SHIFT_3)) + ((i3 & MASK_3)<<(SHIFT_5+SHIFT_4)) + ((i4 & MASK_4)<<(SHIFT_5)) + (i5 & MASK_5) ) ; + + return tile_offset + local_offset; + } + + // Rank 7 + template< typename I0 , typename I1 , typename I2 , typename I3 , typename I4 , typename I5 , typename I6 > + KOKKOS_INLINE_FUNCTION + size_type operator()( I0 const & i0 , I1 const & i1 , I2 const & i2 , I3 const & i3 , I4 const & i4 , I5 const & i5 , I6 const & i6 ) const { + auto tile_offset = (outer_pattern == Kokkos::Iterate::Left) + ? ( ( (i0>>SHIFT_0) + m_tile_N0*((i1>>SHIFT_1) + m_tile_N1*((i2>>SHIFT_2) + m_tile_N2*((i3>>SHIFT_3) + m_tile_N3*((i4>>SHIFT_4) + m_tile_N4*((i5>>SHIFT_5) + m_tile_N5*(i6>>SHIFT_6)))))) ) << SHIFT_7T) + : ( ( m_tile_N6*(m_tile_N5*(m_tile_N4*(m_tile_N3*(m_tile_N2*(m_tile_N1*(i0>>SHIFT_0) + (i1>>SHIFT_1)) + (i2>>SHIFT_2)) + (i3>>SHIFT_3)) + (i4>>SHIFT_4)) + (i5>>SHIFT_5)) + (i6>>SHIFT_6) ) << SHIFT_7T) ; + + auto local_offset = (inner_pattern == Kokkos::Iterate::Left) + ? ( (i0 & MASK_0) + ((i1 & MASK_1)<<SHIFT_0) + ((i2 & MASK_2)<<(SHIFT_0+SHIFT_1)) + ((i3 & MASK_3)<<(SHIFT_0+SHIFT_1+SHIFT_2)) + ((i4 & MASK_4)<<(SHIFT_0+SHIFT_1+SHIFT_2+SHIFT_3)) + ((i5 & MASK_5)<<(SHIFT_0+SHIFT_1+SHIFT_2+SHIFT_3+SHIFT_4)) + ((i6 & MASK_6)<<(SHIFT_0+SHIFT_1+SHIFT_2+SHIFT_3+SHIFT_4+SHIFT_5)) ) + : ( ((i0 & MASK_0) << (SHIFT_6+SHIFT_5+SHIFT_4+SHIFT_3+SHIFT_2+SHIFT_1)) + ((i1 & MASK_1) << (SHIFT_6+SHIFT_5+SHIFT_4+SHIFT_3+SHIFT_2)) + ((i2 & MASK_2)<<(SHIFT_6+SHIFT_5+SHIFT_4+SHIFT_3)) + ((i3 & MASK_3)<<(SHIFT_6+SHIFT_5+SHIFT_4)) + ((i4 & MASK_4)<<(SHIFT_6+SHIFT_5)) + ((i5 & MASK_5)<<(SHIFT_6)) + (i6 & MASK_6) ) ; + + return tile_offset + local_offset; + } + + // Rank 8 + template< typename I0 , typename I1 , typename I2 , typename I3 , typename I4 , typename I5 , typename I6 , typename I7 > + KOKKOS_INLINE_FUNCTION + size_type operator()( I0 const & i0 , I1 const & i1 , I2 const & i2 , I3 const & i3 , I4 const & i4 , I5 const & i5 , I6 const & i6 , I7 const & i7 ) const { + auto tile_offset = (outer_pattern == Kokkos::Iterate::Left) + ? ( ( (i0>>SHIFT_0) + m_tile_N0*((i1>>SHIFT_1) + m_tile_N1*((i2>>SHIFT_2) + m_tile_N2*((i3>>SHIFT_3) + m_tile_N3*((i4>>SHIFT_4) + m_tile_N4*((i5>>SHIFT_5) + m_tile_N5*((i6>>SHIFT_6) + m_tile_N6*(i7>>SHIFT_7))))))) ) << SHIFT_8T) + : ( ( m_tile_N7*(m_tile_N6*(m_tile_N5*(m_tile_N4*(m_tile_N3*(m_tile_N2*(m_tile_N1*(i0>>SHIFT_0) + (i1>>SHIFT_1)) + (i2>>SHIFT_2)) + (i3>>SHIFT_3)) + (i4>>SHIFT_4)) + (i5>>SHIFT_5)) + (i6>>SHIFT_6)) + (i7>>SHIFT_7) ) << SHIFT_8T) ; + + auto local_offset = (inner_pattern == Kokkos::Iterate::Left) + ? ( (i0 & MASK_0) + ((i1 & MASK_1)<<SHIFT_0) + ((i2 & MASK_2)<<(SHIFT_0+SHIFT_1)) + ((i3 & MASK_3)<<(SHIFT_0+SHIFT_1+SHIFT_2)) + ((i4 & MASK_4)<<(SHIFT_0+SHIFT_1+SHIFT_2+SHIFT_3)) + ((i5 & MASK_5)<<(SHIFT_0+SHIFT_1+SHIFT_2+SHIFT_3+SHIFT_4)) + ((i6 & MASK_6)<<(SHIFT_0+SHIFT_1+SHIFT_2+SHIFT_3+SHIFT_4+SHIFT_5)) + ((i7 & MASK_7)<<(SHIFT_0+SHIFT_1+SHIFT_2+SHIFT_3+SHIFT_4+SHIFT_5+SHIFT_6)) ) + : ( ((i0 & MASK_0) << (SHIFT_7+SHIFT_6+SHIFT_5+SHIFT_4+SHIFT_3+SHIFT_2+SHIFT_1)) + ((i1 & MASK_1) << (SHIFT_7+SHIFT_6+SHIFT_5+SHIFT_4+SHIFT_3+SHIFT_2)) + ((i2 & MASK_2)<<(SHIFT_7+SHIFT_6+SHIFT_5+SHIFT_4+SHIFT_3)) + ((i3 & MASK_3)<<(SHIFT_7+SHIFT_6+SHIFT_5+SHIFT_4)) + ((i4 & MASK_4)<<(SHIFT_7+SHIFT_6+SHIFT_5)) + ((i5 & MASK_5)<<(SHIFT_7+SHIFT_6)) + ((i6 & MASK_6)<<(SHIFT_7)) + (i7 & MASK_7) ) ; + + return tile_offset + local_offset; + } + + //---------------------------------------- + + KOKKOS_INLINE_FUNCTION constexpr + array_layout layout() const + { return array_layout( m_dim.N0 , m_dim.N1 , m_dim.N2 , m_dim.N2 , m_dim.N3 , m_dim.N4 , m_dim.N5 , m_dim.N6 , m_dim.N7 ); } + + KOKKOS_INLINE_FUNCTION constexpr size_type dimension_0() const { return m_dim.N0 ; } + KOKKOS_INLINE_FUNCTION constexpr size_type dimension_1() const { return m_dim.N1 ; } + KOKKOS_INLINE_FUNCTION constexpr size_type dimension_2() const { return m_dim.N2 ; } + KOKKOS_INLINE_FUNCTION constexpr size_type dimension_3() const { return m_dim.N3 ; } + KOKKOS_INLINE_FUNCTION constexpr size_type dimension_4() const { return m_dim.N4 ; } + KOKKOS_INLINE_FUNCTION constexpr size_type dimension_5() const { return m_dim.N5 ; } + KOKKOS_INLINE_FUNCTION constexpr size_type dimension_6() const { return m_dim.N6 ; } + KOKKOS_INLINE_FUNCTION constexpr size_type dimension_7() const { return m_dim.N7 ; } + + KOKKOS_INLINE_FUNCTION constexpr size_type size() const { return m_dim.N0 * m_dim.N1 * m_dim.N2 * m_dim.N3 * m_dim.N4 * m_dim.N5 * m_dim.N6 * m_dim.N7 ; } + + // Strides are meaningless due to irregularity + KOKKOS_INLINE_FUNCTION constexpr size_type stride_0() const { return 0 ; } + KOKKOS_INLINE_FUNCTION constexpr size_type stride_1() const { return 0 ; } + KOKKOS_INLINE_FUNCTION constexpr size_type stride_2() const { return 0 ; } + KOKKOS_INLINE_FUNCTION constexpr size_type stride_3() const { return 0 ; } + KOKKOS_INLINE_FUNCTION constexpr size_type stride_4() const { return 0 ; } + KOKKOS_INLINE_FUNCTION constexpr size_type stride_5() const { return 0 ; } + KOKKOS_INLINE_FUNCTION constexpr size_type stride_6() const { return 0 ; } + KOKKOS_INLINE_FUNCTION constexpr size_type stride_7() const { return 0 ; } + + // Stride with [ rank ] value is the total length + template< typename iType > + KOKKOS_INLINE_FUNCTION + void stride( iType * const s ) const + { + s[0] = 0 ; + if ( 0 < dimension_type::rank ) { s[1] = 0 ; } + if ( 1 < dimension_type::rank ) { s[2] = 0 ; } + if ( 2 < dimension_type::rank ) { s[3] = 0 ; } + if ( 3 < dimension_type::rank ) { s[4] = 0 ; } + if ( 4 < dimension_type::rank ) { s[5] = 0 ; } + if ( 5 < dimension_type::rank ) { s[6] = 0 ; } + if ( 6 < dimension_type::rank ) { s[7] = 0 ; } + if ( 7 < dimension_type::rank ) { s[8] = 0 ; } + } + + KOKKOS_INLINE_FUNCTION constexpr size_type span() const + { + // Rank2: ( NumTile0 * ( NumTile1 ) ) * TileSize, etc + return ( VORank == 2 ) ? ( m_tile_N0 * m_tile_N1 ) << SHIFT_2T + : ( VORank == 3 ) ? ( m_tile_N0 * m_tile_N1 * m_tile_N2 ) << SHIFT_3T + : ( VORank == 4 ) ? ( m_tile_N0 * m_tile_N1 * m_tile_N2 * m_tile_N3 ) << SHIFT_4T + : ( VORank == 5 ) ? ( m_tile_N0 * m_tile_N1 * m_tile_N2 * m_tile_N3 * m_tile_N4 ) << SHIFT_5T + : ( VORank == 6 ) ? ( m_tile_N0 * m_tile_N1 * m_tile_N2 * m_tile_N3 * m_tile_N4 * m_tile_N5 ) << SHIFT_6T + : ( VORank == 7 ) ? ( m_tile_N0 * m_tile_N1 * m_tile_N2 * m_tile_N3 * m_tile_N4 * m_tile_N5 * m_tile_N6 ) << SHIFT_7T + : ( m_tile_N0 * m_tile_N1 * m_tile_N2 * m_tile_N3 * m_tile_N4 * m_tile_N5 * m_tile_N6 * m_tile_N7 ) << SHIFT_8T ; + } + + KOKKOS_INLINE_FUNCTION constexpr bool span_is_contiguous() const + { + return true; + } + + //---------------------------------------- + +#ifdef KOKKOS_CUDA_9_DEFAULTED_BUG_WORKAROUND + KOKKOS_INLINE_FUNCTION ~ViewOffset() {} + KOKKOS_INLINE_FUNCTION ViewOffset() {} + KOKKOS_INLINE_FUNCTION ViewOffset( const ViewOffset & rhs ) + : m_dim(rhs.m_dim) + , m_tile_N0(rhs.m_tile_N0) + , m_tile_N1(rhs.m_tile_N1) + , m_tile_N2(rhs.m_tile_N2) + , m_tile_N3(rhs.m_tile_N3) + , m_tile_N4(rhs.m_tile_N4) + , m_tile_N5(rhs.m_tile_N5) + , m_tile_N6(rhs.m_tile_N6) + , m_tile_N7(rhs.m_tile_N7) + {} + + KOKKOS_INLINE_FUNCTION ViewOffset & operator = ( const ViewOffset & rhs ) { + m_dim = rhs.m_dim; + m_tile_N0 = rhs.m_tile_N0; + m_tile_N1 = rhs.m_tile_N1; + m_tile_N2 = rhs.m_tile_N2; + m_tile_N3 = rhs.m_tile_N3; + m_tile_N4 = rhs.m_tile_N4; + m_tile_N5 = rhs.m_tile_N5; + m_tile_N6 = rhs.m_tile_N6; + m_tile_N7 = rhs.m_tile_N7; + return *this; + } + +#else + KOKKOS_INLINE_FUNCTION ~ViewOffset() = default; + KOKKOS_INLINE_FUNCTION ViewOffset() = default; + KOKKOS_INLINE_FUNCTION ViewOffset( const ViewOffset & ) = default; + KOKKOS_INLINE_FUNCTION ViewOffset & operator = ( const ViewOffset & ) = default; +#endif + + template< unsigned TrivialScalarSize > + KOKKOS_INLINE_FUNCTION + constexpr ViewOffset( std::integral_constant<unsigned,TrivialScalarSize> const & , + array_layout const arg_layout ) + : m_dim( arg_layout.dimension[0], arg_layout.dimension[1], arg_layout.dimension[2], arg_layout.dimension[3], arg_layout.dimension[4], arg_layout.dimension[5], arg_layout.dimension[6], arg_layout.dimension[7] ) + , m_tile_N0( ( arg_layout.dimension[0] + MASK_0 ) >> SHIFT_0 /* number of tiles in first dimension */ ) + , m_tile_N1( ( arg_layout.dimension[1] + MASK_1 ) >> SHIFT_1 ) + , m_tile_N2( (VORank > 2 ) ? ( arg_layout.dimension[2] + MASK_2 ) >> SHIFT_2 : 0 ) + , m_tile_N3( (VORank > 3 ) ? ( arg_layout.dimension[3] + MASK_3 ) >> SHIFT_3 : 0 ) + , m_tile_N4( (VORank > 4 ) ? ( arg_layout.dimension[4] + MASK_4 ) >> SHIFT_4 : 0 ) + , m_tile_N5( (VORank > 5 ) ? ( arg_layout.dimension[5] + MASK_5 ) >> SHIFT_5 : 0 ) + , m_tile_N6( (VORank > 6 ) ? ( arg_layout.dimension[6] + MASK_6 ) >> SHIFT_6 : 0 ) + , m_tile_N7( (VORank > 7 ) ? ( arg_layout.dimension[7] + MASK_7 ) >> SHIFT_7 : 0 ) + {} + +}; + + +//---------------------------------------- + + +// ViewMapping assign method needed in order to return a 'subview' tile as a proper View +// The outer iteration pattern determines the mapping of the pointer offset to the beginning of requested tile +// The inner iteration pattern is needed for the layout of the tile's View to be returned +// Rank 2 +template< typename T , Kokkos::Iterate OuterP , Kokkos::Iterate InnerP , unsigned N0 , unsigned N1 , unsigned N2 , unsigned N3 , unsigned N4 , unsigned N5 , unsigned N6 , unsigned N7 + , class ... P + , typename iType0 , typename iType1 + > +struct ViewMapping + < typename std::enable_if< (N2 == 0 && N3 == 0 && N4 == 0 && N5 == 0 && N6 == 0 && N7 == 0) >::type //void + , Kokkos::ViewTraits<T**,Kokkos::Experimental::LayoutTiled<OuterP,InnerP,N0,N1,N2,N3,N4,N5,N6,N7,true>,P...> + , Kokkos::Experimental::LayoutTiled<OuterP,InnerP,N0,N1,N2,N3,N4,N5,N6,N7,true> + , iType0 + , iType1 > +{ + typedef Kokkos::Experimental::LayoutTiled<OuterP,InnerP,N0,N1,N2,N3,N4,N5,N6,N7,true> src_layout ; + typedef Kokkos::ViewTraits< T** , src_layout , P... > src_traits ; + + enum { is_outer_left = (OuterP == Kokkos::Iterate::Left) }; + enum { is_inner_left = (InnerP == Kokkos::Iterate::Left) }; + typedef typename std::conditional< is_inner_left, Kokkos::LayoutLeft, Kokkos::LayoutRight >::type array_layout; + typedef Kokkos::ViewTraits< T[N0][N1] , array_layout , P ... > traits ; + typedef Kokkos::View< T[N0][N1] , array_layout , P ... > type ; + + KOKKOS_INLINE_FUNCTION static + void assign( ViewMapping< traits , void > & dst + , const ViewMapping< src_traits , void > & src + , const src_layout & + , const iType0 i_tile0 + , const iType1 i_tile1 + ) + { + typedef ViewMapping< traits , void > dst_map_type ; + typedef ViewMapping< src_traits , void > src_map_type ; + typedef typename dst_map_type::handle_type dst_handle_type ; + typedef typename dst_map_type::offset_type dst_offset_type ; + typedef typename src_map_type::offset_type src_offset_type ; + + dst = dst_map_type( + dst_handle_type( src.m_impl_handle + + ( is_outer_left ? ( (i_tile0 + src.m_impl_offset.m_tile_N0 * i_tile1) << src_offset_type::SHIFT_2T ) + : ( (src.m_impl_offset.m_tile_N1 * i_tile0 + i_tile1) << src_offset_type::SHIFT_2T ) + ) // offset to start of the tile + ) + , dst_offset_type() ); + } +}; + +// Rank 3 +template< typename T , Kokkos::Iterate OuterP , Kokkos::Iterate InnerP , unsigned N0 , unsigned N1 , unsigned N2 , unsigned N3 , unsigned N4 , unsigned N5 , unsigned N6 , unsigned N7 + , class ... P + , typename iType0 , typename iType1 , typename iType2 + > +struct ViewMapping + < typename std::enable_if< (N3 == 0 && N4 == 0 && N5 == 0 && N6 == 0 && N7 == 0) >::type //void + , Kokkos::ViewTraits<T***,Kokkos::Experimental::LayoutTiled<OuterP,InnerP,N0,N1,N2,N3,N4,N5,N6,N7,true>,P...> + , Kokkos::Experimental::LayoutTiled<OuterP,InnerP,N0,N1,N2,N3,N4,N5,N6,N7,true> + , iType0 + , iType1 + , iType2 > +{ + typedef Kokkos::Experimental::LayoutTiled<OuterP,InnerP,N0,N1,N2,N3,N4,N5,N6,N7,true> src_layout ; + typedef Kokkos::ViewTraits< T*** , src_layout , P... > src_traits ; + + enum { is_outer_left = (OuterP == Kokkos::Iterate::Left) }; + enum { is_inner_left = (InnerP == Kokkos::Iterate::Left) }; + typedef typename std::conditional< is_inner_left, Kokkos::LayoutLeft, Kokkos::LayoutRight >::type array_layout; + typedef Kokkos::ViewTraits< T[N0][N1][N2] , array_layout , P ... > traits ; + typedef Kokkos::View< T[N0][N1][N2] , array_layout , P ... > type ; + + KOKKOS_INLINE_FUNCTION static + void assign( ViewMapping< traits , void > & dst + , const ViewMapping< src_traits , void > & src + , const src_layout & + , const iType0 i_tile0 + , const iType1 i_tile1 + , const iType2 i_tile2 + ) + { + typedef ViewMapping< traits , void > dst_map_type ; + typedef ViewMapping< src_traits , void > src_map_type ; + typedef typename dst_map_type::handle_type dst_handle_type ; + typedef typename dst_map_type::offset_type dst_offset_type ; + typedef typename src_map_type::offset_type src_offset_type ; + + dst = dst_map_type( + dst_handle_type( src.m_impl_handle + + ( is_outer_left ? ( ( i_tile0 + src.m_impl_offset.m_tile_N0 * ( i_tile1 + src.m_impl_offset.m_tile_N1 * i_tile2 ) ) << src_offset_type::SHIFT_3T ) + : ( ( src.m_impl_offset.m_tile_N2 * ( src.m_impl_offset.m_tile_N1 * i_tile0 + i_tile1 ) + i_tile2 ) << src_offset_type::SHIFT_3T ) + ) + ) // offset to start of the tile + , dst_offset_type() ); + } +}; + +// Rank 4 +template< typename T , Kokkos::Iterate OuterP , Kokkos::Iterate InnerP , unsigned N0 , unsigned N1 , unsigned N2 , unsigned N3 , unsigned N4 , unsigned N5 , unsigned N6 , unsigned N7 + , class ... P + , typename iType0 , typename iType1 , typename iType2 , typename iType3 + > +struct ViewMapping + < typename std::enable_if< (N4 == 0 && N5 == 0 && N6 == 0 && N7 == 0) >::type //void + , Kokkos::ViewTraits<T****,Kokkos::Experimental::LayoutTiled<OuterP,InnerP,N0,N1,N2,N3,N4,N5,N6,N7,true>,P...> + , Kokkos::Experimental::LayoutTiled<OuterP,InnerP,N0,N1,N2,N3,N4,N5,N6,N7,true> + , iType0 + , iType1 + , iType2 + , iType3 > +{ + typedef Kokkos::Experimental::LayoutTiled<OuterP,InnerP,N0,N1,N2,N3,N4,N5,N6,N7,true> src_layout ; + typedef Kokkos::ViewTraits< T**** , src_layout , P... > src_traits ; + + enum { is_outer_left = (OuterP == Kokkos::Iterate::Left) }; + enum { is_inner_left = (InnerP == Kokkos::Iterate::Left) }; + typedef typename std::conditional< is_inner_left, Kokkos::LayoutLeft, Kokkos::LayoutRight >::type array_layout; + typedef Kokkos::ViewTraits< T[N0][N1][N2][N3] , array_layout , P ... > traits ; + typedef Kokkos::View< T[N0][N1][N2][N3] , array_layout , P ... > type ; + + KOKKOS_INLINE_FUNCTION static + void assign( ViewMapping< traits , void > & dst + , const ViewMapping< src_traits , void > & src + , const src_layout & + , const iType0 i_tile0 + , const iType1 i_tile1 + , const iType2 i_tile2 + , const iType3 i_tile3 + ) + { + typedef ViewMapping< traits , void > dst_map_type ; + typedef ViewMapping< src_traits , void > src_map_type ; + typedef typename dst_map_type::handle_type dst_handle_type ; + typedef typename dst_map_type::offset_type dst_offset_type ; + typedef typename src_map_type::offset_type src_offset_type ; + + dst = dst_map_type( + dst_handle_type( src.m_impl_handle + + ( is_outer_left ? ( ( i_tile0 + src.m_impl_offset.m_tile_N0 * ( i_tile1 + src.m_impl_offset.m_tile_N1 * ( i_tile2 + src.m_impl_offset.m_tile_N2 * i_tile3 ) ) ) << src_offset_type::SHIFT_4T ) + : ( ( src.m_impl_offset.m_tile_N3 * ( src.m_impl_offset.m_tile_N2 * ( src.m_impl_offset.m_tile_N1 * i_tile0 + i_tile1 ) + i_tile2 ) + i_tile3 ) << src_offset_type::SHIFT_4T ) + ) + ) // offset to start of the tile + , dst_offset_type() ); + } +}; + +// Rank 5 +template< typename T , Kokkos::Iterate OuterP , Kokkos::Iterate InnerP , unsigned N0 , unsigned N1 , unsigned N2 , unsigned N3 , unsigned N4 , unsigned N5 , unsigned N6 , unsigned N7 + , class ... P + , typename iType0 , typename iType1 , typename iType2 , typename iType3 , typename iType4 + > +struct ViewMapping + < typename std::enable_if< (N5 == 0 && N6 == 0 && N7 == 0) >::type //void + , Kokkos::ViewTraits<T*****,Kokkos::Experimental::LayoutTiled<OuterP,InnerP,N0,N1,N2,N3,N4,N5,N6,N7,true>,P...> + , Kokkos::Experimental::LayoutTiled<OuterP,InnerP,N0,N1,N2,N3,N4,N5,N6,N7,true> + , iType0 + , iType1 + , iType2 + , iType3 + , iType4 > +{ + typedef Kokkos::Experimental::LayoutTiled<OuterP,InnerP,N0,N1,N2,N3,N4,N5,N6,N7,true> src_layout ; + typedef Kokkos::ViewTraits< T***** , src_layout , P... > src_traits ; + + enum { is_outer_left = (OuterP == Kokkos::Iterate::Left) }; + enum { is_inner_left = (InnerP == Kokkos::Iterate::Left) }; + typedef typename std::conditional< is_inner_left, Kokkos::LayoutLeft, Kokkos::LayoutRight >::type array_layout; + typedef Kokkos::ViewTraits< T[N0][N1][N2][N3][N4] , array_layout , P ... > traits ; + typedef Kokkos::View< T[N0][N1][N2][N3][N4] , array_layout , P ... > type ; + + KOKKOS_INLINE_FUNCTION static + void assign( ViewMapping< traits , void > & dst + , const ViewMapping< src_traits , void > & src + , const src_layout & + , const iType0 i_tile0 + , const iType1 i_tile1 + , const iType2 i_tile2 + , const iType3 i_tile3 + , const iType4 i_tile4 + ) + { + typedef ViewMapping< traits , void > dst_map_type ; + typedef ViewMapping< src_traits , void > src_map_type ; + typedef typename dst_map_type::handle_type dst_handle_type ; + typedef typename dst_map_type::offset_type dst_offset_type ; + typedef typename src_map_type::offset_type src_offset_type ; + + dst = dst_map_type( + dst_handle_type( src.m_impl_handle + + ( is_outer_left ? ( ( i_tile0 + src.m_impl_offset.m_tile_N0 * ( i_tile1 + src.m_impl_offset.m_tile_N1 * ( i_tile2 + src.m_impl_offset.m_tile_N2 * ( i_tile3 + src.m_impl_offset.m_tile_N3 * i_tile4 ) ) ) ) << src_offset_type::SHIFT_5T ) + : ( ( src.m_impl_offset.m_tile_N4 * ( src.m_impl_offset.m_tile_N3 * ( src.m_impl_offset.m_tile_N2 * ( src.m_impl_offset.m_tile_N1 * i_tile0 + i_tile1 ) + i_tile2 ) + i_tile3 ) + i_tile4 ) << src_offset_type::SHIFT_5T ) + ) + ) // offset to start of the tile + , dst_offset_type() ); + } +}; + +// Rank 6 +template< typename T , Kokkos::Iterate OuterP , Kokkos::Iterate InnerP , unsigned N0 , unsigned N1 , unsigned N2 , unsigned N3 , unsigned N4 , unsigned N5 , unsigned N6 , unsigned N7 + , class ... P + , typename iType0 , typename iType1 , typename iType2 , typename iType3 , typename iType4 , typename iType5 + > +struct ViewMapping + < typename std::enable_if< (N6 == 0 && N7 == 0) >::type //void + , Kokkos::ViewTraits<T******,Kokkos::Experimental::LayoutTiled<OuterP,InnerP,N0,N1,N2,N3,N4,N5,N6,N7,true>,P...> + , Kokkos::Experimental::LayoutTiled<OuterP,InnerP,N0,N1,N2,N3,N4,N5,N6,N7,true> + , iType0 + , iType1 + , iType2 + , iType3 + , iType4 + , iType5 > +{ + typedef Kokkos::Experimental::LayoutTiled<OuterP,InnerP,N0,N1,N2,N3,N4,N5,N6,N7,true> src_layout ; + typedef Kokkos::ViewTraits< T****** , src_layout , P... > src_traits ; + + enum { is_outer_left = (OuterP == Kokkos::Iterate::Left) }; + enum { is_inner_left = (InnerP == Kokkos::Iterate::Left) }; + typedef typename std::conditional< is_inner_left, Kokkos::LayoutLeft, Kokkos::LayoutRight >::type array_layout; + typedef Kokkos::ViewTraits< T[N0][N1][N2][N3][N4][N5] , array_layout , P ... > traits ; + typedef Kokkos::View< T[N0][N1][N2][N3][N4][N5] , array_layout , P ... > type ; + + KOKKOS_INLINE_FUNCTION static + void assign( ViewMapping< traits , void > & dst + , const ViewMapping< src_traits , void > & src + , const src_layout & + , const iType0 i_tile0 + , const iType1 i_tile1 + , const iType2 i_tile2 + , const iType3 i_tile3 + , const iType4 i_tile4 + , const iType5 i_tile5 + ) + { + typedef ViewMapping< traits , void > dst_map_type ; + typedef ViewMapping< src_traits , void > src_map_type ; + typedef typename dst_map_type::handle_type dst_handle_type ; + typedef typename dst_map_type::offset_type dst_offset_type ; + typedef typename src_map_type::offset_type src_offset_type ; + + dst = dst_map_type( + dst_handle_type( src.m_impl_handle + + ( is_outer_left ? ( ( i_tile0 + src.m_impl_offset.m_tile_N0 * ( i_tile1 + src.m_impl_offset.m_tile_N1 * ( i_tile2 + src.m_impl_offset.m_tile_N2 * ( i_tile3 + src.m_impl_offset.m_tile_N3 * ( i_tile4 + src.m_impl_offset.m_tile_N4 * i_tile5 ) ) ) ) ) << src_offset_type::SHIFT_6T ) + : ( ( src.m_impl_offset.m_tile_N5 * ( src.m_impl_offset.m_tile_N4 * ( src.m_impl_offset.m_tile_N3 * ( src.m_impl_offset.m_tile_N2 * ( src.m_impl_offset.m_tile_N1 * i_tile0 + i_tile1 ) + i_tile2 ) + i_tile3 ) + i_tile4 ) + i_tile5 ) << src_offset_type::SHIFT_6T ) + ) + ) // offset to start of the tile + , dst_offset_type() ); + } +}; + +// Rank 7 +template< typename T , Kokkos::Iterate OuterP , Kokkos::Iterate InnerP , unsigned N0 , unsigned N1 , unsigned N2 , unsigned N3 , unsigned N4 , unsigned N5 , unsigned N6 , unsigned N7 + , class ... P + , typename iType0 , typename iType1 , typename iType2 , typename iType3 , typename iType4 , typename iType5 , typename iType6 + > +struct ViewMapping + < typename std::enable_if< (N7 == 0) >::type //void + , Kokkos::ViewTraits<T*******,Kokkos::Experimental::LayoutTiled<OuterP,InnerP,N0,N1,N2,N3,N4,N5,N6,N7,true>,P...> + , Kokkos::Experimental::LayoutTiled<OuterP,InnerP,N0,N1,N2,N3,N4,N5,N6,N7,true> + , iType0 + , iType1 + , iType2 + , iType3 + , iType4 + , iType5 + , iType6 > +{ + typedef Kokkos::Experimental::LayoutTiled<OuterP,InnerP,N0,N1,N2,N3,N4,N5,N6,N7,true> src_layout ; + typedef Kokkos::ViewTraits< T******* , src_layout , P... > src_traits ; + + enum { is_outer_left = (OuterP == Kokkos::Iterate::Left) }; + enum { is_inner_left = (InnerP == Kokkos::Iterate::Left) }; + typedef typename std::conditional< is_inner_left, Kokkos::LayoutLeft, Kokkos::LayoutRight >::type array_layout; + typedef Kokkos::ViewTraits< T[N0][N1][N2][N3][N4][N5][N6] , array_layout , P ... > traits ; + typedef Kokkos::View< T[N0][N1][N2][N3][N4][N5][N6] , array_layout , P ... > type ; + + KOKKOS_INLINE_FUNCTION static + void assign( ViewMapping< traits , void > & dst + , const ViewMapping< src_traits , void > & src + , const src_layout & + , const iType0 i_tile0 + , const iType1 i_tile1 + , const iType2 i_tile2 + , const iType3 i_tile3 + , const iType4 i_tile4 + , const iType5 i_tile5 + , const iType6 i_tile6 + ) + { + typedef ViewMapping< traits , void > dst_map_type ; + typedef ViewMapping< src_traits , void > src_map_type ; + typedef typename dst_map_type::handle_type dst_handle_type ; + typedef typename dst_map_type::offset_type dst_offset_type ; + typedef typename src_map_type::offset_type src_offset_type ; + + dst = dst_map_type( + dst_handle_type( src.m_impl_handle + + ( is_outer_left ? ( ( i_tile0 + src.m_impl_offset.m_tile_N0 * ( i_tile1 + src.m_impl_offset.m_tile_N1 * ( i_tile2 + src.m_impl_offset.m_tile_N2 * ( i_tile3 + src.m_impl_offset.m_tile_N3 * ( i_tile4 + src.m_impl_offset.m_tile_N4 * ( i_tile5 + src.m_impl_offset.m_tile_N5 * i_tile6 ) ) ) ) ) ) << src_offset_type::SHIFT_7T ) + : ( ( src.m_impl_offset.m_tile_N6 * ( src.m_impl_offset.m_tile_N5 * ( src.m_impl_offset.m_tile_N4 * ( src.m_impl_offset.m_tile_N3 * ( src.m_impl_offset.m_tile_N2 * ( src.m_impl_offset.m_tile_N1 * i_tile0 + i_tile1 ) + i_tile2 ) + i_tile3 ) + i_tile4 ) + i_tile5 ) + i_tile6 ) << src_offset_type::SHIFT_7T ) + ) + ) // offset to start of the tile + , dst_offset_type() ); + } +}; + +// Rank 8 +template< typename T , Kokkos::Iterate OuterP , Kokkos::Iterate InnerP , unsigned N0 , unsigned N1 , unsigned N2 , unsigned N3 , unsigned N4 , unsigned N5 , unsigned N6 , unsigned N7 + , class ... P + , typename iType0 , typename iType1 , typename iType2 , typename iType3 , typename iType4 , typename iType5 , typename iType6 , typename iType7 + > +struct ViewMapping + < typename std::enable_if< (N0 != 0 && N1 != 0 && N2 != 0 && N3 != 0 && N4 != 0 && N5 != 0 && N6 != 0 && N7 != 0) >::type //void + , Kokkos::ViewTraits<T********,Kokkos::Experimental::LayoutTiled<OuterP,InnerP,N0,N1,N2,N3,N4,N5,N6,N7,true>,P...> + , Kokkos::Experimental::LayoutTiled<OuterP,InnerP,N0,N1,N2,N3,N4,N5,N6,N7,true> + , iType0 + , iType1 + , iType2 + , iType3 + , iType4 + , iType5 + , iType6 + , iType7 > +{ + typedef Kokkos::Experimental::LayoutTiled<OuterP,InnerP,N0,N1,N2,N3,N4,N5,N6,N7,true> src_layout ; + typedef Kokkos::ViewTraits< T******** , src_layout , P... > src_traits ; + + enum { is_outer_left = (OuterP == Kokkos::Iterate::Left) }; + enum { is_inner_left = (InnerP == Kokkos::Iterate::Left) }; + typedef typename std::conditional< is_inner_left, Kokkos::LayoutLeft, Kokkos::LayoutRight >::type array_layout; + typedef Kokkos::ViewTraits< T[N0][N1][N2][N3][N4][N5][N6][N7] , array_layout , P ... > traits ; + typedef Kokkos::View< T[N0][N1][N2][N3][N4][N5][N6][N7] , array_layout , P ... > type ; + + KOKKOS_INLINE_FUNCTION static + void assign( ViewMapping< traits , void > & dst + , const ViewMapping< src_traits , void > & src + , const src_layout & + , const iType0 i_tile0 + , const iType1 i_tile1 + , const iType2 i_tile2 + , const iType3 i_tile3 + , const iType4 i_tile4 + , const iType5 i_tile5 + , const iType6 i_tile6 + , const iType7 i_tile7 + ) + { + typedef ViewMapping< traits , void > dst_map_type ; + typedef ViewMapping< src_traits , void > src_map_type ; + typedef typename dst_map_type::handle_type dst_handle_type ; + typedef typename dst_map_type::offset_type dst_offset_type ; + typedef typename src_map_type::offset_type src_offset_type ; + + dst = dst_map_type( + dst_handle_type( src.m_impl_handle + + ( is_outer_left ? ( ( i_tile0 + src.m_impl_offset.m_tile_N0 * ( i_tile1 + src.m_impl_offset.m_tile_N1 * ( i_tile2 + src.m_impl_offset.m_tile_N2 * ( i_tile3 + src.m_impl_offset.m_tile_N3 * ( i_tile4 + src.m_impl_offset.m_tile_N4 * ( i_tile5 + src.m_impl_offset.m_tile_N5 * ( i_tile6 + src.m_impl_offset.m_tile_N6 * i_tile7 ) ) ) ) ) ) ) << src_offset_type::SHIFT_8T ) + : ( ( src.m_impl_offset.m_tile_N7 * ( src.m_impl_offset.m_tile_N6 * ( src.m_impl_offset.m_tile_N5 * ( src.m_impl_offset.m_tile_N4 * ( src.m_impl_offset.m_tile_N3 * ( src.m_impl_offset.m_tile_N2 * ( src.m_impl_offset.m_tile_N1 * i_tile0 + i_tile1 ) + i_tile2 ) + i_tile3 ) + i_tile4 ) + i_tile5 ) + i_tile6 ) + i_tile7 ) << src_offset_type::SHIFT_8T ) + ) + ) // offset to start of the tile + , dst_offset_type() ); + } +}; + + +} /* namespace Impl */ +} /* namespace Kokkos */ + +//---------------------------------------- + +namespace Kokkos { + +// Rank 2 +template< typename T , Kokkos::Iterate OuterP , Kokkos::Iterate InnerP , unsigned N0 , unsigned N1 , unsigned N2 , unsigned N3 , unsigned N4 , unsigned N5 , unsigned N6 , unsigned N7 + , class ... P + > +KOKKOS_INLINE_FUNCTION +Kokkos::View< T[N0][N1] , typename std::conditional< (InnerP == Kokkos::Iterate::Left), Kokkos::LayoutLeft, Kokkos::LayoutRight >::type , P... > +tile_subview( const Kokkos::View<T**, Kokkos::Experimental::LayoutTiled<OuterP,InnerP,N0,N1,N2,N3,N4,N5,N6,N7,true>, P...> & src + , const size_t i_tile0 + , const size_t i_tile1 + ) +{ + // Force the specialized ViewMapping for extracting a tile + // by using the first subview argument as the layout. + typedef typename std::conditional< (InnerP == Kokkos::Iterate::Left), Kokkos::LayoutLeft, Kokkos::LayoutRight >::type array_layout; + typedef Kokkos::Experimental::LayoutTiled<OuterP,InnerP,N0,N1,N2,N3,N4,N5,N6,N7,true> SrcLayout ; + + return Kokkos::View< T[N0][N1] , array_layout , P... > + ( src , SrcLayout() , i_tile0 , i_tile1 ); +} + +// Rank 3 +template< typename T , Kokkos::Iterate OuterP , Kokkos::Iterate InnerP , unsigned N0 , unsigned N1 , unsigned N2 , unsigned N3 , unsigned N4 , unsigned N5 , unsigned N6 , unsigned N7 + , class ... P + > +KOKKOS_INLINE_FUNCTION +Kokkos::View< T[N0][N1][N2] , typename std::conditional< (InnerP == Kokkos::Iterate::Left), Kokkos::LayoutLeft, Kokkos::LayoutRight >::type , P... > +tile_subview( const Kokkos::View<T***, Kokkos::Experimental::LayoutTiled<OuterP,InnerP,N0,N1,N2,N3,N4,N5,N6,N7,true>, P...> & src + , const size_t i_tile0 + , const size_t i_tile1 + , const size_t i_tile2 + ) +{ + // Force the specialized ViewMapping for extracting a tile + // by using the first subview argument as the layout. + typedef typename std::conditional< (InnerP == Kokkos::Iterate::Left), Kokkos::LayoutLeft, Kokkos::LayoutRight >::type array_layout; + typedef Kokkos::Experimental::LayoutTiled<OuterP,InnerP,N0,N1,N2,N3,N4,N5,N6,N7,true> SrcLayout ; + + return Kokkos::View< T[N0][N1][N2] , array_layout , P... > + ( src , SrcLayout() , i_tile0 , i_tile1 , i_tile2 ); +} + +// Rank 4 +template< typename T , Kokkos::Iterate OuterP , Kokkos::Iterate InnerP , unsigned N0 , unsigned N1 , unsigned N2 , unsigned N3 , unsigned N4 , unsigned N5 , unsigned N6 , unsigned N7 + , class ... P + > +KOKKOS_INLINE_FUNCTION +Kokkos::View< T[N0][N1][N2][N3] , typename std::conditional< (InnerP == Kokkos::Iterate::Left), Kokkos::LayoutLeft, Kokkos::LayoutRight >::type , P... > +tile_subview( const Kokkos::View<T****, Kokkos::Experimental::LayoutTiled<OuterP,InnerP,N0,N1,N2,N3,N4,N5,N6,N7,true>, P...> & src + , const size_t i_tile0 + , const size_t i_tile1 + , const size_t i_tile2 + , const size_t i_tile3 + ) +{ + // Force the specialized ViewMapping for extracting a tile + // by using the first subview argument as the layout. + typedef typename std::conditional< (InnerP == Kokkos::Iterate::Left), Kokkos::LayoutLeft, Kokkos::LayoutRight >::type array_layout; + typedef Kokkos::Experimental::LayoutTiled<OuterP,InnerP,N0,N1,N2,N3,N4,N5,N6,N7,true> SrcLayout ; + + return Kokkos::View< T[N0][N1][N2][N3] , array_layout , P... > + ( src , SrcLayout() , i_tile0 , i_tile1 , i_tile2 , i_tile3 ); +} + +// Rank 5 +template< typename T , Kokkos::Iterate OuterP , Kokkos::Iterate InnerP , unsigned N0 , unsigned N1 , unsigned N2 , unsigned N3 , unsigned N4 , unsigned N5 , unsigned N6 , unsigned N7 + , class ... P + > +KOKKOS_INLINE_FUNCTION +Kokkos::View< T[N0][N1][N2][N3][N4] , typename std::conditional< (InnerP == Kokkos::Iterate::Left), Kokkos::LayoutLeft, Kokkos::LayoutRight >::type , P... > +tile_subview( const Kokkos::View<T*****, Kokkos::Experimental::LayoutTiled<OuterP,InnerP,N0,N1,N2,N3,N4,N5,N6,N7,true>, P...> & src + , const size_t i_tile0 + , const size_t i_tile1 + , const size_t i_tile2 + , const size_t i_tile3 + , const size_t i_tile4 + ) +{ + // Force the specialized ViewMapping for extracting a tile + // by using the first subview argument as the layout. + typedef typename std::conditional< (InnerP == Kokkos::Iterate::Left), Kokkos::LayoutLeft, Kokkos::LayoutRight >::type array_layout; + typedef Kokkos::Experimental::LayoutTiled<OuterP,InnerP,N0,N1,N2,N3,N4,N5,N6,N7,true> SrcLayout ; + + return Kokkos::View< T[N0][N1][N2][N3][N4] , array_layout , P... > + ( src , SrcLayout() , i_tile0 , i_tile1 , i_tile2 , i_tile3 , i_tile4 ); +} + +// Rank 6 +template< typename T , Kokkos::Iterate OuterP , Kokkos::Iterate InnerP , unsigned N0 , unsigned N1 , unsigned N2 , unsigned N3 , unsigned N4 , unsigned N5 , unsigned N6 , unsigned N7 + , class ... P + > +KOKKOS_INLINE_FUNCTION +Kokkos::View< T[N0][N1][N2][N3][N4][N5] , typename std::conditional< (InnerP == Kokkos::Iterate::Left), Kokkos::LayoutLeft, Kokkos::LayoutRight >::type , P... > +tile_subview( const Kokkos::View<T******, Kokkos::Experimental::LayoutTiled<OuterP,InnerP,N0,N1,N2,N3,N4,N5,N6,N7,true>, P...> & src + , const size_t i_tile0 + , const size_t i_tile1 + , const size_t i_tile2 + , const size_t i_tile3 + , const size_t i_tile4 + , const size_t i_tile5 + ) +{ + // Force the specialized ViewMapping for extracting a tile + // by using the first subview argument as the layout. + typedef typename std::conditional< (InnerP == Kokkos::Iterate::Left), Kokkos::LayoutLeft, Kokkos::LayoutRight >::type array_layout; + typedef Kokkos::Experimental::LayoutTiled<OuterP,InnerP,N0,N1,N2,N3,N4,N5,N6,N7,true> SrcLayout ; + + return Kokkos::View< T[N0][N1][N2][N3][N4][N5] , array_layout , P... > + ( src , SrcLayout() , i_tile0 , i_tile1 , i_tile2 , i_tile3 , i_tile4 , i_tile5 ); +} + +// Rank 7 +template< typename T , Kokkos::Iterate OuterP , Kokkos::Iterate InnerP , unsigned N0 , unsigned N1 , unsigned N2 , unsigned N3 , unsigned N4 , unsigned N5 , unsigned N6 , unsigned N7 + , class ... P + > +KOKKOS_INLINE_FUNCTION +Kokkos::View< T[N0][N1][N2][N3][N4][N5][N6] , typename std::conditional< (InnerP == Kokkos::Iterate::Left), Kokkos::LayoutLeft, Kokkos::LayoutRight >::type , P... > +tile_subview( const Kokkos::View<T*******, Kokkos::Experimental::LayoutTiled<OuterP,InnerP,N0,N1,N2,N3,N4,N5,N6,N7,true>, P...> & src + , const size_t i_tile0 + , const size_t i_tile1 + , const size_t i_tile2 + , const size_t i_tile3 + , const size_t i_tile4 + , const size_t i_tile5 + , const size_t i_tile6 + ) +{ + // Force the specialized ViewMapping for extracting a tile + // by using the first subview argument as the layout. + typedef typename std::conditional< (InnerP == Kokkos::Iterate::Left), Kokkos::LayoutLeft, Kokkos::LayoutRight >::type array_layout; + typedef Kokkos::Experimental::LayoutTiled<OuterP,InnerP,N0,N1,N2,N3,N4,N5,N6,N7,true> SrcLayout ; + + return Kokkos::View< T[N0][N1][N2][N3][N4][N5][N6] , array_layout , P... > + ( src , SrcLayout() , i_tile0 , i_tile1 , i_tile2 , i_tile3 , i_tile4 , i_tile5 , i_tile6 ); +} + +// Rank 8 +template< typename T , Kokkos::Iterate OuterP , Kokkos::Iterate InnerP , unsigned N0 , unsigned N1 , unsigned N2 , unsigned N3 , unsigned N4 , unsigned N5 , unsigned N6 , unsigned N7 + , class ... P + > +KOKKOS_INLINE_FUNCTION +Kokkos::View< T[N0][N1][N2][N3][N4][N5][N6][N7] , typename std::conditional< (InnerP == Kokkos::Iterate::Left), Kokkos::LayoutLeft, Kokkos::LayoutRight >::type , P... > +tile_subview( const Kokkos::View<T********, Kokkos::Experimental::LayoutTiled<OuterP,InnerP,N0,N1,N2,N3,N4,N5,N6,N7,true>, P...> & src + , const size_t i_tile0 + , const size_t i_tile1 + , const size_t i_tile2 + , const size_t i_tile3 + , const size_t i_tile4 + , const size_t i_tile5 + , const size_t i_tile6 + , const size_t i_tile7 + ) +{ + // Force the specialized ViewMapping for extracting a tile + // by using the first subview argument as the layout. + typedef typename std::conditional< (InnerP == Kokkos::Iterate::Left), Kokkos::LayoutLeft, Kokkos::LayoutRight >::type array_layout; + typedef Kokkos::Experimental::LayoutTiled<OuterP,InnerP,N0,N1,N2,N3,N4,N5,N6,N7,true> SrcLayout ; + + return Kokkos::View< T[N0][N1][N2][N3][N4][N5][N6][N7] , array_layout , P... > + ( src , SrcLayout() , i_tile0 , i_tile1 , i_tile2 , i_tile3 , i_tile4 , i_tile5 , i_tile6 , i_tile7 ); +} + +} /* namespace Kokkos */ +#endif //!defined(KOKKOS_ENABLE_DEPRECATED_CODE +//---------------------------------------------------------------------------- +//---------------------------------------------------------------------------- + +#endif /* #ifndef KOKKOS_EXPERIENTAL_VIEWLAYOUTTILE_HPP */ + diff --git a/packages/kokkos/core/src/impl/Kokkos_ViewMapping.hpp b/packages/kokkos/core/src/impl/Kokkos_ViewMapping.hpp index d4890c534201d1e63db6f477be8fca70e6dae1f1..bb3bcfd334e072edb68f8368ccf8e18817a2228a 100644 --- a/packages/kokkos/core/src/impl/Kokkos_ViewMapping.hpp +++ b/packages/kokkos/core/src/impl/Kokkos_ViewMapping.hpp @@ -260,6 +260,9 @@ namespace Impl { struct ALL_t { KOKKOS_INLINE_FUNCTION constexpr const ALL_t & operator()() const { return *this ; } + + KOKKOS_INLINE_FUNCTION + constexpr bool operator == ( const ALL_t & right) const { return true;} }; }} // namespace Kokkos::Impl @@ -1030,13 +1033,6 @@ struct ViewOffset< Dimension , Kokkos::LayoutLeft ViewOffset( const ViewOffset< DimRHS , Kokkos::LayoutStride , void > & rhs ) : m_dim( rhs.m_dim.N0, 0, 0, 0, 0, 0, 0, 0 ) { - static_assert( - ( DimRHS::rank == 0 && - dimension_type::rank == 0 ) || - ( DimRHS::rank == 1 && - dimension_type::rank == 1 && - dimension_type::rank_dynamic == 1 ) - , "ViewOffset LayoutLeft and LayoutStride are only compatible when rank <= 1" ); if ( rhs.m_stride.S0 != 1 ) { Kokkos::abort("Kokkos::Impl::ViewOffset assignment of LayoutLeft from LayoutStride requires stride == 1" ); } @@ -1275,6 +1271,18 @@ public: // Also requires equal static dimensions ... } + template< class DimRHS > + KOKKOS_INLINE_FUNCTION + ViewOffset( const ViewOffset< DimRHS , Kokkos::LayoutStride , void > & rhs ) + : m_dim( rhs.m_dim.N0 , rhs.m_dim.N1 , rhs.m_dim.N2 , rhs.m_dim.N3 + , rhs.m_dim.N4 , rhs.m_dim.N5 , rhs.m_dim.N6 , rhs.m_dim.N7 ) + , m_stride( rhs.stride_1() ) + { + if ( rhs.m_stride.S0 != 1 ) { + Kokkos::abort("Kokkos::Impl::ViewOffset assignment of LayoutLeft from LayoutStride requires stride == 1" ); + } + } + //---------------------------------------- // Subview construction // This subview must be 2 == rank and 2 == rank_dynamic @@ -1518,16 +1526,7 @@ struct ViewOffset< Dimension , Kokkos::LayoutRight ViewOffset( const ViewOffset< DimRHS , Kokkos::LayoutStride , void > & rhs ) : m_dim( rhs.m_dim.N0, 0, 0, 0, 0, 0, 0, 0 ) { - static_assert( - ( DimRHS::rank == 0 && - dimension_type::rank == 0 ) || - ( DimRHS::rank == 1 && - dimension_type::rank == 1 && - dimension_type::rank_dynamic == 1 ) - , "ViewOffset LayoutRight and LayoutString are only compatible when rank <= 1" ); - if ( rhs.m_stride.S0 != 1 ) { - Kokkos::abort("Kokkos::Impl::ViewOffset assignment of LayoutLeft/Right from LayoutStride requires stride == 1" ); - } + } //---------------------------------------- @@ -1771,6 +1770,23 @@ public: // Also requires equal static dimensions ... } + template< class DimRHS > + KOKKOS_INLINE_FUNCTION + ViewOffset( const ViewOffset< DimRHS , Kokkos::LayoutStride , void > & rhs ) + : m_dim( rhs.m_dim.N0 , rhs.m_dim.N1 , rhs.m_dim.N2 , rhs.m_dim.N3 + , rhs.m_dim.N4 , rhs.m_dim.N5 , rhs.m_dim.N6 , rhs.m_dim.N7 ) + , m_stride( rhs.stride_0() ) + { + if ( ((dimension_type::rank == 2)?rhs.m_stride.S1: + ((dimension_type::rank == 3)?rhs.m_stride.S2: + ((dimension_type::rank == 4)?rhs.m_stride.S3: + ((dimension_type::rank == 5)?rhs.m_stride.S4: + ((dimension_type::rank == 6)?rhs.m_stride.S5: + ((dimension_type::rank == 7)?rhs.m_stride.S6:rhs.m_stride.S7)))))) != 1 ){ + Kokkos::abort("Kokkos::Impl::ViewOffset assignment of LayoutRight from LayoutStride requires right-most stride == 1" ); + } + } + //---------------------------------------- // Subview construction // Last dimension must be non-zero @@ -2498,7 +2514,7 @@ struct ViewValueFunctor< ExecSpace , ValueType , false /* is_scalar */ > #if defined(KOKKOS_ENABLE_PROFILING) uint64_t kpID = 0; if(Kokkos::Profiling::profileLibraryLoaded()) { - Kokkos::Profiling::beginParallelFor("Kokkos::View::initialization", 0, &kpID); + Kokkos::Profiling::beginParallelFor((destroy ? "Kokkos::View::destruction" : "Kokkos::View::initialization"), 0, &kpID); } #endif const Kokkos::Impl::ParallelFor< ViewValueFunctor , PolicyType > @@ -2588,11 +2604,8 @@ class ViewMapping< Traits , , void >::is_mapping_plugin::value )>::type > { -private: - - template< class , class ... > friend class ViewMapping ; - template< class , class ... > friend class Kokkos::View ; +public: typedef ViewOffset< typename Traits::dimension , typename Traits::array_layout , void @@ -2600,13 +2613,17 @@ private: typedef typename ViewDataHandle< Traits >::handle_type handle_type ; - handle_type m_handle ; - offset_type m_offset ; + handle_type m_impl_handle ; + offset_type m_impl_offset ; + +private: + + template < class , class ...> friend class ViewMapping; KOKKOS_INLINE_FUNCTION ViewMapping( const handle_type & arg_handle , const offset_type & arg_offset ) - : m_handle( arg_handle ) - , m_offset( arg_offset ) + : m_impl_handle( arg_handle ) + , m_impl_offset( arg_offset ) {} public: @@ -2621,44 +2638,44 @@ public: template< typename iType > KOKKOS_INLINE_FUNCTION constexpr size_t extent( const iType & r ) const - { return m_offset.m_dim.extent(r); } + { return m_impl_offset.m_dim.extent(r); } KOKKOS_INLINE_FUNCTION constexpr typename Traits::array_layout layout() const - { return m_offset.layout(); } + { return m_impl_offset.layout(); } - KOKKOS_INLINE_FUNCTION constexpr size_t dimension_0() const { return m_offset.dimension_0(); } - KOKKOS_INLINE_FUNCTION constexpr size_t dimension_1() const { return m_offset.dimension_1(); } - KOKKOS_INLINE_FUNCTION constexpr size_t dimension_2() const { return m_offset.dimension_2(); } - KOKKOS_INLINE_FUNCTION constexpr size_t dimension_3() const { return m_offset.dimension_3(); } - KOKKOS_INLINE_FUNCTION constexpr size_t dimension_4() const { return m_offset.dimension_4(); } - KOKKOS_INLINE_FUNCTION constexpr size_t dimension_5() const { return m_offset.dimension_5(); } - KOKKOS_INLINE_FUNCTION constexpr size_t dimension_6() const { return m_offset.dimension_6(); } - KOKKOS_INLINE_FUNCTION constexpr size_t dimension_7() const { return m_offset.dimension_7(); } + KOKKOS_INLINE_FUNCTION constexpr size_t dimension_0() const { return m_impl_offset.dimension_0(); } + KOKKOS_INLINE_FUNCTION constexpr size_t dimension_1() const { return m_impl_offset.dimension_1(); } + KOKKOS_INLINE_FUNCTION constexpr size_t dimension_2() const { return m_impl_offset.dimension_2(); } + KOKKOS_INLINE_FUNCTION constexpr size_t dimension_3() const { return m_impl_offset.dimension_3(); } + KOKKOS_INLINE_FUNCTION constexpr size_t dimension_4() const { return m_impl_offset.dimension_4(); } + KOKKOS_INLINE_FUNCTION constexpr size_t dimension_5() const { return m_impl_offset.dimension_5(); } + KOKKOS_INLINE_FUNCTION constexpr size_t dimension_6() const { return m_impl_offset.dimension_6(); } + KOKKOS_INLINE_FUNCTION constexpr size_t dimension_7() const { return m_impl_offset.dimension_7(); } // Is a regular layout with uniform striding for each index. using is_regular = typename offset_type::is_regular ; - KOKKOS_INLINE_FUNCTION constexpr size_t stride_0() const { return m_offset.stride_0(); } - KOKKOS_INLINE_FUNCTION constexpr size_t stride_1() const { return m_offset.stride_1(); } - KOKKOS_INLINE_FUNCTION constexpr size_t stride_2() const { return m_offset.stride_2(); } - KOKKOS_INLINE_FUNCTION constexpr size_t stride_3() const { return m_offset.stride_3(); } - KOKKOS_INLINE_FUNCTION constexpr size_t stride_4() const { return m_offset.stride_4(); } - KOKKOS_INLINE_FUNCTION constexpr size_t stride_5() const { return m_offset.stride_5(); } - KOKKOS_INLINE_FUNCTION constexpr size_t stride_6() const { return m_offset.stride_6(); } - KOKKOS_INLINE_FUNCTION constexpr size_t stride_7() const { return m_offset.stride_7(); } + KOKKOS_INLINE_FUNCTION constexpr size_t stride_0() const { return m_impl_offset.stride_0(); } + KOKKOS_INLINE_FUNCTION constexpr size_t stride_1() const { return m_impl_offset.stride_1(); } + KOKKOS_INLINE_FUNCTION constexpr size_t stride_2() const { return m_impl_offset.stride_2(); } + KOKKOS_INLINE_FUNCTION constexpr size_t stride_3() const { return m_impl_offset.stride_3(); } + KOKKOS_INLINE_FUNCTION constexpr size_t stride_4() const { return m_impl_offset.stride_4(); } + KOKKOS_INLINE_FUNCTION constexpr size_t stride_5() const { return m_impl_offset.stride_5(); } + KOKKOS_INLINE_FUNCTION constexpr size_t stride_6() const { return m_impl_offset.stride_6(); } + KOKKOS_INLINE_FUNCTION constexpr size_t stride_7() const { return m_impl_offset.stride_7(); } template< typename iType > - KOKKOS_INLINE_FUNCTION void stride( iType * const s ) const { m_offset.stride(s); } + KOKKOS_INLINE_FUNCTION void stride( iType * const s ) const { m_impl_offset.stride(s); } //---------------------------------------- // Range span /** \brief Span of the mapped range */ - KOKKOS_INLINE_FUNCTION constexpr size_t span() const { return m_offset.span(); } + KOKKOS_INLINE_FUNCTION constexpr size_t span() const { return m_impl_offset.span(); } /** \brief Is the mapped range span contiguous */ - KOKKOS_INLINE_FUNCTION constexpr bool span_is_contiguous() const { return m_offset.span_is_contiguous(); } + KOKKOS_INLINE_FUNCTION constexpr bool span_is_contiguous() const { return m_impl_offset.span_is_contiguous(); } typedef typename ViewDataHandle< Traits >::return_type reference_type ; typedef typename Traits::value_type * pointer_type ; @@ -2666,7 +2683,7 @@ public: /** \brief Query raw pointer to memory */ KOKKOS_INLINE_FUNCTION constexpr pointer_type data() const { - return m_handle; + return m_impl_handle; } //---------------------------------------- @@ -2674,7 +2691,7 @@ public: // calling these element reference methods. KOKKOS_FORCEINLINE_FUNCTION - reference_type reference() const { return m_handle[0]; } + reference_type reference() const { return m_impl_handle[0]; } template< typename I0 > KOKKOS_FORCEINLINE_FUNCTION @@ -2682,7 +2699,7 @@ public: std::enable_if< std::is_integral<I0>::value && ! std::is_same< typename Traits::array_layout , Kokkos::LayoutStride >::value , reference_type >::type - reference( const I0 & i0 ) const { return m_handle[i0]; } + reference( const I0 & i0 ) const { return m_impl_handle[i0]; } template< typename I0 > KOKKOS_FORCEINLINE_FUNCTION @@ -2690,50 +2707,50 @@ public: std::enable_if< std::is_integral<I0>::value && std::is_same< typename Traits::array_layout , Kokkos::LayoutStride >::value , reference_type >::type - reference( const I0 & i0 ) const { return m_handle[ m_offset(i0) ]; } + reference( const I0 & i0 ) const { return m_impl_handle[ m_impl_offset(i0) ]; } template< typename I0 , typename I1 > KOKKOS_FORCEINLINE_FUNCTION reference_type reference( const I0 & i0 , const I1 & i1 ) const - { return m_handle[ m_offset(i0,i1) ]; } + { return m_impl_handle[ m_impl_offset(i0,i1) ]; } template< typename I0 , typename I1 , typename I2 > KOKKOS_FORCEINLINE_FUNCTION reference_type reference( const I0 & i0 , const I1 & i1 , const I2 & i2 ) const - { return m_handle[ m_offset(i0,i1,i2) ]; } + { return m_impl_handle[ m_impl_offset(i0,i1,i2) ]; } template< typename I0 , typename I1 , typename I2 , typename I3 > KOKKOS_FORCEINLINE_FUNCTION reference_type reference( const I0 & i0 , const I1 & i1 , const I2 & i2 , const I3 & i3 ) const - { return m_handle[ m_offset(i0,i1,i2,i3) ]; } + { return m_impl_handle[ m_impl_offset(i0,i1,i2,i3) ]; } template< typename I0 , typename I1 , typename I2 , typename I3 , typename I4 > KOKKOS_FORCEINLINE_FUNCTION reference_type reference( const I0 & i0 , const I1 & i1 , const I2 & i2 , const I3 & i3 , const I4 & i4 ) const - { return m_handle[ m_offset(i0,i1,i2,i3,i4) ]; } + { return m_impl_handle[ m_impl_offset(i0,i1,i2,i3,i4) ]; } template< typename I0 , typename I1 , typename I2 , typename I3 , typename I4 , typename I5 > KOKKOS_FORCEINLINE_FUNCTION reference_type reference( const I0 & i0 , const I1 & i1 , const I2 & i2 , const I3 & i3 , const I4 & i4 , const I5 & i5 ) const - { return m_handle[ m_offset(i0,i1,i2,i3,i4,i5) ]; } + { return m_impl_handle[ m_impl_offset(i0,i1,i2,i3,i4,i5) ]; } template< typename I0 , typename I1 , typename I2 , typename I3 , typename I4 , typename I5 , typename I6 > KOKKOS_FORCEINLINE_FUNCTION reference_type reference( const I0 & i0 , const I1 & i1 , const I2 & i2 , const I3 & i3 , const I4 & i4 , const I5 & i5 , const I6 & i6 ) const - { return m_handle[ m_offset(i0,i1,i2,i3,i4,i5,i6) ]; } + { return m_impl_handle[ m_impl_offset(i0,i1,i2,i3,i4,i5,i6) ]; } template< typename I0 , typename I1 , typename I2 , typename I3 , typename I4 , typename I5 , typename I6 , typename I7 > KOKKOS_FORCEINLINE_FUNCTION reference_type reference( const I0 & i0 , const I1 & i1 , const I2 & i2 , const I3 & i3 , const I4 & i4 , const I5 & i5 , const I6 & i6 , const I7 & i7 ) const - { return m_handle[ m_offset(i0,i1,i2,i3,i4,i5,i6,i7) ]; } + { return m_impl_handle[ m_impl_offset(i0,i1,i2,i3,i4,i5,i6,i7) ]; } //---------------------------------------- @@ -2747,22 +2764,22 @@ public: /** \brief Span, in bytes, of the referenced memory */ KOKKOS_INLINE_FUNCTION constexpr size_t memory_span() const { - return ( m_offset.span() * sizeof(typename Traits::value_type) + MemorySpanMask ) & ~size_t(MemorySpanMask); + return ( m_impl_offset.span() * sizeof(typename Traits::value_type) + MemorySpanMask ) & ~size_t(MemorySpanMask); } //---------------------------------------- KOKKOS_INLINE_FUNCTION ~ViewMapping() {} - KOKKOS_INLINE_FUNCTION ViewMapping() : m_handle(), m_offset() {} + KOKKOS_INLINE_FUNCTION ViewMapping() : m_impl_handle(), m_impl_offset() {} KOKKOS_INLINE_FUNCTION ViewMapping( const ViewMapping & rhs ) - : m_handle( rhs.m_handle ), m_offset( rhs.m_offset ) {} + : m_impl_handle( rhs.m_impl_handle ), m_impl_offset( rhs.m_impl_offset ) {} KOKKOS_INLINE_FUNCTION ViewMapping & operator = ( const ViewMapping & rhs ) - { m_handle = rhs.m_handle ; m_offset = rhs.m_offset ; return *this ; } + { m_impl_handle = rhs.m_impl_handle ; m_impl_offset = rhs.m_impl_offset ; return *this ; } KOKKOS_INLINE_FUNCTION ViewMapping( ViewMapping && rhs ) - : m_handle( rhs.m_handle ), m_offset( rhs.m_offset ) {} + : m_impl_handle( rhs.m_impl_handle ), m_impl_offset( rhs.m_impl_offset ) {} KOKKOS_INLINE_FUNCTION ViewMapping & operator = ( ViewMapping && rhs ) - { m_handle = rhs.m_handle ; m_offset = rhs.m_offset ; return *this ; } + { m_impl_handle = rhs.m_impl_handle ; m_impl_offset = rhs.m_impl_offset ; return *this ; } //---------------------------------------- @@ -2780,14 +2797,14 @@ public: ViewMapping( Kokkos::Impl::ViewCtorProp< P ... > const & arg_prop , typename Traits::array_layout const & arg_layout ) - : m_handle( ( (Kokkos::Impl::ViewCtorProp<void,pointer_type> const &) arg_prop ).value ) - , m_offset( std::integral_constant< unsigned , 0 >() , arg_layout ) + : m_impl_handle( ( (Kokkos::Impl::ViewCtorProp<void,pointer_type> const &) arg_prop ).value ) + , m_impl_offset( std::integral_constant< unsigned , 0 >() , arg_layout ) {} /**\brief Assign data */ KOKKOS_INLINE_FUNCTION void assign_data( pointer_type arg_ptr ) - { m_handle = handle_type( arg_ptr ); } + { m_impl_handle = handle_type( arg_ptr ); } //---------------------------------------- /* Allocate and construct mapped array. @@ -2815,10 +2832,10 @@ public: , alloc_prop::allow_padding ? sizeof(value_type) : 0 > padding ; - m_offset = offset_type( padding(), arg_layout ); + m_impl_offset = offset_type( padding(), arg_layout ); const size_t alloc_size = - ( m_offset.span() * MemorySpanSize + MemorySpanMask ) & ~size_t(MemorySpanMask); + ( m_impl_offset.span() * MemorySpanSize + MemorySpanMask ) & ~size_t(MemorySpanMask); // Create shared memory tracking record with allocate memory from the memory space record_type * const record = @@ -2829,7 +2846,7 @@ public: #ifdef KOKKOS_ENABLE_DEPRECATED_CODE if ( alloc_size ) { #endif - m_handle = handle_type( reinterpret_cast< pointer_type >( record->data() ) ); + m_impl_handle = handle_type( reinterpret_cast< pointer_type >( record->data() ) ); #ifdef KOKKOS_ENABLE_DEPRECATED_CODE } #endif @@ -2840,8 +2857,8 @@ public: // Assume destruction is only required when construction is requested. // The ViewValueFunctor has both value construction and destruction operators. record->m_destroy = functor_type( ( (Kokkos::Impl::ViewCtorProp<void,execution_space> const &) arg_prop).value - , (value_type *) m_handle - , m_offset.span() + , (value_type *) m_impl_handle + , m_impl_offset.span() ); // Construct values @@ -2859,16 +2876,17 @@ public: template< class DstTraits , class SrcTraits > class ViewMapping< DstTraits , SrcTraits , typename std::enable_if<( - /* default mappings */ + !(std::is_same<typename SrcTraits::array_layout, LayoutStride>::value) && //Added to have a new specialization for SrcType of LayoutStride + // default mappings std::is_same< typename DstTraits::specialize , void >::value && std::is_same< typename SrcTraits::specialize , void >::value && ( - /* same layout */ + // same layout std::is_same< typename DstTraits::array_layout , typename SrcTraits::array_layout >::value || - /* known layout */ + // known layout ( ( std::is_same< typename DstTraits::array_layout , Kokkos::LayoutLeft >::value || @@ -2968,8 +2986,127 @@ public: if(!assignable) Kokkos::abort("View Assignment: trying to assign runtime dimension to non matching compile time dimension."); } - dst.m_offset = dst_offset_type( src.m_offset ); - dst.m_handle = Kokkos::Impl::ViewDataHandle< DstTraits >::assign( src.m_handle , src_track ); + dst.m_impl_offset = dst_offset_type( src.m_impl_offset ); + dst.m_impl_handle = Kokkos::Impl::ViewDataHandle< DstTraits >::assign( src.m_impl_handle , src_track ); + } +}; + +//---------------------------------------------------------------------------- +//Create new specialization for SrcType of LayoutStride. Runtime check for compatible layout +template< class DstTraits , class SrcTraits > +class ViewMapping< DstTraits , SrcTraits , + typename std::enable_if<( + std::is_same< typename SrcTraits::array_layout, Kokkos::LayoutStride >::value + && + std::is_same< typename DstTraits::specialize , void >::value + && + std::is_same< typename SrcTraits::specialize , void >::value + && + ( + // same layout + std::is_same< typename DstTraits::array_layout , typename SrcTraits::array_layout >::value + || + // known layout + ( + std::is_same< typename DstTraits::array_layout , Kokkos::LayoutLeft >::value || + std::is_same< typename DstTraits::array_layout , Kokkos::LayoutRight >::value || + std::is_same< typename DstTraits::array_layout , Kokkos::LayoutStride >::value + ) + ) + )>::type > +{ +private: + + enum { is_assignable_space = + Kokkos::Impl::MemorySpaceAccess + < typename DstTraits::memory_space + , typename SrcTraits::memory_space >::assignable }; + + enum { is_assignable_value_type = + std::is_same< typename DstTraits::value_type + , typename SrcTraits::value_type >::value || + std::is_same< typename DstTraits::value_type + , typename SrcTraits::const_value_type >::value }; + + enum { is_assignable_dimension = + ViewDimensionAssignable< typename DstTraits::dimension + , typename SrcTraits::dimension >::value }; + +public: + + enum { is_assignable = is_assignable_space && + is_assignable_value_type && + is_assignable_dimension }; + + typedef Kokkos::Impl::SharedAllocationTracker TrackType ; + typedef ViewMapping< DstTraits , void > DstType ; + typedef ViewMapping< SrcTraits , void > SrcType ; + + KOKKOS_INLINE_FUNCTION + static bool assignable_layout_check(DstType & dst, const SrcType & src) //Runtime check + { + size_t strides[9]; + bool assignable = true; + src.stride(strides); + size_t exp_stride = 1; + if (std::is_same< typename DstTraits::array_layout, Kokkos::LayoutLeft >::value) { + for(int i=0; i<src.Rank; i++) { + if (i>0) exp_stride *= src.extent(i-1); + if (strides[i] != exp_stride){assignable=false;break;} + } + } + else if (std::is_same< typename DstTraits::array_layout, Kokkos::LayoutRight >::value) { + for(int i=src.Rank-1; i>=0; i--) { + if (i<src.Rank-1) exp_stride *= src.extent(i+1); + if (strides[i] != exp_stride){assignable=false;break;} + } + } + return assignable; + } + + KOKKOS_INLINE_FUNCTION + static void assign( DstType & dst , const SrcType & src , const TrackType & src_track ) + { + static_assert( is_assignable_space + , "View assignment must have compatible spaces" ); + + static_assert( is_assignable_value_type + , "View assignment must have same value type or const = non-const" ); + + static_assert( is_assignable_dimension + , "View assignment must have compatible dimensions" ); + + bool assignable_layout = assignable_layout_check(dst, src); //Runtime check + if(!assignable_layout) + Kokkos::abort("View assignment must have compatible layouts\n"); + + typedef typename DstType::offset_type dst_offset_type ; + + if ( size_t(DstTraits::dimension::rank_dynamic) < size_t(SrcTraits::dimension::rank_dynamic) ) { + typedef typename DstTraits::dimension dst_dim; + bool assignable = + ( ( 1 > DstTraits::dimension::rank_dynamic && 1 <= SrcTraits::dimension::rank_dynamic ) ? + dst_dim::ArgN0 == src.dimension_0() : true ) && + ( ( 2 > DstTraits::dimension::rank_dynamic && 2 <= SrcTraits::dimension::rank_dynamic ) ? + dst_dim::ArgN1 == src.dimension_1() : true ) && + ( ( 3 > DstTraits::dimension::rank_dynamic && 3 <= SrcTraits::dimension::rank_dynamic ) ? + dst_dim::ArgN2 == src.dimension_2() : true ) && + ( ( 4 > DstTraits::dimension::rank_dynamic && 4 <= SrcTraits::dimension::rank_dynamic ) ? + dst_dim::ArgN3 == src.dimension_3() : true ) && + ( ( 5 > DstTraits::dimension::rank_dynamic && 5 <= SrcTraits::dimension::rank_dynamic ) ? + dst_dim::ArgN4 == src.dimension_4() : true ) && + ( ( 6 > DstTraits::dimension::rank_dynamic && 6 <= SrcTraits::dimension::rank_dynamic ) ? + dst_dim::ArgN5 == src.dimension_5() : true ) && + ( ( 7 > DstTraits::dimension::rank_dynamic && 7 <= SrcTraits::dimension::rank_dynamic ) ? + dst_dim::ArgN6 == src.dimension_6() : true ) && + ( ( 8 > DstTraits::dimension::rank_dynamic && 8 <= SrcTraits::dimension::rank_dynamic ) ? + dst_dim::ArgN7 == src.dimension_7() : true ) + ; + if(!assignable) + Kokkos::abort("View Assignment: trying to assign runtime dimension to non matching compile time dimension."); + } + dst.m_impl_offset = dst_offset_type( src.m_impl_offset ); + dst.m_impl_handle = Kokkos::Impl::ViewDataHandle< DstTraits >::assign( src.m_impl_handle , src_track ); } }; @@ -3106,12 +3243,12 @@ public: typedef typename DstType::offset_type dst_offset_type ; const SubviewExtents< SrcTraits::rank , rank > - extents( src.m_offset.m_dim , args... ); + extents( src.m_impl_offset.m_dim , args... ); - dst.m_offset = dst_offset_type( src.m_offset , extents ); + dst.m_impl_offset = dst_offset_type( src.m_impl_offset , extents ); - dst.m_handle = ViewDataHandle< DstTraits >::assign(src.m_handle, - src.m_offset( extents.domain_offset(0) + dst.m_impl_handle = ViewDataHandle< DstTraits >::assign(src.m_impl_handle, + src.m_impl_offset( extents.domain_offset(0) , extents.domain_offset(1) , extents.domain_offset(2) , extents.domain_offset(3) @@ -3152,6 +3289,7 @@ bool view_verify_operator_bounds && view_verify_operator_bounds<R+1>( map , args ... ); } + template< unsigned , class MapType > inline void view_error_operator_bounds( char * , int , const MapType & ) @@ -3176,6 +3314,7 @@ void view_error_operator_bounds view_error_operator_bounds<R+1>(buf+n,len-n,map,args...); } + #if ! defined( KOKKOS_ACTIVE_EXECUTION_MEMORY_SPACE_HOST ) /* Check #3: is the View managed as determined by the MemoryTraits? */ @@ -3275,6 +3414,8 @@ void view_verify_operator_bounds } } + + } /* namespace Impl */ } /* namespace Kokkos */ diff --git a/packages/kokkos/core/src/impl/Kokkos_ViewTile.hpp b/packages/kokkos/core/src/impl/Kokkos_ViewTile.hpp index 42bc8c2308b2bc7b45c540d4ffe6f97911a11953..716b9ceca5389b3fe64ae9ed6ee2549260932589 100644 --- a/packages/kokkos/core/src/impl/Kokkos_ViewTile.hpp +++ b/packages/kokkos/core/src/impl/Kokkos_ViewTile.hpp @@ -202,8 +202,8 @@ struct ViewMapping typedef typename src_map_type::offset_type src_offset_type ; dst = dst_map_type( - dst_handle_type( src.m_handle + - ( ( i_tile0 + src.m_offset.m_tile_N0 * i_tile1 ) << src_offset_type::SHIFT_T ) ) , + dst_handle_type( src.m_impl_handle + + ( ( i_tile0 + src.m_impl_offset.m_tile_N0 * i_tile1 ) << src_offset_type::SHIFT_T ) ) , dst_offset_type() ); } }; diff --git a/packages/kokkos/core/src/impl/Kokkos_hwloc.cpp b/packages/kokkos/core/src/impl/Kokkos_hwloc.cpp index 7dc8a5356691c6609329882cfee55abaaebd9ae3..423944962b34a1900b9758ec4fd9b3bc30ff651b 100644 --- a/packages/kokkos/core/src/impl/Kokkos_hwloc.cpp +++ b/packages/kokkos/core/src/impl/Kokkos_hwloc.cpp @@ -336,11 +336,11 @@ Sentinel::Sentinel() const hwloc_obj_t core = hwloc_get_obj_by_type( s_hwloc_topology , HWLOC_OBJ_CORE , 0 ); - if ( hwloc_bitmap_intersects( s_process_binding , core->allowed_cpuset ) ) { + if ( hwloc_bitmap_intersects( s_process_binding , core->cpuset ) ) { hwloc_bitmap_t s_process_no_core_zero = hwloc_bitmap_alloc(); - hwloc_bitmap_andnot( s_process_no_core_zero , s_process_binding , core->allowed_cpuset ); + hwloc_bitmap_andnot( s_process_no_core_zero , s_process_binding , core->cpuset ); bool ok = 0 == hwloc_set_cpubind( s_hwloc_topology , s_process_no_core_zero , @@ -402,14 +402,14 @@ Sentinel::Sentinel() const hwloc_obj_t root = hwloc_get_obj_by_type( s_hwloc_topology , root_type , i ); - if ( hwloc_bitmap_intersects( s_process_binding , root->allowed_cpuset ) ) { + if ( hwloc_bitmap_intersects( s_process_binding , root->cpuset ) ) { ++root_count ; // Remember which root (NUMA) object the master thread is running on. // This will be logical NUMA rank #0 for this process. - if ( hwloc_bitmap_intersects( proc_cpuset_location, root->allowed_cpuset ) ) { + if ( hwloc_bitmap_intersects( proc_cpuset_location, root->cpuset ) ) { root_base = i ; } @@ -417,7 +417,7 @@ Sentinel::Sentinel() const unsigned max_core = hwloc_get_nbobjs_inside_cpuset_by_type( s_hwloc_topology , - root->allowed_cpuset , + root->cpuset , HWLOC_OBJ_CORE ); unsigned core_count = 0 ; @@ -426,7 +426,7 @@ Sentinel::Sentinel() const hwloc_obj_t core = hwloc_get_obj_inside_cpuset_by_type( s_hwloc_topology , - root->allowed_cpuset , + root->cpuset , HWLOC_OBJ_CORE , j ); // If process' cpuset intersects core's cpuset then process can access this core. @@ -438,13 +438,13 @@ Sentinel::Sentinel() // This assumes that it would be performance-detrimental // to spawn more than one MPI process per core and use nested threading. - if ( hwloc_bitmap_intersects( s_process_binding , core->allowed_cpuset ) ) { + if ( hwloc_bitmap_intersects( s_process_binding , core->cpuset ) ) { ++core_count ; const unsigned pu_count = hwloc_get_nbobjs_inside_cpuset_by_type( s_hwloc_topology , - core->allowed_cpuset , + core->cpuset , HWLOC_OBJ_PU ); if ( pu_per_core == 0 ) pu_per_core = pu_count ; @@ -480,11 +480,11 @@ Sentinel::Sentinel() const hwloc_obj_t root = hwloc_get_obj_by_type( s_hwloc_topology , root_type , root_rank ); - if ( hwloc_bitmap_intersects( s_process_binding , root->allowed_cpuset ) ) { + if ( hwloc_bitmap_intersects( s_process_binding , root->cpuset ) ) { const unsigned max_core = hwloc_get_nbobjs_inside_cpuset_by_type( s_hwloc_topology , - root->allowed_cpuset , + root->cpuset , HWLOC_OBJ_CORE ); unsigned core_count = 0 ; @@ -493,12 +493,12 @@ Sentinel::Sentinel() const hwloc_obj_t core = hwloc_get_obj_inside_cpuset_by_type( s_hwloc_topology , - root->allowed_cpuset , + root->cpuset , HWLOC_OBJ_CORE , j ); - if ( hwloc_bitmap_intersects( s_process_binding , core->allowed_cpuset ) ) { + if ( hwloc_bitmap_intersects( s_process_binding , core->cpuset ) ) { - s_core[ core_count + core_per_root * i ] = core->allowed_cpuset ; + s_core[ core_count + core_per_root * i ] = core->cpuset ; ++core_count ; } diff --git a/packages/kokkos/core/src/kokkos.pc.in b/packages/kokkos/core/src/kokkos.pc.in new file mode 100644 index 0000000000000000000000000000000000000000..f27b57c960781c334e98eb0c61adf55aee7614e8 --- /dev/null +++ b/packages/kokkos/core/src/kokkos.pc.in @@ -0,0 +1,71 @@ +# +# Kokkos v. 2.0 +# Copyright (2014) Sandia Corporation +# +# Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, +# the U.S. Government retains certain rights in this software. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions are +# met: +# +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# 3. Neither the name of the Corporation nor the names of the +# contributors may be used to endorse or promote products derived from +# this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY +# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE +# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +# PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +# +# Questions? Contact Christian R. Trott (crtrott@sandia.gov) +# + +# Add the directory where kokkos.pc got installed to your PKG_CONFIG_PATH + +# Use this on commandline with: +# c++ `pkg-config --cflags --libs kokkos` -o myapp myapp.cpp + +# Use this in a Makefile: +# myapp: myapp.cpp +# $(CC) `pkg-config --cflags --libs kokkos` -o $@ $< + +# Use this in autotools: +# configure.ac: +# PKG_CHECK_MODULES([KOKKOS], [kokkos]) +# Makefile.am: +# myapp_CFLAGS = $(KOKKOS_CFLAGS) +# myapp_LDADD = $(KOKKOS_LIBS) + +# Use this in CMake: +# CMakeLists.txt: +# find_package(PkgConfig) +# pkg_check_modules(KOKKOS IMPORTED_TARGET kokkos) +# target_link_libraries(<lib> PkgConfig::KOKKOS) + +prefix=@CMAKE_INSTALL_PREFIX@ +libdir=${prefix}/lib +includedir=${prefix}/include + +Name: kokkos +Description: Kokkos C++ Performance Portability Programming EcoSystem +URL: https://github.com/kokkos +Version: +Requires: +Libs: -L${libdir} -lkokkos @KOKKOS_EXTRA_LIBS_LIST@ @KOKKOS_LINK_FLAGS@ +Libs.private: -lm +Cflags: -I${includedir} @KOKKOS_CXXFLAGS@ diff --git a/packages/kokkos/core/unit_test/CMakeLists.txt b/packages/kokkos/core/unit_test/CMakeLists.txt index 651abf04dd68830aaf1f2c5a3c9ad0e6aba0a886..fad4e1d45eaca26f3a030de87a81cabafd5fa108 100644 --- a/packages/kokkos/core/unit_test/CMakeLists.txt +++ b/packages/kokkos/core/unit_test/CMakeLists.txt @@ -284,6 +284,7 @@ IF(Kokkos_ENABLE_Cuda) SOURCES UnitTestMainInit.cpp cuda/TestCudaHostPinned_SharedAlloc.cpp + cuda/TestCudaHostPinned_ViewCopy.cpp cuda/TestCudaHostPinned_ViewAPI_a.cpp cuda/TestCudaHostPinned_ViewAPI_b.cpp cuda/TestCudaHostPinned_ViewAPI_c.cpp @@ -293,6 +294,7 @@ IF(Kokkos_ENABLE_Cuda) cuda/TestCudaHostPinned_ViewMapping_b.cpp cuda/TestCudaHostPinned_ViewMapping_subview.cpp cuda/TestCudaUVM_SharedAlloc.cpp + cuda/TestCudaUVM_ViewCopy.cpp cuda/TestCudaUVM_ViewAPI_a.cpp cuda/TestCudaUVM_ViewAPI_b.cpp cuda/TestCudaUVM_ViewAPI_c.cpp diff --git a/packages/kokkos/core/unit_test/Makefile b/packages/kokkos/core/unit_test/Makefile index b50222e37690ea811c0e5ef83ab74509ea3db53e..72832271c8785809e19c5ae33435a2ff0fbfaaa8 100644 --- a/packages/kokkos/core/unit_test/Makefile +++ b/packages/kokkos/core/unit_test/Makefile @@ -43,12 +43,12 @@ ifeq ($(KOKKOS_INTERNAL_USE_CUDA), 1) OBJ_CUDA += TestCuda_SharedAlloc.o TestCudaUVM_SharedAlloc.o TestCudaHostPinned_SharedAlloc.o OBJ_CUDA += TestCuda_RangePolicy.o OBJ_CUDA += TestCuda_ViewAPI_a.o TestCuda_ViewAPI_b.o TestCuda_ViewAPI_c.o TestCuda_ViewAPI_d.o TestCuda_ViewAPI_e.o - OBJ_CUDA += TestCuda_ViewMapping_a.o TestCuda_ViewMapping_b.o TestCuda_ViewMapping_subview.o - OBJ_CUDA += TestCudaUVM_ViewAPI_a.o TestCudaUVM_ViewAPI_b.o TestCudaUVM_ViewAPI_c.o TestCudaUVM_ViewAPI_d.o TestCudaUVM_ViewAPI_e.o + OBJ_CUDA += TestCuda_ViewMapping_a.o TestCuda_ViewMapping_b.o TestCuda_ViewMapping_subview.o TestCuda_ViewLayoutStrideAssignment.o + OBJ_CUDA += TestCudaUVM_ViewCopy.o TestCudaUVM_ViewAPI_a.o TestCudaUVM_ViewAPI_b.o TestCudaUVM_ViewAPI_c.o TestCudaUVM_ViewAPI_d.o TestCudaUVM_ViewAPI_e.o OBJ_CUDA += TestCudaUVM_ViewMapping_a.o TestCudaUVM_ViewMapping_b.o TestCudaUVM_ViewMapping_subview.o - OBJ_CUDA += TestCudaHostPinned_ViewAPI_a.o TestCudaHostPinned_ViewAPI_b.o TestCudaHostPinned_ViewAPI_c.o TestCudaHostPinned_ViewAPI_d.o TestCudaHostPinned_ViewAPI_e.o + OBJ_CUDA += TestCudaHostPinned_ViewCopy.o TestCudaHostPinned_ViewAPI_a.o TestCudaHostPinned_ViewAPI_b.o TestCudaHostPinned_ViewAPI_c.o TestCudaHostPinned_ViewAPI_d.o TestCudaHostPinned_ViewAPI_e.o OBJ_CUDA += TestCudaHostPinned_ViewMapping_a.o TestCudaHostPinned_ViewMapping_b.o TestCudaHostPinned_ViewMapping_subview.o - OBJ_CUDA += TestCuda_View_64bit.o + OBJ_CUDA += TestCuda_View_64bit.o OBJ_CUDA += TestCuda_ViewOfClass.o OBJ_CUDA += TestCuda_SubView_a.o TestCuda_SubView_b.o OBJ_CUDA += TestCuda_SubView_c01.o TestCuda_SubView_c02.o TestCuda_SubView_c03.o @@ -57,13 +57,14 @@ ifeq ($(KOKKOS_INTERNAL_USE_CUDA), 1) OBJ_CUDA += TestCuda_SubView_c10.o TestCuda_SubView_c11.o TestCuda_SubView_c12.o OBJ_CUDA += TestCuda_SubView_c13.o OBJ_CUDA += TestCuda_Reductions.o TestCuda_Scan.o + OBJ_CUDA += TestCuda_Reductions_DeviceView.o OBJ_CUDA += TestCuda_Reducers_a.o TestCuda_Reducers_b.o TestCuda_Reducers_c.o TestCuda_Reducers_d.o OBJ_CUDA += TestCuda_Complex.o OBJ_CUDA += TestCuda_AtomicOperations_int.o TestCuda_AtomicOperations_unsignedint.o TestCuda_AtomicOperations_longint.o OBJ_CUDA += TestCuda_AtomicOperations_unsignedlongint.o TestCuda_AtomicOperations_longlongint.o TestCuda_AtomicOperations_double.o TestCuda_AtomicOperations_float.o OBJ_CUDA += TestCuda_AtomicViews.o TestCuda_Atomics.o OBJ_CUDA += TestCuda_Team.o TestCuda_TeamScratch.o - OBJ_CUDA += TestCuda_TeamReductionScan.o + OBJ_CUDA += TestCuda_TeamReductionScan.o TestCuda_TeamTeamSize.o OBJ_CUDA += TestCuda_Other.o OBJ_CUDA += TestCuda_MDRange_a.o TestCuda_MDRange_b.o TestCuda_MDRange_c.o TestCuda_MDRange_d.o TestCuda_MDRange_e.o OBJ_CUDA += TestCuda_Crs.o @@ -84,13 +85,11 @@ ifeq ($(KOKKOS_INTERNAL_USE_ROCM), 1) OBJ_ROCM += TestROCm_AtomicOperations_int.o TestROCm_AtomicOperations_unsignedint.o TestROCm_AtomicOperations_longint.o OBJ_ROCM += TestROCm_AtomicOperations_unsignedlongint.o TestROCm_AtomicOperations_longlongint.o TestROCm_AtomicOperations_double.o TestROCm_AtomicOperations_float.o OBJ_ROCM += TestROCm_Atomics.o -# complex failing OBJ_ROCM += TestROCm_AtomicViews.o OBJ_ROCM += TestROCm_Other.o -# Compiles but runtime Segfaults: -# OBJ_ROCM += TestROCm_MDRange_a.o TestROCm_MDRange_b.o TestROCm_MDRange_c.o TestROCm_MDRange_d.o TestROCm_MDRange_e.o -# rocm.memory_pool - OBJ_ROCM += TestROCm_Reductions.o + OBJ_ROCM += TestROCm_MDRange_a.o TestROCm_MDRange_b.o TestROCm_MDRange_c.o TestROCm_MDRange_d.o TestROCm_MDRange_e.o + OBJ_ROCM += TestROCm_MDRangeReduce_a.o TestROCm_MDRangeReduce_b.o TestROCm_MDRangeReduce_c.o TestROCm_MDRangeReduce_d.o TestROCm_MDRangeReduce_e.o + OBJ_ROCM += TestROCm_Reductions.o OBJ_ROCM += TestROCm_Reducers_a.o TestROCm_Reducers_b.o TestROCm_Reducers_c.o TestROCm_Reducers_d.o OBJ_ROCM += TestROCm_Scan.o OBJ_ROCM += TestROCm_SharedAlloc.o @@ -108,22 +107,22 @@ ifeq ($(KOKKOS_INTERNAL_USE_ROCM), 1) OBJ_ROCM += TestROCm_SubView_c10.o OBJ_ROCM += TestROCm_SubView_c11.o OBJ_ROCM += TestROCm_SubView_c12.o + OBJ_ROCM += TestROCm_SubView_c13.o OBJ_ROCM += TestROCm_Team.o -# compile fails / compiler segfaults - #OBJ_ROCM += TestROCm_TeamReductionScan.o -# compile fails - OBJ_ROCM += TestROCm_TeamScratch.o + OBJ_ROCM += TestROCm_TeamReductionScan.o + OBJ_ROCM += TestROCm_TeamScratch.o TestROCm_TeamTeamSize.o OBJ_ROCM += TestROCm_ViewAPI_a.o TestROCm_ViewAPI_b.o TestROCm_ViewAPI_c.o TestROCm_ViewAPI_d.o TestROCm_ViewAPI_e.o OBJ_ROCM += TestROCm_ViewMapping_a.o OBJ_ROCM += TestROCm_ViewMapping_b.o OBJ_ROCM += TestROCm_ViewMapping_subview.o - OBJ_ROCM += TestROCmHostPinned_ViewAPI_a.o TestROCmHostPinned_ViewAPI_b.o TestROCmHostPinned_ViewAPI_c.o TestROCmHostPinned_ViewAPI_d.o TestROCmHostPinned_ViewAPI_e.o + OBJ_ROCM += TestROCmHostPinned_ViewCopy.o TestROCmHostPinned_ViewAPI_a.o TestROCmHostPinned_ViewAPI_b.o TestROCmHostPinned_ViewAPI_c.o TestROCmHostPinned_ViewAPI_d.o TestROCmHostPinned_ViewAPI_e.o OBJ_ROCM += TestROCmHostPinned_View_64bit.o - OBJ_ROCM += TestROCmHostPinned_ViewMapping_a.o - OBJ_ROCM += TestROCmHostPinned_ViewMapping_b.o - OBJ_ROCM += TestROCmHostPinned_ViewMapping_subview.o + OBJ_ROCM += TestROCmHostPinned_ViewMapping_a.o + OBJ_ROCM += TestROCmHostPinned_ViewMapping_b.o + OBJ_ROCM += TestROCmHostPinned_ViewMapping_subview.o OBJ_ROCM += TestROCm_ViewOfClass.o - OBJ_ROCM += TestROCm_Spaces.o + OBJ_ROCM += TestROCm_Spaces.o + OBJ_ROCM += TestROCm_Crs.o TARGETS += KokkosCore_UnitTest_ROCm TEST_TARGETS += test-rocm @@ -137,7 +136,7 @@ ifeq ($(KOKKOS_INTERNAL_USE_PTHREADS), 1) OBJ_THREADS += TestThreads_RangePolicy.o OBJ_THREADS += TestThreads_View_64bit.o OBJ_THREADS += TestThreads_ViewAPI_a.o TestThreads_ViewAPI_b.o TestThreads_ViewAPI_c.o TestThreads_ViewAPI_d.o TestThreads_ViewAPI_e.o - OBJ_THREADS += TestThreads_ViewMapping_a.o TestThreads_ViewMapping_b.o TestThreads_ViewMapping_subview.o + OBJ_THREADS += TestThreads_ViewMapping_a.o TestThreads_ViewMapping_b.o TestThreads_ViewMapping_subview.o TestThreads_ViewLayoutStrideAssignment.o OBJ_THREADS += TestThreads_ViewOfClass.o OBJ_THREADS += TestThreads_SubView_a.o TestThreads_SubView_b.o OBJ_THREADS += TestThreads_SubView_c01.o TestThreads_SubView_c02.o TestThreads_SubView_c03.o @@ -145,12 +144,13 @@ ifeq ($(KOKKOS_INTERNAL_USE_PTHREADS), 1) OBJ_THREADS += TestThreads_SubView_c07.o TestThreads_SubView_c08.o TestThreads_SubView_c09.o OBJ_THREADS += TestThreads_SubView_c10.o TestThreads_SubView_c11.o TestThreads_SubView_c12.o OBJ_THREADS += TestThreads_Reductions.o TestThreads_Scan.o + OBJ_THREADS += TestThreads_Reductions_DeviceView.o OBJ_THREADS += TestThreads_Reducers_a.o TestThreads_Reducers_b.o TestThreads_Reducers_c.o TestThreads_Reducers_d.o OBJ_THREADS += TestThreads_Complex.o OBJ_THREADS += TestThreads_AtomicOperations_int.o TestThreads_AtomicOperations_unsignedint.o TestThreads_AtomicOperations_longint.o OBJ_THREADS += TestThreads_AtomicOperations_unsignedlongint.o TestThreads_AtomicOperations_longlongint.o TestThreads_AtomicOperations_double.o TestThreads_AtomicOperations_float.o OBJ_THREADS += TestThreads_AtomicViews.o TestThreads_Atomics.o - OBJ_THREADS += TestThreads_Team.o TestThreads_TeamScratch.o + OBJ_THREADS += TestThreads_Team.o TestThreads_TeamScratch.o TestThreads_TeamTeamSize.o OBJ_THREADS += TestThreads_TeamReductionScan.o OBJ_THREADS += TestThreads_Other.o OBJ_THREADS += TestThreads_MDRange_a.o TestThreads_MDRange_b.o TestThreads_MDRange_c.o TestThreads_MDRange_d.o TestThreads_MDRange_e.o @@ -167,7 +167,7 @@ ifeq ($(KOKKOS_INTERNAL_USE_OPENMP), 1) OBJ_OPENMP += TestOpenMP_RangePolicy.o OBJ_OPENMP += TestOpenMP_View_64bit.o OBJ_OPENMP += TestOpenMP_ViewAPI_a.o TestOpenMP_ViewAPI_b.o TestOpenMP_ViewAPI_c.o TestOpenMP_ViewAPI_d.o TestOpenMP_ViewAPI_e.o - OBJ_OPENMP += TestOpenMP_ViewMapping_a.o TestOpenMP_ViewMapping_b.o TestOpenMP_ViewMapping_subview.o + OBJ_OPENMP += TestOpenMP_ViewMapping_a.o TestOpenMP_ViewMapping_b.o TestOpenMP_ViewMapping_subview.o TestOpenMP_ViewLayoutStrideAssignment.o OBJ_OPENMP += TestOpenMP_ViewOfClass.o OBJ_OPENMP += TestOpenMP_SubView_a.o TestOpenMP_SubView_b.o OBJ_OPENMP += TestOpenMP_SubView_c01.o TestOpenMP_SubView_c02.o TestOpenMP_SubView_c03.o @@ -176,13 +176,14 @@ ifeq ($(KOKKOS_INTERNAL_USE_OPENMP), 1) OBJ_OPENMP += TestOpenMP_SubView_c10.o TestOpenMP_SubView_c11.o TestOpenMP_SubView_c12.o OBJ_OPENMP += TestOpenMP_SubView_c13.o OBJ_OPENMP += TestOpenMP_Reductions.o TestOpenMP_Scan.o + OBJ_OPENMP += TestOpenMP_Reductions_DeviceView.o OBJ_OPENMP += TestOpenMP_Reducers_a.o TestOpenMP_Reducers_b.o TestOpenMP_Reducers_c.o TestOpenMP_Reducers_d.o OBJ_OPENMP += TestOpenMP_Complex.o OBJ_OPENMP += TestOpenMP_AtomicOperations_int.o TestOpenMP_AtomicOperations_unsignedint.o TestOpenMP_AtomicOperations_longint.o OBJ_OPENMP += TestOpenMP_AtomicOperations_unsignedlongint.o TestOpenMP_AtomicOperations_longlongint.o TestOpenMP_AtomicOperations_double.o TestOpenMP_AtomicOperations_float.o OBJ_OPENMP += TestOpenMP_AtomicViews.o TestOpenMP_Atomics.o OBJ_OPENMP += TestOpenMP_Team.o TestOpenMP_TeamScratch.o - OBJ_OPENMP += TestOpenMP_TeamReductionScan.o + OBJ_OPENMP += TestOpenMP_TeamReductionScan.o TestOpenMP_TeamTeamSize.o OBJ_OPENMP += TestOpenMP_Other.o OBJ_OPENMP += TestOpenMP_MDRange_a.o TestOpenMP_MDRange_b.o TestOpenMP_MDRange_c.o TestOpenMP_MDRange_d.o TestOpenMP_MDRange_e.o OBJ_OPENMP += TestOpenMP_Crs.o @@ -256,7 +257,7 @@ ifeq ($(KOKKOS_INTERNAL_USE_SERIAL), 1) OBJ_SERIAL += TestSerial_RangePolicy.o OBJ_SERIAL += TestSerial_View_64bit.o OBJ_SERIAL += TestSerial_ViewAPI_a.o TestSerial_ViewAPI_b.o TestSerial_ViewAPI_c.o TestSerial_ViewAPI_d.o TestSerial_ViewAPI_e.o - OBJ_SERIAL += TestSerial_ViewMapping_a.o TestSerial_ViewMapping_b.o TestSerial_ViewMapping_subview.o + OBJ_SERIAL += TestSerial_ViewMapping_a.o TestSerial_ViewMapping_b.o TestSerial_ViewMapping_subview.o TestSerial_ViewLayoutStrideAssignment.o OBJ_SERIAL += TestSerial_ViewOfClass.o OBJ_SERIAL += TestSerial_SubView_a.o TestSerial_SubView_b.o OBJ_SERIAL += TestSerial_SubView_c01.o TestSerial_SubView_c02.o TestSerial_SubView_c03.o @@ -265,13 +266,14 @@ ifeq ($(KOKKOS_INTERNAL_USE_SERIAL), 1) OBJ_SERIAL += TestSerial_SubView_c10.o TestSerial_SubView_c11.o TestSerial_SubView_c12.o OBJ_SERIAL += TestSerial_SubView_c13.o OBJ_SERIAL += TestSerial_Reductions.o TestSerial_Scan.o + OBJ_SERIAL += TestSerial_Reductions_DeviceView.o OBJ_SERIAL += TestSerial_Reducers_a.o TestSerial_Reducers_b.o TestSerial_Reducers_c.o TestSerial_Reducers_d.o OBJ_SERIAL += TestSerial_Complex.o OBJ_SERIAL += TestSerial_AtomicOperations_int.o TestSerial_AtomicOperations_unsignedint.o TestSerial_AtomicOperations_longint.o OBJ_SERIAL += TestSerial_AtomicOperations_unsignedlongint.o TestSerial_AtomicOperations_longlongint.o TestSerial_AtomicOperations_double.o TestSerial_AtomicOperations_float.o OBJ_SERIAL += TestSerial_AtomicViews.o TestSerial_Atomics.o OBJ_SERIAL += TestSerial_Team.o TestSerial_TeamScratch.o - OBJ_SERIAL += TestSerial_TeamReductionScan.o + OBJ_SERIAL += TestSerial_TeamReductionScan.o TestSerial_TeamTeamSize.o OBJ_SERIAL += TestSerial_Other.o #HCC_WORKAROUND ifneq ($(KOKKOS_INTERNAL_COMPILER_HCC), 1) diff --git a/packages/kokkos/core/unit_test/TestAtomic.hpp b/packages/kokkos/core/unit_test/TestAtomic.hpp index cf4bae5844da182c50829e67a0560c04ff519fe5..58b63251156eee869b2cb036620539fa4d7d4592 100644 --- a/packages/kokkos/core/unit_test/TestAtomic.hpp +++ b/packages/kokkos/core/unit_test/TestAtomic.hpp @@ -224,7 +224,8 @@ T AddLoop( int loop ) { struct AddFunctorReduce< T, execution_space > f_add_red; f_add_red.data = data; - Kokkos::parallel_reduce( loop, f_add_red ); + int dummy_result; + Kokkos::parallel_reduce( loop, f_add_red , dummy_result ); execution_space::fence(); return val; @@ -309,7 +310,8 @@ T CASLoop( int loop ) { struct CASFunctorReduce< T, execution_space > f_cas_red; f_cas_red.data = data; - Kokkos::parallel_reduce( loop, f_cas_red ); + int dummy_result; + Kokkos::parallel_reduce( loop, f_cas_red , dummy_result ); execution_space::fence(); return val; @@ -401,7 +403,8 @@ T ExchLoop( int loop ) { struct ExchFunctorReduce< T, execution_space > f_exch_red; f_exch_red.data = data; f_exch_red.data2 = data2; - Kokkos::parallel_reduce( loop, f_exch_red ); + int dummy_result; + Kokkos::parallel_reduce( loop, f_exch_red , dummy_result ); execution_space::fence(); return val; @@ -529,7 +532,7 @@ TEST_F( TEST_CATEGORY, atomics ) ASSERT_TRUE( ( TestAtomic::Loop< float, TEST_EXECSPACE >( 100, 3 ) ) ); #ifndef KOKKOS_ENABLE_OPENMPTARGET -#ifndef KOKKOS_ENABLE_ROCM +#ifndef KOKKOS_ENABLE_ROCM // ROCM doesn't yet support atomics for >64bit types ASSERT_TRUE( ( TestAtomic::Loop< Kokkos::complex<double>, TEST_EXECSPACE >( 1, 1 ) ) ); ASSERT_TRUE( ( TestAtomic::Loop< Kokkos::complex<double>, TEST_EXECSPACE >( 1, 2 ) ) ); ASSERT_TRUE( ( TestAtomic::Loop< Kokkos::complex<double>, TEST_EXECSPACE >( 1, 3 ) ) ); diff --git a/packages/kokkos/core/unit_test/TestCXX11.hpp b/packages/kokkos/core/unit_test/TestCXX11.hpp index b6c34d2d4b7e6e68128c3ff81a5782614d2db28c..8a158e2667e5fbd68a233e6e3502a1f8f8bf9c4a 100644 --- a/packages/kokkos/core/unit_test/TestCXX11.hpp +++ b/packages/kokkos/core/unit_test/TestCXX11.hpp @@ -216,7 +216,7 @@ template< class DeviceType, bool PWRTest > double ReduceTestFunctor() { typedef Kokkos::TeamPolicy< DeviceType > policy_type; typedef Kokkos::View< double**, DeviceType > view_type; - typedef Kokkos::View< double, typename view_type::host_mirror_space, Kokkos::MemoryUnmanaged > unmanaged_result; + typedef Kokkos::View< double, Kokkos::HostSpace, Kokkos::MemoryUnmanaged > unmanaged_result; view_type a( "A", 100, 5 ); typename view_type::HostMirror h_a = Kokkos::create_mirror_view( a ); @@ -244,7 +244,7 @@ template< class DeviceType, bool PWRTest > double ReduceTestLambda() { typedef Kokkos::TeamPolicy< DeviceType > policy_type; typedef Kokkos::View< double**, DeviceType > view_type; - typedef Kokkos::View< double, typename view_type::host_mirror_space, Kokkos::MemoryUnmanaged > unmanaged_result; + typedef Kokkos::View< double, Kokkos::HostSpace, Kokkos::MemoryUnmanaged > unmanaged_result; view_type a( "A", 100, 5 ); typename view_type::HostMirror h_a = Kokkos::create_mirror_view( a ); @@ -327,12 +327,18 @@ bool Test( int test ) { }; bool passed = true; - if ( res_functor != res_lambda ) { + auto a = res_functor; + auto b = res_lambda; + // use a tolerant comparison because functors and lambdas vectorize differently + // https://github.com/trilinos/Trilinos/issues/3233 + auto rel_err = (std::abs(b - a) / std::max(std::abs(a), std::abs(b))); + auto tol = 1e-14; + if (rel_err > tol) { passed = false; std::cout << "CXX11 ( test = '" - << testnames[test] << "' FAILED : " - << res_functor << " != " << res_lambda + << testnames[test] << "' FAILED : relative error " + << rel_err << " > tolerance " << tol << std::endl; } diff --git a/packages/kokkos/core/unit_test/TestComplex.hpp b/packages/kokkos/core/unit_test/TestComplex.hpp index fcaebe3c6ee742ca66c0662bdb423167330abc49..f4343df0cef756a9576ca4a904ffbae2d05f181e 100644 --- a/packages/kokkos/core/unit_test/TestComplex.hpp +++ b/packages/kokkos/core/unit_test/TestComplex.hpp @@ -71,7 +71,7 @@ struct TestComplexConstruction { ASSERT_FLOAT_EQ(h_results(7).real(),7.5); ASSERT_FLOAT_EQ(h_results(7).imag(),0.0); ASSERT_FLOAT_EQ(h_results(8).real(),double(8)); ASSERT_FLOAT_EQ(h_results(8).imag(),0.0); -#ifndef KOKKOS_ENABLE_ROCM +#ifndef KOKKOS_ENABLE_ROCM // Copy construction conversion between Kokkos::complex and std::complex doesn't compile Kokkos::complex<double> a(1.5,2.5),b(3.25,5.25),r_kk; std::complex<double> sa(a),sb(3.25,5.25),r; r = a; r_kk = a; ASSERT_FLOAT_EQ(r.real(),r_kk.real()); ASSERT_FLOAT_EQ(r.imag(),r_kk.imag()); diff --git a/packages/kokkos/core/unit_test/TestMDRange.hpp b/packages/kokkos/core/unit_test/TestMDRange.hpp index 9298983aa882bbee7799b5d08c673d155172cd99..88b3a9b0c6ebad8927f281439fd9ef48fabbc39e 100644 --- a/packages/kokkos/core/unit_test/TestMDRange.hpp +++ b/packages/kokkos/core/unit_test/TestMDRange.hpp @@ -318,6 +318,24 @@ struct TestMDRange_2D { ASSERT_EQ( sum, 2 * (N0 - s0) * (N1 - s1) ); } + // Test with reducers - scalar + label + { + typedef typename Kokkos::MDRangePolicy< ExecSpace, Kokkos::Rank<2>, Kokkos::IndexType<int> > range_type; + int s0 = 1; + int s1 = 1; + range_type range( {{ s0, s1 }}, {{ N0, N1 }}, {{ 3, 3 }} ); + + TestMDRange_2D functor( N0, N1 ); + + parallel_for( "rank2-parfor-label", range, functor ); + + value_type sum = 0.0; + Kokkos::Sum< value_type > reducer_scalar( sum ); + + parallel_reduce( "rank2-reducer-label", range, functor, reducer_scalar ); + + ASSERT_EQ( sum, 2 * (N0 - s0) * (N1 - s1) ); + } // Test with reducers - scalar view { typedef typename Kokkos::MDRangePolicy< ExecSpace, Kokkos::Rank<2>, Kokkos::IndexType<int> > range_type; @@ -337,7 +355,31 @@ struct TestMDRange_2D { ASSERT_EQ( sum, 2 * N0 * N1 ); } + // Test Min reducer with lambda +#if defined( KOKKOS_ENABLE_CXX11_DISPATCH_LAMBDA ) +#if !defined(KOKKOS_ENABLE_CUDA) || ( 8000 <= CUDA_VERSION ) + { + typedef typename Kokkos::MDRangePolicy< ExecSpace, Kokkos::Rank<2>, Kokkos::IndexType<int> > range_type; + range_type range( {{ 1, 1 }}, {{ N0, N1 }}, {{ 3, 3 }} ); + + Kokkos::View< double**, ExecSpace > v_in("v_in", N0, N1 ); + + parallel_for( "rank2-init-lambda", range, KOKKOS_LAMBDA ( const int i, const int j ) { + v_in( i , j ) = (i+1) * (j+1) ; + }); + double min; + Kokkos::Min< double > reducer_scalar( min ); + + parallel_reduce( "rank2-min-reducer", range, KOKKOS_LAMBDA ( const int i, const int j, double& min_val ) { + min_val = fmin( v_in(i,j), min_val ); + } + , reducer_scalar); + + ASSERT_EQ( min, 4.0 ); + } +#endif +#endif // Tagged operator test { typedef typename Kokkos::MDRangePolicy< ExecSpace, Kokkos::Rank<2, Iterate::Default, Iterate::Default >, Kokkos::IndexType<int>, InitTag > range_type; @@ -858,6 +900,22 @@ struct TestMDRange_3D { ASSERT_EQ( sum, 2 * N0 * N1 * N2 ); } + // Test with reducers - scalar + label + { + typedef typename Kokkos::MDRangePolicy< ExecSpace, Kokkos::Rank<3>, Kokkos::IndexType<int> > range_type; + range_type range( {{ 0, 0, 0 }}, {{ N0, N1, N2 }}, {{ 3, 3, 3 }} ); + + TestMDRange_3D functor( N0, N1, N2 ); + + parallel_for( "rank3-parfor-label", range, functor ); + + value_type sum = 0.0; + Kokkos::Sum< value_type > reducer_scalar( sum ); + + parallel_reduce( "rank3-reducer-label", range, functor, reducer_scalar ); + + ASSERT_EQ( sum, 2 * N0 * N1 * N2 ); + } // Test with reducers - scalar view { typedef typename Kokkos::MDRangePolicy< ExecSpace, Kokkos::Rank<3>, Kokkos::IndexType<int> > range_type; @@ -877,6 +935,31 @@ struct TestMDRange_3D { ASSERT_EQ( sum, 2 * N0 * N1 * N2 ); } + // Test Min reducer with lambda +#if defined( KOKKOS_ENABLE_CXX11_DISPATCH_LAMBDA ) +#if !defined(KOKKOS_ENABLE_CUDA) || ( 8000 <= CUDA_VERSION ) + { + typedef typename Kokkos::MDRangePolicy< ExecSpace, Kokkos::Rank<3>, Kokkos::IndexType<int> > range_type; + + range_type range( {{ 1, 1, 1 }}, {{ N0, N1, N2 }}, {{ 3, 3, 3 }} ); + + Kokkos::View< double***, ExecSpace > v_in("v_in", N0, N1, N2 ); + + parallel_for( "rank3-init-lambda", range, KOKKOS_LAMBDA ( const int i, const int j, const int k ) { + v_in( i, j, k ) = (i+1) * (j+1) * (k+1) ; + }); + + double min; + + parallel_reduce("rank3-min-reducer", range, KOKKOS_LAMBDA ( const int i, const int j, const int k, double& min_val ) { + min_val = (v_in(i,j,k) < min_val) ? v_in(i,j,k) : min_val; + } + , Kokkos::Min<double>(min) ); + + ASSERT_EQ( min, 8.0 ); + } +#endif +#endif // Tagged operator test { @@ -1382,6 +1465,23 @@ struct TestMDRange_4D { ASSERT_EQ( sum, 2 * N0 * N1 * N2 * N3 ); } + // Test with reducers - scalar + label + { + typedef typename Kokkos::MDRangePolicy< ExecSpace, Kokkos::Rank<4>, Kokkos::IndexType<int> > range_type; + range_type range( {{ 0, 0, 0, 0 }}, {{ N0, N1, N2, N3 }}, {{ 3, 3, 3, 3 }} ); + + TestMDRange_4D functor( N0, N1, N2, N3 ); + + parallel_for( "rank4-parfor-label", range, functor ); + + value_type sum = 0.0; + Kokkos::Sum< value_type > reducer_scalar( sum ); + + parallel_reduce( "rank4-reducer-label", range, functor, reducer_scalar ); + + ASSERT_EQ( sum, 2 * N0 * N1 * N2 * N3 ); + } + // Test with reducers - scalar view { typedef typename Kokkos::MDRangePolicy< ExecSpace, Kokkos::Rank<4>, Kokkos::IndexType<int> > range_type; @@ -1402,6 +1502,32 @@ struct TestMDRange_4D { ASSERT_EQ( sum, 2 * N0 * N1 * N2 * N3 ); } + // Test Min reducer with lambda +#if defined( KOKKOS_ENABLE_CXX11_DISPATCH_LAMBDA ) +#if !defined(KOKKOS_ENABLE_CUDA) || ( 8000 <= CUDA_VERSION ) + { + typedef typename Kokkos::MDRangePolicy< ExecSpace, Kokkos::Rank<4>, Kokkos::IndexType<int> > range_type; + + range_type range( {{ 1, 1, 1, 1 }}, {{ N0, N1, N2, N3 }}, {{ 3, 3, 3, 3 }} ); + + Kokkos::View< double****, ExecSpace > v_in("v_in", N0, N1, N2, N3 ); + + parallel_for( "rank4-init-lambda", range, KOKKOS_LAMBDA ( const int i, const int j, const int k, const int l ) { + v_in( i, j, k, l ) = (i+1) * (j+1) * (k+1) * (l+1) ; + }); + + double min; + + parallel_reduce("rank4-min-reducer", range, KOKKOS_LAMBDA ( const int i, const int j, const int k, const int l, double& min_val ) { + min_val = (v_in(i,j,k,l) < min_val) ? v_in(i,j,k,l) : min_val; + } + , Kokkos::Min<double>(min) ); + + ASSERT_EQ( min, 16.0 ); + } +#endif +#endif + // Tagged operator test { typedef typename Kokkos::MDRangePolicy< ExecSpace, Kokkos::Rank<4, Iterate::Default, Iterate::Default >, Kokkos::IndexType<int>, InitTag > range_type; @@ -1926,6 +2052,23 @@ struct TestMDRange_5D { ASSERT_EQ( sum, 2 * N0 * N1 * N2 * N3 * N4 ); } + // Test with reducers - scalar + label + { + typedef typename Kokkos::MDRangePolicy< ExecSpace, Kokkos::Rank<5>, Kokkos::IndexType<int> > range_type; + range_type range( {{ 0, 0, 0, 0, 0 }}, {{ N0, N1, N2, N3, N4 }}, {{ 3, 3, 3, 3, 3 }} ); + + TestMDRange_5D functor( N0, N1, N2, N3, N4 ); + + parallel_for( "rank5-parfor-label", range, functor ); + + value_type sum = 0.0; + Kokkos::Sum< value_type > reducer_scalar( sum ); + + parallel_reduce( "rank5-reducer-label", range, functor, reducer_scalar ); + + ASSERT_EQ( sum, 2 * N0 * N1 * N2 * N3 * N4 ); + } + // Test with reducers - scalar view { typedef typename Kokkos::MDRangePolicy< ExecSpace, Kokkos::Rank<5>, Kokkos::IndexType<int> > range_type; @@ -1946,6 +2089,32 @@ struct TestMDRange_5D { ASSERT_EQ( sum, 2 * N0 * N1 * N2 * N3 * N4 ); } + // Test Min reducer with lambda +#if defined( KOKKOS_ENABLE_CXX11_DISPATCH_LAMBDA ) +#if !defined(KOKKOS_ENABLE_CUDA) || ( 8000 <= CUDA_VERSION ) + { + typedef typename Kokkos::MDRangePolicy< ExecSpace, Kokkos::Rank<5>, Kokkos::IndexType<int> > range_type; + + range_type range( {{ 1, 1, 1, 1, 1 }}, {{ N0, N1, N2, N3, N4 }}, {{ 3, 3, 3, 2, 2 }} ); + + Kokkos::View< double*****, ExecSpace > v_in("v_in", N0, N1, N2, N3, N4 ); + + parallel_for( "rank5-init-lambda", range, KOKKOS_LAMBDA ( const int i, const int j, const int k, const int l, const int m ) { + v_in( i, j, k, l, m ) = (i+1) * (j+1) * (k+1) * (l+1) * (m+1) ; + }); + + double min; + + parallel_reduce("rank5-min-reducer", range, KOKKOS_LAMBDA ( const int i, const int j, const int k, const int l, const int m, double& min_val ) { + min_val = (v_in(i,j,k,l,m) < min_val) ? v_in(i,j,k,l,m) : min_val; + } + , Kokkos::Min<double>(min) ); + + ASSERT_EQ( min, 32.0 ); + } +#endif +#endif + // Tagged operator test { typedef typename Kokkos::MDRangePolicy< ExecSpace, Kokkos::Rank<5, Iterate::Default, Iterate::Default >, Kokkos::IndexType<int>, InitTag > range_type; @@ -2401,6 +2570,23 @@ struct TestMDRange_6D { ASSERT_EQ( sum, 2 * N0 * N1 * N2 * N3 * N4 * N5 ); } + // Test with reducers - scalar + label + { + typedef typename Kokkos::MDRangePolicy< ExecSpace, Kokkos::Rank<6>, Kokkos::IndexType<int> > range_type; + range_type range( {{ 0, 0, 0, 0, 0, 0 }}, {{ N0, N1, N2, N3, N4, N5 }}, {{ 3, 3, 3, 3, 3, 2 }} ); + + TestMDRange_6D functor( N0, N1, N2, N3, N4, N5 ); + + parallel_for( "rank6-parfor-label", range, functor ); + + value_type sum = 0.0; + Kokkos::Sum< value_type > reducer_scalar( sum ); + + parallel_reduce( "rank6-reducer-label", range, functor, reducer_scalar ); + + ASSERT_EQ( sum, 2 * N0 * N1 * N2 * N3 * N4 * N5 ); + } + // Test with reducers - scalar view { typedef typename Kokkos::MDRangePolicy< ExecSpace, Kokkos::Rank<6>, Kokkos::IndexType<int> > range_type; @@ -2421,6 +2607,32 @@ struct TestMDRange_6D { ASSERT_EQ( sum, 2 * N0 * N1 * N2 * N3 * N4 * N5 ); } + // Test Min reducer with lambda +#if defined( KOKKOS_ENABLE_CXX11_DISPATCH_LAMBDA ) +#if !defined(KOKKOS_ENABLE_CUDA) || ( 8000 <= CUDA_VERSION ) + { + typedef typename Kokkos::MDRangePolicy< ExecSpace, Kokkos::Rank<6>, Kokkos::IndexType<int> > range_type; + + range_type range( {{ 1, 1, 1, 1, 1, 1 }}, {{ N0, N1, N2, N3, N4, N5 }}, {{ 3, 3, 3, 2, 2, 1 }} ); + + Kokkos::View< double******, ExecSpace > v_in("v_in", N0, N1, N2, N3, N4, N5 ); + + parallel_for( "rank6-init-lambda", range, KOKKOS_LAMBDA ( const int i, const int j, const int k, const int l, const int m, const int n ) { + v_in( i, j, k, l, m, n ) = (i+1) * (j+1) * (k+1) * (l+1) * (m+1) * (n+1) ; + }); + + double min; + + parallel_reduce("rank6-min-reducer", range, KOKKOS_LAMBDA ( const int i, const int j, const int k, const int l, const int m, const int n, double& min_val ) { + min_val = (v_in(i,j,k,l,m,n) < min_val) ? v_in(i,j,k,l,m,n) : min_val; + } + , Kokkos::Min<double>(min) ); + + ASSERT_EQ( min, 64.0 ); + } +#endif +#endif + // Tagged operator test { typedef typename Kokkos::MDRangePolicy< ExecSpace, Kokkos::Rank<6, Iterate::Default, Iterate::Default >, Kokkos::IndexType<int>, InitTag > range_type; diff --git a/packages/kokkos/core/unit_test/TestMDRange_a.hpp b/packages/kokkos/core/unit_test/TestMDRange_a.hpp index 5de5225eb84612fc7fb35c0862e7c7207b0fcfca..308b3a3029bb7ea7822dc37806f080a113cf04c1 100644 --- a/packages/kokkos/core/unit_test/TestMDRange_a.hpp +++ b/packages/kokkos/core/unit_test/TestMDRange_a.hpp @@ -44,8 +44,12 @@ #include<TestMDRange.hpp> namespace Test { + TEST_F( TEST_CATEGORY , mdrange_5d ) { +#if !defined ( KOKKOS_ENABLE_ROCM ) // MDRange Reduce explicitly handled in its own cpp file TestMDRange_5D< TEST_EXECSPACE >::test_reduce5( 100, 10, 10, 10, 5 ); +#endif TestMDRange_5D< TEST_EXECSPACE >::test_for5( 100, 10, 10, 10, 5 ); } + } diff --git a/packages/kokkos/core/unit_test/TestMDRange_b.hpp b/packages/kokkos/core/unit_test/TestMDRange_b.hpp index 60ece56aab35ba5d29c5f5a23be4f578fe44d37c..e714f18395c9d2342a7acf3799164b5ae276ab1e 100644 --- a/packages/kokkos/core/unit_test/TestMDRange_b.hpp +++ b/packages/kokkos/core/unit_test/TestMDRange_b.hpp @@ -45,10 +45,11 @@ namespace Test { - TEST_F( TEST_CATEGORY , mdrange_6d ) { TestMDRange_6D< TEST_EXECSPACE >::test_for6( 10, 10, 10, 10, 5, 5 ); +#if !defined( KOKKOS_ENABLE_ROCM ) // MDRange Reduce explicitly handled in its own cpp file TestMDRange_6D< TEST_EXECSPACE >::test_reduce6( 100, 10, 10, 10, 5, 5 ); +#endif } } diff --git a/packages/kokkos/core/unit_test/TestMDRange_c.hpp b/packages/kokkos/core/unit_test/TestMDRange_c.hpp index 029b1e2b1ccd07b4ec0a4de8fc9b1bf52ef42e87..810e1d82bc4b29bed9974ef23912292ed37f0d87 100644 --- a/packages/kokkos/core/unit_test/TestMDRange_c.hpp +++ b/packages/kokkos/core/unit_test/TestMDRange_c.hpp @@ -46,8 +46,10 @@ namespace Test { TEST_F( TEST_CATEGORY , mdrange_2d) { - TestMDRange_2D< TEST_EXECSPACE >::test_for2( 100, 100 ); +#if !defined( KOKKOS_ENABLE_ROCM ) // MDRange Reduce explicitly handled in its own cpp file TestMDRange_2D< TEST_EXECSPACE >::test_reduce2( 100, 100 ); +#endif + TestMDRange_2D< TEST_EXECSPACE >::test_for2( 100, 100 ); } TEST_F( TEST_CATEGORY , mdrange_array_reduce ) { diff --git a/packages/kokkos/core/unit_test/TestMDRange_d.hpp b/packages/kokkos/core/unit_test/TestMDRange_d.hpp index 240df9aec02a932eb0a92be82bd197743e55ebc6..1a477a228fbbe31771e0fd495a7c65d79bab6296 100644 --- a/packages/kokkos/core/unit_test/TestMDRange_d.hpp +++ b/packages/kokkos/core/unit_test/TestMDRange_d.hpp @@ -44,9 +44,12 @@ #include<TestMDRange.hpp> namespace Test { + TEST_F( TEST_CATEGORY , mdrange_3d) { TestMDRange_3D< TEST_EXECSPACE >::test_for3( 100, 10, 100 ); +#if !defined( KOKKOS_ENABLE_ROCM ) // MDRange Reduced explicitly handled in its own cpp file TestMDRange_3D< TEST_EXECSPACE >::test_reduce3( 100, 10, 100 ); +#endif } TEST_F( TEST_CATEGORY , mdrange_neg_idx ) { @@ -56,4 +59,5 @@ TEST_F( TEST_CATEGORY , mdrange_neg_idx ) { TestMDRange_5D_NegIdx< TEST_EXECSPACE >::test_5D_negidx( 128, 32, 8, 8, 4 ); TestMDRange_6D_NegIdx< TEST_EXECSPACE >::test_6D_negidx( 128, 32, 8, 8, 4, 2 ); } + } diff --git a/packages/kokkos/core/unit_test/TestMDRange_e.hpp b/packages/kokkos/core/unit_test/TestMDRange_e.hpp index 8162184c9bccfeff9dad32e193a4ed1c6e25fce0..a6267253528d4c94342203072dc29f8baabe0380 100644 --- a/packages/kokkos/core/unit_test/TestMDRange_e.hpp +++ b/packages/kokkos/core/unit_test/TestMDRange_e.hpp @@ -44,8 +44,12 @@ #include<TestMDRange.hpp> namespace Test { + TEST_F( TEST_CATEGORY , mdrange_4d ) { +#if !defined( KOKKOS_ENABLE_ROCM ) // MDRange Reduce explicitly handled in its own cpp file TestMDRange_4D< TEST_EXECSPACE >::test_reduce4( 100, 10, 10, 10 ); +#endif TestMDRange_4D< TEST_EXECSPACE >::test_for4( 100, 10, 10, 10 ); } + } diff --git a/packages/kokkos/core/unit_test/TestMemoryPool.hpp b/packages/kokkos/core/unit_test/TestMemoryPool.hpp index 9fb1d900f7580a384ab16754a1b13316ef94cf4f..00079e02eee9073677aaaafb05dd015288dc80a5 100644 --- a/packages/kokkos/core/unit_test/TestMemoryPool.hpp +++ b/packages/kokkos/core/unit_test/TestMemoryPool.hpp @@ -626,7 +626,9 @@ TEST_F( TEST_CATEGORY, memory_pool ) TestMemoryPool::test_host_memory_pool_stats<>(); TestMemoryPool::test_memory_pool_v2< TEST_EXECSPACE >(false,false); TestMemoryPool::test_memory_pool_corners< TEST_EXECSPACE >(false,false); +#ifdef KOKKOS_ENABLE_LARGE_MEM_TESTS TestMemoryPool::test_memory_pool_huge< TEST_EXECSPACE >(); +#endif } } diff --git a/packages/kokkos/core/unit_test/TestReduce.hpp b/packages/kokkos/core/unit_test/TestReduce.hpp index 5748df1f174363373473ebc551dbffe0874dbd61..924d8eb45f0f588fda657b4e90c2a4a738ac89c5 100644 --- a/packages/kokkos/core/unit_test/TestReduce.hpp +++ b/packages/kokkos/core/unit_test/TestReduce.hpp @@ -63,9 +63,11 @@ public: const size_type nwork; + KOKKOS_INLINE_FUNCTION ReduceFunctor( const size_type & arg_nwork ) : nwork( arg_nwork ) {} + KOKKOS_INLINE_FUNCTION ReduceFunctor( const ReduceFunctor & rhs ) : nwork( rhs.nwork ) {} @@ -102,6 +104,7 @@ class ReduceFunctorFinal : public ReduceFunctor< long, DeviceType > { public: typedef typename ReduceFunctor< long, DeviceType >::value_type value_type; + KOKKOS_INLINE_FUNCTION ReduceFunctorFinal( const size_t n ) : ReduceFunctor< long, DeviceType >( n ) {} diff --git a/packages/kokkos/core/unit_test/TestReduceDeviceView.hpp b/packages/kokkos/core/unit_test/TestReduceDeviceView.hpp new file mode 100644 index 0000000000000000000000000000000000000000..4f65166e373ce90e1c6d4e523b61a97215824291 --- /dev/null +++ b/packages/kokkos/core/unit_test/TestReduceDeviceView.hpp @@ -0,0 +1,131 @@ +#include<Kokkos_Core.hpp> + +namespace Test { +namespace { + +struct TestIsAsynchFunctor { + Kokkos::View<double,TEST_EXECSPACE> atomic_test; + TestIsAsynchFunctor(Kokkos::View<double,TEST_EXECSPACE> atomic_test_):atomic_test(atomic_test_){} + + KOKKOS_INLINE_FUNCTION + void operator()(const int) const { + Kokkos::atomic_add(&atomic_test(),1.0); + } +}; + +template<class PolicyType, class ReduceFunctor> +void test_reduce_device_view(int64_t N, PolicyType policy, ReduceFunctor functor) { + + using ExecSpace = TEST_EXECSPACE; + + Kokkos::View<int64_t,TEST_EXECSPACE> result("Result"); + Kokkos::View<double,TEST_EXECSPACE> atomic_test("Atomic"); + int64_t reducer_result, view_result, scalar_result; + + + Kokkos::Timer timer; + + // Establish whether execspace is asynchronous + Kokkos::parallel_for("Test::ReduceDeviceView::TestIsAsynch",Kokkos::RangePolicy<TEST_EXECSPACE>(0,1000000), + TestIsAsynchFunctor(atomic_test)); + double time0 = timer.seconds(); + timer.reset(); + ExecSpace::execution_space::fence(); + double time_fence0 = timer.seconds(); + Kokkos::deep_copy(result,0); + timer.reset(); + bool is_async = time0<time_fence0; + + // Test Reducer + + Kokkos::parallel_reduce("Test::ReduceDeviceView::TestReducer",policy, functor, Kokkos::Sum<int64_t,TEST_EXECSPACE>(result)); + double time1 = timer.seconds(); + // Check whether it was asyncronous + timer.reset(); + ExecSpace::execution_space::fence(); + double time_fence1 = timer.seconds(); + Kokkos::deep_copy(reducer_result,result); + Kokkos::deep_copy(result,0); + ASSERT_EQ(N,reducer_result); + timer.reset(); + + + // Test View + Kokkos::parallel_reduce("Test::ReduceDeviceView::TestView",policy, functor, result); + double time2 = timer.seconds(); + // Check whether it was asyncronous + timer.reset(); + ExecSpace::execution_space::fence(); + double time_fence2 = timer.seconds(); + Kokkos::deep_copy(view_result,result); + Kokkos::deep_copy(result,0); + ASSERT_EQ(N,view_result); + timer.reset(); + + + // Test Scalar + Kokkos::parallel_reduce("Test::ReduceDeviceView::TestScalar",policy, functor, scalar_result); + double time3 = timer.seconds(); + + // Check whether it was asyncronous + timer.reset(); + ExecSpace::execution_space::fence(); + double time_fence3 = timer.seconds(); + + ASSERT_EQ(N,scalar_result); + if(is_async) { + ASSERT_TRUE(time1<time_fence1); + } + if(is_async) { + ASSERT_TRUE(time2<time_fence2); + ASSERT_TRUE(time3>time_fence3); + } + } + +struct RangePolicyFunctor { + KOKKOS_INLINE_FUNCTION + void operator() (const int, int64_t& lsum) const { + lsum += 1; + } +}; + +struct MDRangePolicyFunctor { + KOKKOS_INLINE_FUNCTION + void operator() (const int, const int, const int, int64_t& lsum) const { + lsum += 1; + } +}; + +struct TeamPolicyFunctor { + int M; + TeamPolicyFunctor(int M_):M(M_){} + + KOKKOS_INLINE_FUNCTION + void operator() (const Kokkos::TeamPolicy<TEST_EXECSPACE>::member_type& team, int64_t& lsum) const { + for(int i=team.team_rank(); i<M; i+=team.team_size()) + lsum += 1; + } +}; + +} // namespace + +TEST_F( TEST_CATEGORY, reduce_device_view_range_policy ) +{ + int N=1000*1024*1024; + test_reduce_device_view(N,Kokkos::RangePolicy<TEST_EXECSPACE>(0,N),RangePolicyFunctor()); +} + +TEST_F( TEST_CATEGORY, reduce_device_view_mdrange_policy ) +{ + int N=1000*1024*1024; + test_reduce_device_view(N,Kokkos::MDRangePolicy<TEST_EXECSPACE,Kokkos::Rank<3>>({0,0,0},{1000,1024,1024}),MDRangePolicyFunctor()); +} + +TEST_F( TEST_CATEGORY, reduce_device_view_team_policy ) +{ + int N=1000*1024*1024; + test_reduce_device_view(N,Kokkos::TeamPolicy<TEST_EXECSPACE>(1000*1024,Kokkos::AUTO),TeamPolicyFunctor(1024)); +} + +} // namespace Test + diff --git a/packages/kokkos/core/unit_test/TestReducers.hpp b/packages/kokkos/core/unit_test/TestReducers.hpp index 519e3a80f7098797a85024a10163bfa29d493335..7270ea33754efc8259ad610f37c64b3e3ef67480 100644 --- a/packages/kokkos/core/unit_test/TestReducers.hpp +++ b/packages/kokkos/core/unit_test/TestReducers.hpp @@ -477,7 +477,7 @@ struct TestReducers { int reference_loc = -1; for ( int i = 0; i < N; i++ ) { - h_values( i ) = (Scalar) ( rand() % 100000 ); + h_values( i ) = (Scalar) ( rand() % 100000 + 2 ); if ( h_values( i ) < reference_min ) { reference_min = h_values( i ); @@ -485,7 +485,7 @@ struct TestReducers { } else if ( h_values( i ) == reference_min ) { // Make min unique. - h_values( i ) += std::numeric_limits< Scalar >::epsilon(); + h_values( i ) += Scalar(1); } } Kokkos::deep_copy( values, h_values ); @@ -537,7 +537,7 @@ struct TestReducers { int reference_loc = -1; for ( int i = 0; i < N; i++ ) { - h_values( i ) = (Scalar) ( rand() % 100000 ); + h_values( i ) = (Scalar) ( rand() % 100000 + 2 ); if ( h_values( i ) > reference_max ) { reference_max = h_values( i ); @@ -545,7 +545,7 @@ struct TestReducers { } else if ( h_values( i ) == reference_max ) { // Make max unique. - h_values( i ) -= std::numeric_limits< Scalar >::epsilon(); + h_values( i ) -= Scalar(1); } } Kokkos::deep_copy( values, h_values ); @@ -599,7 +599,7 @@ struct TestReducers { int reference_maxloc = -1; for ( int i = 0; i < N; i++ ) { - h_values( i ) = (Scalar) ( rand() % 100000 ); + h_values( i ) = (Scalar) ( rand() % 100000 + 2); } for ( int i = 0; i < N; i++ ) { @@ -609,7 +609,7 @@ struct TestReducers { } else if ( h_values( i ) == reference_max ) { // Make max unique. - h_values( i ) -= std::numeric_limits< Scalar >::epsilon(); + h_values( i ) -= Scalar(1); } } @@ -620,7 +620,7 @@ struct TestReducers { } else if ( h_values( i ) == reference_min ) { // Make min unique. - h_values( i ) += std::numeric_limits< Scalar >::epsilon(); + h_values( i ) += Scalar(1); } } diff --git a/packages/kokkos/core/unit_test/TestScan.hpp b/packages/kokkos/core/unit_test/TestScan.hpp index 5700c21dc6695926c736c6a087bcdd318e2df8f7..e021ed09f588dc870ea6c8ef76c832b52b7262f9 100644 --- a/packages/kokkos/core/unit_test/TestScan.hpp +++ b/packages/kokkos/core/unit_test/TestScan.hpp @@ -69,9 +69,9 @@ struct TestScan { const value_type answer = n & 1 ? ( n * ( ( n + 1 ) / 2 ) ) : ( ( n / 2 ) * ( n + 1 ) ); if ( answer != update ) { - errors()++; + int fail = errors()++; - if ( errors() < 20 ) { + if ( fail < 20 ) { printf( "TestScan(%d,%ld) != %ld\n", iwork, update, answer ); } } @@ -97,6 +97,7 @@ struct TestScan { long long int total = 0; Kokkos::parallel_scan( N, *this, total ); run_check( size_t( ( N+1 )*N/2 ), size_t( total ) ); + check_error(); } TestScan( const WorkSpec & Start , const WorkSpec & N ) @@ -108,6 +109,13 @@ struct TestScan { errors = errors_a; Kokkos::parallel_scan( exec_policy( Start , N ) , *this ); + check_error(); + } + + void check_error() { + int total_errors; + Kokkos::deep_copy(total_errors, errors); + ASSERT_EQ(total_errors,0); } static void test_range( const WorkSpec & begin, const WorkSpec & end ) diff --git a/packages/kokkos/core/unit_test/TestTeam.hpp b/packages/kokkos/core/unit_test/TestTeam.hpp index 2fe615a75a2fc149ab04c5f2e606e6a3e109b959..487a4d581c9ab6c399a670da11d4df734a5c5e76 100644 --- a/packages/kokkos/core/unit_test/TestTeam.hpp +++ b/packages/kokkos/core/unit_test/TestTeam.hpp @@ -61,7 +61,7 @@ struct TestTeamPolicy { TestTeamPolicy( const size_t league_size ) : m_flags( Kokkos::ViewAllocateWithoutInitializing( "flags" ), - Kokkos::TeamPolicy< ScheduleType, ExecSpace >::team_size_max( *this ), + Kokkos::TeamPolicy< ScheduleType, ExecSpace >(1,1).team_size_max( *this, Kokkos::ParallelReduceTag() ), league_size ) {} struct VerifyInitTag {}; @@ -113,11 +113,14 @@ struct TestTeamPolicy { static void test_for( const size_t league_size ) { TestTeamPolicy functor( league_size ); + typedef Kokkos::TeamPolicy< ScheduleType, ExecSpace > policy_type; + typedef Kokkos::TeamPolicy< ScheduleType, ExecSpace, VerifyInitTag > policy_type_init; - const int team_size = Kokkos::TeamPolicy< ScheduleType, ExecSpace >::team_size_max( functor ); + const int team_size = policy_type(league_size,1).team_size_max( functor, Kokkos::ParallelForTag() ); + const int team_size_init = policy_type_init(league_size,1).team_size_max( functor, Kokkos::ParallelForTag() ); - Kokkos::parallel_for( Kokkos::TeamPolicy< ScheduleType, ExecSpace >( league_size, team_size ), functor ); - Kokkos::parallel_for( Kokkos::TeamPolicy< ScheduleType, ExecSpace, VerifyInitTag >( league_size, team_size ), functor ); + Kokkos::parallel_for( policy_type( league_size, team_size ), functor ); + Kokkos::parallel_for( policy_type_init( league_size, team_size_init ), functor ); test_small_league_size(); } @@ -142,15 +145,19 @@ struct TestTeamPolicy { { TestTeamPolicy functor( league_size ); - const int team_size = Kokkos::TeamPolicy< ScheduleType, ExecSpace >::team_size_max( functor ); + typedef Kokkos::TeamPolicy< ScheduleType, ExecSpace > policy_type; + typedef Kokkos::TeamPolicy< ScheduleType, ExecSpace, ReduceTag > policy_type_reduce; + + const int team_size = policy_type_reduce(league_size,1).team_size_max( functor, Kokkos::ParallelReduceTag() ); + const long N = team_size * league_size; long total = 0; - Kokkos::parallel_reduce( Kokkos::TeamPolicy< ScheduleType, ExecSpace >( league_size, team_size ), functor, total ); + Kokkos::parallel_reduce( policy_type( league_size, team_size ), functor, total ); ASSERT_EQ( size_t( ( N - 1 ) * ( N ) ) / 2, size_t( total ) ); - Kokkos::parallel_reduce( Kokkos::TeamPolicy< ScheduleType, ExecSpace, ReduceTag >( league_size, team_size ), functor, total ); + Kokkos::parallel_reduce( policy_type_reduce( league_size, team_size ), functor, total ); ASSERT_EQ( ( size_t( N ) * size_t( N + 1 ) ) / 2, size_t( total ) ); } }; @@ -177,8 +184,10 @@ public: const size_type nwork; + KOKKOS_INLINE_FUNCTION ReduceTeamFunctor( const size_type & arg_nwork ) : nwork( arg_nwork ) {} + KOKKOS_INLINE_FUNCTION ReduceTeamFunctor( const ReduceTeamFunctor & rhs ) : nwork( rhs.nwork ) {} KOKKOS_INLINE_FUNCTION @@ -244,10 +253,12 @@ public: const unsigned long nsum = nw % 2 ? nw * ( ( nw + 1 ) / 2 ) : ( nw / 2 ) * ( nw + 1 ); - const unsigned team_size = policy_type::team_size_recommended( functor_type( nwork ) ); + policy_type team_exec( nw, 1 ); + + const unsigned team_size = team_exec.team_size_recommended( functor_type( nwork ), Kokkos::ParallelReduceTag() ); const unsigned league_size = ( nwork + team_size - 1 ) / team_size; - policy_type team_exec( league_size, team_size ); + team_exec = policy_type( league_size, team_size ); for ( unsigned i = 0; i < Repeat; ++i ) { result_type tmp( & result[i] ); @@ -370,7 +381,8 @@ public: functor_type functor; - policy_type team_exec( nteam, policy_type::team_size_max( functor ) ); + policy_type team_exec( nteam, 1); + team_exec = policy_type(nteam, team_exec.team_size_max(functor, Kokkos::ParallelReduceTag())); for ( unsigned i = 0; i < Repeat; ++i ) { long int accum = 0; @@ -475,7 +487,8 @@ struct TestSharedTeam { typedef Test::SharedTeamFunctor<ExecSpace, ScheduleType> Functor; typedef Kokkos::View< typename Functor::value_type, Kokkos::HostSpace, Kokkos::MemoryUnmanaged > result_type; - const size_t team_size = Kokkos::TeamPolicy< ScheduleType, ExecSpace >::team_size_max( Functor() ); + const size_t team_size = Kokkos::TeamPolicy< ScheduleType, ExecSpace >(8192, 1).team_size_max( Functor(), + Kokkos::ParallelReduceTag() ); Kokkos::TeamPolicy< ScheduleType, ExecSpace > team_exec( 8192 / team_size, team_size ); @@ -648,16 +661,20 @@ struct TestScratchTeam { typedef Kokkos::View< typename Functor::value_type, Kokkos::HostSpace, Kokkos::MemoryUnmanaged > result_type; typedef Kokkos::TeamPolicy< ScheduleType, ExecSpace > p_type; - const size_t team_size = p_type::team_size_max( Functor() ); - - p_type team_exec( 8192 / team_size, team_size ); typename Functor::value_type error_count = 0; + int thread_scratch_size = Functor::shared_int_array_type::shmem_size( Functor::SHARED_THREAD_COUNT ); + + p_type team_exec = p_type(8192,1).set_scratch_size( 1, Kokkos::PerTeam( Functor::shared_int_array_type::shmem_size( Functor::SHARED_TEAM_COUNT ) ), + Kokkos::PerThread( thread_scratch_size + 3*sizeof(int))); + + const size_t team_size = team_exec.team_size_max( Functor(), Kokkos::ParallelReduceTag() ); + int team_scratch_size = Functor::shared_int_array_type::shmem_size( Functor::SHARED_TEAM_COUNT ) + Functor::shared_int_array_type::shmem_size( 3 * team_size ); - int thread_scratch_size = Functor::shared_int_array_type::shmem_size( Functor::SHARED_THREAD_COUNT ); + team_exec = p_type(8192 / team_size, team_size ); Kokkos::parallel_reduce( team_exec.set_scratch_size( 1, Kokkos::PerTeam( team_scratch_size ), Kokkos::PerThread( thread_scratch_size ) ), @@ -956,7 +973,7 @@ struct TestShmemSize { size_t size = view_type::shmem_size( d1, d2, d3 ); - ASSERT_EQ( size, d1 * d2 * d3 * sizeof( long ) ); + ASSERT_EQ( size, (d1 * d2 * d3 + 1)* sizeof( long ) ); test_layout_stride(); } @@ -973,3 +990,123 @@ struct TestShmemSize { }; } // namespace Test + +/*--------------------------------------------------------------------------*/ + +namespace Test { + +namespace { + +template< class ExecSpace, class ScheduleType > +struct TestTeamBroadcast { + typedef typename Kokkos::TeamPolicy< ScheduleType, ExecSpace >::member_type team_member; + + TestTeamBroadcast( const size_t league_size ) {} + + struct BroadcastTag {}; + + typedef long value_type; + + KOKKOS_INLINE_FUNCTION + void operator()( const team_member &teamMember, value_type &update ) const + { + int lid = teamMember.league_rank(); + int tid = teamMember.team_rank(); + int ts = teamMember.team_size(); + + value_type parUpdate = 0; + value_type value = tid * 3 + 1; + + teamMember.team_broadcast(value, lid%ts); + + Kokkos::parallel_reduce( Kokkos::TeamThreadRange( teamMember, ts ), [&] ( const int j, value_type &teamUpdate ) { + teamUpdate += value; + }, parUpdate ); + + if ( teamMember.team_rank() == 0 ) update += parUpdate; + } + + KOKKOS_INLINE_FUNCTION + void operator()( const BroadcastTag &, const team_member &teamMember, value_type &update ) const + { + int lid = teamMember.league_rank(); + int tid = teamMember.team_rank(); + int ts = teamMember.team_size(); + + value_type parUpdate = 0; + value_type value = tid * 3 + 1; + + teamMember.team_broadcast([&] (value_type & var) { var*=2; }, value, lid%ts); + + Kokkos::parallel_reduce( Kokkos::TeamThreadRange( teamMember, ts ), [&] ( const int j, value_type &teamUpdate ) { + teamUpdate += value; + }, parUpdate ); + + if ( teamMember.team_rank() == 0 ) update += parUpdate; + } + + static void test_teambroadcast( const size_t league_size ) + { + TestTeamBroadcast functor( league_size ); + + typedef Kokkos::TeamPolicy< ScheduleType, ExecSpace > policy_type; + typedef Kokkos::TeamPolicy< ScheduleType, ExecSpace, BroadcastTag > policy_type_f; + + const int team_size = policy_type_f(league_size,1).team_size_max( functor, Kokkos::ParallelReduceTag() ); //printf("team_size=%d\n",team_size); + + //team_broadcast with value + long total = 0; + + Kokkos::parallel_reduce( policy_type( league_size, team_size ), functor, total ); + + value_type expected_result = 0; + for (unsigned int i=0; i<league_size; i++){ + value_type val = ((i%team_size)*3+1)*team_size; + expected_result+= val; + } + ASSERT_EQ( size_t( expected_result ), size_t( total ) ); //printf("team_broadcast with value -- expected_result=%d, total=%d\n",expected_result, total); + + //team_broadcast with funtion object + total = 0; + + Kokkos::parallel_reduce( policy_type_f( league_size, team_size ), functor, total ); + + expected_result = 0; + for (unsigned int i=0; i<league_size; i++){ + value_type val = ((i%team_size)*3+1)*2*team_size; + expected_result+= val; + } + ASSERT_EQ( size_t( expected_result ), size_t( total ) ); //printf("team_broadcast with funtion object -- expected_result=%d, total=%d\n",expected_result, total); + } +}; + +template<class ExecSpace> +struct TestScratchAlignment { + struct TestScalar { + double x,y,z; + }; + TestScratchAlignment() { + test(true); + test(false); + } + typedef Kokkos::View<TestScalar*,typename ExecSpace::scratch_memory_space> ScratchView; + typedef Kokkos::View<int*,typename ExecSpace::scratch_memory_space> ScratchViewInt; + void test(bool allocate_small) { + int shmem_size = ScratchView::shmem_size(11); + if(allocate_small) shmem_size += ScratchViewInt::shmem_size(1); + Kokkos::parallel_for(Kokkos::TeamPolicy<ExecSpace>(1,1).set_scratch_size(0,Kokkos::PerTeam(shmem_size)), + KOKKOS_LAMBDA (const typename Kokkos::TeamPolicy<ExecSpace>::member_type& team) { + if(allocate_small) ScratchViewInt p(team.team_scratch(0),1); + ScratchView a(team.team_scratch(0),11); + if(ptrdiff_t(a.data())%sizeof(TestScalar)!=0) + Kokkos::abort("Error: invalid scratch view alignment\n"); + }); + Kokkos::fence(); + } +}; + +} // namespace + +} // namespace Test + +/*--------------------------------------------------------------------------*/ diff --git a/packages/kokkos/core/unit_test/TestTeamTeamSize.hpp b/packages/kokkos/core/unit_test/TestTeamTeamSize.hpp new file mode 100644 index 0000000000000000000000000000000000000000..f9d5add5d089a0f76f7e5150361b2a9747cb2263 --- /dev/null +++ b/packages/kokkos/core/unit_test/TestTeamTeamSize.hpp @@ -0,0 +1,146 @@ +/* +//@HEADER +// ************************************************************************ +// +// Kokkos v. 2.0 +// Copyright (2014) Sandia Corporation +// +// Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, +// the U.S. Government retains certain rights in this software. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// +// 3. Neither the name of the Corporation nor the names of the +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY +// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE +// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) +// +// ************************************************************************ +//@HEADER +*/ + +#include <cstdio> +#include <stdexcept> +#include <sstream> +#include <iostream> + +#include <Kokkos_Core.hpp> + +namespace Test { + +namespace { + template<class T,int N> + class MyArray { + public: + T values[N]; + KOKKOS_INLINE_FUNCTION + void operator+= (const MyArray& src) { for(int i=0; i<N; i++) values[i] += src.values[i]; } + KOKKOS_INLINE_FUNCTION + void operator= (const MyArray& src) { for(int i=0; i<N; i++) values[i] = src.values[i]; } + KOKKOS_INLINE_FUNCTION + void operator+= (const volatile MyArray& src) volatile { for(int i=0; i<N; i++) values[i] += src.values[i]; } + KOKKOS_INLINE_FUNCTION + void operator= (const volatile MyArray& src) volatile { for(int i=0; i<N; i++) values[i] = src.values[i]; } + }; + + template<class T,int N, class PolicyType, int S> + struct FunctorFor { + double static_array[S]; + KOKKOS_INLINE_FUNCTION + void operator() (const typename PolicyType::member_type& team) const { + } + }; + template<class T,int N, class PolicyType, int S> + struct FunctorReduce { + double static_array[S]; + KOKKOS_INLINE_FUNCTION + void operator() (const typename PolicyType::member_type& team, MyArray<T,N>& lval) const { + for(int j=0; j<N; j++) + lval.values[j] += 1 + lval.values[0]; + } + }; +} + + +typedef Kokkos::TeamPolicy<TEST_EXECSPACE> policy_type; +typedef Kokkos::TeamPolicy<TEST_EXECSPACE, Kokkos::LaunchBounds<128,8> > policy_type_128_8; +typedef Kokkos::TeamPolicy<TEST_EXECSPACE, Kokkos::LaunchBounds<1024,2> > policy_type_1024_2; + +template<class T, int N, class PolicyType, int S> +void test_team_policy_max_recommended_static_size(int scratch_size) { + PolicyType p = PolicyType(10000, Kokkos::AUTO, 4).set_scratch_size(0,Kokkos::PerTeam(scratch_size)); + int team_size_max_for = p.team_size_max(FunctorFor<T,N,PolicyType,S>(),Kokkos::ParallelForTag()); + int team_size_rec_for = p.team_size_recommended(FunctorFor<T,N,PolicyType,S>(),Kokkos::ParallelForTag()); + int team_size_max_reduce = p.team_size_max(FunctorReduce<T,N,PolicyType,S>(),Kokkos::ParallelReduceTag()); + int team_size_rec_reduce = p.team_size_recommended(FunctorReduce<T,N,PolicyType,S>(),Kokkos::ParallelReduceTag()); + + ASSERT_TRUE( team_size_max_for >= team_size_rec_for ); + ASSERT_TRUE( team_size_max_reduce >= team_size_rec_reduce ); + ASSERT_TRUE( team_size_max_for >= team_size_max_reduce ); + + Kokkos::parallel_for(PolicyType(10000, team_size_max_for, 4).set_scratch_size(0,Kokkos::PerTeam(scratch_size)), + FunctorFor<T,N,PolicyType,S>()); + Kokkos::parallel_for(PolicyType(10000, team_size_rec_for, 4).set_scratch_size(0,Kokkos::PerTeam(scratch_size)), + FunctorFor<T,N,PolicyType,S>()); + MyArray<T,N> val; + Kokkos::parallel_reduce(PolicyType(10000, team_size_max_reduce, 4).set_scratch_size(0,Kokkos::PerTeam(scratch_size)), + FunctorReduce<T,N,PolicyType,S>(),val); + Kokkos::parallel_reduce(PolicyType(10000, team_size_rec_reduce, 4).set_scratch_size(0,Kokkos::PerTeam(scratch_size)), + FunctorReduce<T,N,PolicyType,S>(),val); + Kokkos::fence(); +} + +template<class T, int N, class PolicyType> +void test_team_policy_max_recommended(int scratch_size) { + test_team_policy_max_recommended_static_size<T,N,PolicyType,1>(scratch_size); + test_team_policy_max_recommended_static_size<T,N,PolicyType,1000>(scratch_size); +} + +TEST_F( TEST_CATEGORY, team_policy_max_recommended ) +{ + int max_scratch_size = policy_type::scratch_size_max(0); + test_team_policy_max_recommended<double,2,policy_type>(0); + test_team_policy_max_recommended<double,2,policy_type>(max_scratch_size/3); + test_team_policy_max_recommended<double,2,policy_type>(max_scratch_size); + test_team_policy_max_recommended<double,2,policy_type_128_8>(0); + test_team_policy_max_recommended<double,2,policy_type_128_8>(max_scratch_size/3/8); + test_team_policy_max_recommended<double,2,policy_type_128_8>(max_scratch_size/8); + test_team_policy_max_recommended<double,2,policy_type_1024_2>(0); + test_team_policy_max_recommended<double,2,policy_type_1024_2>(max_scratch_size/3/2); + test_team_policy_max_recommended<double,2,policy_type_1024_2>(max_scratch_size/2); + + test_team_policy_max_recommended<double,16,policy_type>(0); + test_team_policy_max_recommended<double,16,policy_type>(max_scratch_size/3); + test_team_policy_max_recommended<double,16,policy_type>(max_scratch_size); + test_team_policy_max_recommended<double,16,policy_type_128_8>(0); + test_team_policy_max_recommended<double,16,policy_type_128_8>(max_scratch_size/3/8); + test_team_policy_max_recommended<double,16,policy_type_128_8>(max_scratch_size/8); + test_team_policy_max_recommended<double,16,policy_type_1024_2>(0); + test_team_policy_max_recommended<double,16,policy_type_1024_2>(max_scratch_size/3/2); + test_team_policy_max_recommended<double,16,policy_type_1024_2>(max_scratch_size/2); +} + + +} // namespace Test diff --git a/packages/kokkos/core/unit_test/TestTeamVector.hpp b/packages/kokkos/core/unit_test/TestTeamVector.hpp index 783fde600b8d3fdd1a267b3e1c8af1bcee88df63..294247a78df654b4f042d1e7aae48e7598797141 100644 --- a/packages/kokkos/core/unit_test/TestTeamVector.hpp +++ b/packages/kokkos/core/unit_test/TestTeamVector.hpp @@ -227,14 +227,13 @@ struct functor_team_for { functor_team_for( Kokkos::View< int, Kokkos::LayoutLeft, ExecutionSpace > flag_ ) : flag( flag_ ) {} - unsigned team_shmem_size( int team_size ) const { return team_size * 13 * sizeof( Scalar ) + 8; } + typedef typename ExecutionSpace::scratch_memory_space shmem_space; + typedef Kokkos::View< Scalar*, shmem_space, Kokkos::MemoryUnmanaged > shared_int; + unsigned team_shmem_size( int team_size ) const { return shared_int::shmem_size(team_size*13); } KOKKOS_INLINE_FUNCTION void operator()( typename policy_type::member_type team ) const { - typedef typename ExecutionSpace::scratch_memory_space shmem_space; - typedef Kokkos::View< Scalar*, shmem_space, Kokkos::MemoryUnmanaged > shared_int; - typedef typename shared_int::size_type size_type; - + typedef typename shmem_space::size_type size_type; const size_type shmemSize = team.team_size() * 13; shared_int values = shared_int( team.team_shmem(), shmemSize ); @@ -290,7 +289,9 @@ struct functor_team_reduce { functor_team_reduce( Kokkos::View< int, Kokkos::LayoutLeft, ExecutionSpace > flag_ ) : flag( flag_ ) {} - unsigned team_shmem_size( int team_size ) const { return team_size * 13 * sizeof( Scalar ) + 8; } + typedef typename ExecutionSpace::scratch_memory_space shmem_space; + typedef Kokkos::View< Scalar*, shmem_space, Kokkos::MemoryUnmanaged > shared_int; + unsigned team_shmem_size( int team_size ) const { return shared_int::shmem_size(team_size*13); } KOKKOS_INLINE_FUNCTION void operator()( typename policy_type::member_type team ) const { @@ -333,7 +334,9 @@ struct functor_team_reduce_reducer { functor_team_reduce_reducer( Kokkos::View< int, Kokkos::LayoutLeft, ExecutionSpace > flag_ ) : flag( flag_ ) {} - unsigned team_shmem_size( int team_size ) const { return team_size * 13 * sizeof( Scalar ) + 8; } + typedef typename ExecutionSpace::scratch_memory_space shmem_space; + typedef Kokkos::View< Scalar*, shmem_space, Kokkos::MemoryUnmanaged > shared_int; + unsigned team_shmem_size( int team_size ) const { return shared_int::shmem_size(team_size*13); } KOKKOS_INLINE_FUNCTION void operator()( typename policy_type::member_type team ) const { @@ -376,12 +379,12 @@ struct functor_team_vector_for { functor_team_vector_for( Kokkos::View< int, Kokkos::LayoutLeft, ExecutionSpace > flag_ ) : flag( flag_ ) {} - unsigned team_shmem_size( int team_size ) const { return team_size * 13 * sizeof( Scalar ) + 8; } + typedef typename ExecutionSpace::scratch_memory_space shmem_space; + typedef Kokkos::View< Scalar*, shmem_space, Kokkos::MemoryUnmanaged > shared_int; + unsigned team_shmem_size( int team_size ) const { return shared_int::shmem_size(team_size*13); } KOKKOS_INLINE_FUNCTION void operator()( typename policy_type::member_type team ) const { - typedef typename ExecutionSpace::scratch_memory_space shmem_space; - typedef Kokkos::View< Scalar*, shmem_space, Kokkos::MemoryUnmanaged > shared_int; typedef typename shared_int::size_type size_type; const size_type shmemSize = team.team_size() * 13; @@ -442,7 +445,9 @@ struct functor_team_vector_reduce { Kokkos::View< int, Kokkos::LayoutLeft, ExecutionSpace > flag; functor_team_vector_reduce( Kokkos::View< int, Kokkos::LayoutLeft, ExecutionSpace > flag_ ) : flag( flag_ ) {} - unsigned team_shmem_size( int team_size ) const { return team_size * 13 * sizeof( Scalar ) + 8; } + typedef typename ExecutionSpace::scratch_memory_space shmem_space; + typedef Kokkos::View< Scalar*, shmem_space, Kokkos::MemoryUnmanaged > shared_int; + unsigned team_shmem_size( int team_size ) const { return shared_int::shmem_size(team_size*13); } KOKKOS_INLINE_FUNCTION void operator()( typename policy_type::member_type team ) const { @@ -485,7 +490,9 @@ struct functor_team_vector_reduce_reducer { functor_team_vector_reduce_reducer( Kokkos::View< int, Kokkos::LayoutLeft, ExecutionSpace > flag_ ) : flag( flag_ ) {} - unsigned team_shmem_size( int team_size ) const { return team_size * 13 * sizeof( Scalar ) + 8; } + typedef typename ExecutionSpace::scratch_memory_space shmem_space; + typedef Kokkos::View< Scalar*, shmem_space, Kokkos::MemoryUnmanaged > shared_int; + unsigned team_shmem_size( int team_size ) const { return shared_int::shmem_size(team_size*13); } KOKKOS_INLINE_FUNCTION void operator()( typename policy_type::member_type team ) const { @@ -568,12 +575,12 @@ struct functor_vec_for { functor_vec_for( Kokkos::View< int, Kokkos::LayoutLeft, ExecutionSpace > flag_ ) : flag( flag_ ) {} - unsigned team_shmem_size( int team_size ) const { return team_size * 13 * sizeof( Scalar ) + 8; } + typedef typename ExecutionSpace::scratch_memory_space shmem_space; + typedef Kokkos::View< Scalar*, shmem_space, Kokkos::MemoryUnmanaged > shared_int; + unsigned team_shmem_size( int team_size ) const { return shared_int::shmem_size(team_size*13); } KOKKOS_INLINE_FUNCTION void operator()( typename policy_type::member_type team ) const { - typedef typename ExecutionSpace::scratch_memory_space shmem_space; - typedef Kokkos::View< Scalar*, shmem_space, Kokkos::MemoryUnmanaged > shared_int; shared_int values = shared_int( team.team_shmem(), team.team_size() * 13 ); @@ -739,23 +746,16 @@ bool test_scalar( int nteams, int team_size, int test ) { functor_vec_red< Scalar, ExecutionSpace >( d_flag ) ); } else if ( test == 1 ) { - // WORKAROUND ROCM/CUDA + // WORKAROUND CUDA #if defined(KOKKOS_ENABLE_CUDA) #if defined(KOKKOS_IMPL_CUDA_CLANG_WORKAROUND) || defined(KOKKOS_ARCH_PASCAL) if(!std::is_same<ExecutionSpace,Kokkos::Cuda>::value) #endif #endif - #if defined(KOKKOS_ENABLE_ROCM) - if(!std::is_same<ExecutionSpace,Kokkos::Experimental::ROCm>::value) - #endif Kokkos::parallel_for( Kokkos::TeamPolicy< ExecutionSpace >( nteams, team_size, 8 ), functor_vec_red_reducer< Scalar, ExecutionSpace >( d_flag ) ); } else if ( test == 2 ) { - // WORKAROUND ROCM - #if defined(KOKKOS_ENABLE_ROCM) - if(!std::is_same<ExecutionSpace,Kokkos::Experimental::ROCm>::value) - #endif Kokkos::parallel_for( Kokkos::TeamPolicy< ExecutionSpace >( nteams, team_size, 8 ), functor_vec_scan< Scalar, ExecutionSpace >( d_flag ) ); } @@ -776,10 +776,6 @@ bool test_scalar( int nteams, int team_size, int test ) { functor_team_reduce< Scalar, ExecutionSpace >( d_flag ) ); } else if ( test == 7 ) { - // WORKAROUND ROCM - #if defined(KOKKOS_ENABLE_ROCM) - if(!std::is_same<ExecutionSpace,Kokkos::Experimental::ROCm>::value) - #endif Kokkos::parallel_for( Kokkos::TeamPolicy< ExecutionSpace >( nteams, team_size ), functor_team_reduce_reducer< Scalar, ExecutionSpace >( d_flag ) ); } @@ -792,10 +788,6 @@ bool test_scalar( int nteams, int team_size, int test ) { functor_team_vector_reduce< Scalar, ExecutionSpace >( d_flag ) ); } else if ( test == 10 ) { - // WORKAROUND ROCM - #if defined(KOKKOS_ENABLE_ROCM) - if(!std::is_same<ExecutionSpace,Kokkos::Experimental::ROCm>::value) - #endif Kokkos::parallel_for( Kokkos::TeamPolicy< ExecutionSpace >( nteams, team_size, 8 ), functor_team_vector_reduce_reducer< Scalar, ExecutionSpace >( d_flag ) ); } @@ -955,28 +947,22 @@ TEST_F( TEST_CATEGORY, triple_nested_parallelism ) // With KOKKOS_DEBUG enabled, the functor uses too many registers to run // with a team size of 32 on GPUs, 16 is the max possible (at least on a K80 GPU) // See https://github.com/kokkos/kokkos/issues/1513 -#if defined(KOKKOS_DEBUG) && defined(KOKKOS_ENABLE_CUDA) +#if defined(KOKKOS_ENABLE_DEBUG) && defined(KOKKOS_ENABLE_CUDA) if (!std::is_same<TEST_EXECSPACE, Kokkos::Cuda>::value) { #endif #ifdef KOKKOS_ENABLE_ROCM // ROCm doesn't support TeamSize 32x32 - if (!std::is_same<TEST_EXECSPACE, Kokkos::Experimental::ROCm>::value) { + if (!std::is_same<TEST_EXECSPACE, Kokkos::Experimental::ROCm>::value) #endif TestTripleNestedReduce< double, TEST_EXECSPACE >( 8192, 2048, 32, 32 ); -#ifdef KOKKOS_ENABLE_ROCM - } -#endif TestTripleNestedReduce< double, TEST_EXECSPACE >( 8192, 2048, 32, 16 ); -#if defined(KOKKOS_DEBUG) && defined(KOKKOS_ENABLE_CUDA) +#if defined(KOKKOS_ENABLE_DEBUG) && defined(KOKKOS_ENABLE_CUDA) } #endif TestTripleNestedReduce< double, TEST_EXECSPACE >( 8192, 2048, 16, 16 ); #ifdef KOKKOS_ENABLE_ROCM // ROCm doesn't support team sizes not powers of two - if (!std::is_same<TEST_EXECSPACE, Kokkos::Experimental::ROCm>::value) { + if (!std::is_same<TEST_EXECSPACE, Kokkos::Experimental::ROCm>::value) #endif TestTripleNestedReduce< double, TEST_EXECSPACE >( 8192, 2048, 7, 16 ); -#ifdef KOKKOS_ENABLE_ROCM - } -#endif } #endif diff --git a/packages/kokkos/core/unit_test/TestViewAPI_a.hpp b/packages/kokkos/core/unit_test/TestViewAPI_a.hpp index efc9ab27b675b890019b674bdcd233c134814ad9..ba74331c51a65cdd5a51017089353e6fa3d9ce2f 100644 --- a/packages/kokkos/core/unit_test/TestViewAPI_a.hpp +++ b/packages/kokkos/core/unit_test/TestViewAPI_a.hpp @@ -45,11 +45,9 @@ namespace Test { -#if !defined(KOKKOS_ENABLE_ROCM) TEST_F( TEST_CATEGORY, view_api_a ) { TestViewAPI< double, TEST_EXECSPACE >::run_test(); } -#endif } diff --git a/packages/kokkos/core/unit_test/TestViewAPI_b.hpp b/packages/kokkos/core/unit_test/TestViewAPI_b.hpp index e006dd9b600e3ee0f6d87acbfd10778c0fe88986..03b41db516512b9cb7359fcc66155ec6e79a1e8a 100644 --- a/packages/kokkos/core/unit_test/TestViewAPI_b.hpp +++ b/packages/kokkos/core/unit_test/TestViewAPI_b.hpp @@ -45,13 +45,11 @@ namespace Test { -#if !defined(KOKKOS_ENABLE_ROCM) TEST_F( TEST_CATEGORY, view_api_b ) { TestViewAPI< double, TEST_EXECSPACE >::run_test_view_operator_a(); TestViewAPI< double, TEST_EXECSPACE >::run_test_mirror(); TestViewAPI< double, TEST_EXECSPACE >::run_test_scalar(); } -#endif } diff --git a/packages/kokkos/core/unit_test/TestViewAPI_c.hpp b/packages/kokkos/core/unit_test/TestViewAPI_c.hpp index a0f03ff1817a043fc420329b10016b9d635c0728..d34ae6340e65750ccd6cd32cef9e3ea06f225cd6 100644 --- a/packages/kokkos/core/unit_test/TestViewAPI_c.hpp +++ b/packages/kokkos/core/unit_test/TestViewAPI_c.hpp @@ -45,12 +45,10 @@ namespace Test { -#if !defined(KOKKOS_ENABLE_ROCM) TEST_F( TEST_CATEGORY, view_api_c ) { TestViewAPI< double, TEST_EXECSPACE >::run_test_deep_copy_empty(); TestViewAPI< double, TEST_EXECSPACE >::run_test_view_operator_b(); } -#endif } diff --git a/packages/kokkos/core/unit_test/TestViewAPI_d.hpp b/packages/kokkos/core/unit_test/TestViewAPI_d.hpp index b984df98b47d2c3a2f185563cbb3338b51c18678..38e10381f296c5f134c3f61c915594dd2f7c5b6f 100644 --- a/packages/kokkos/core/unit_test/TestViewAPI_d.hpp +++ b/packages/kokkos/core/unit_test/TestViewAPI_d.hpp @@ -45,7 +45,6 @@ namespace Test { -#if !defined(KOKKOS_ENABLE_ROCM) TEST_F( TEST_CATEGORY, view_api_d ) { TestViewAPI< double, TEST_EXECSPACE >::run_test_const(); @@ -54,6 +53,5 @@ TEST_F( TEST_CATEGORY, view_api_d ) TestViewAPI< double, TEST_EXECSPACE >::run_test_vector(); TestViewAPI< double, TEST_EXECSPACE >::run_test_view_operator_c(); } -#endif } diff --git a/packages/kokkos/core/unit_test/TestViewCopy.hpp b/packages/kokkos/core/unit_test/TestViewCopy.hpp new file mode 100644 index 0000000000000000000000000000000000000000..7eab9daa11e469ba70207aeb0983664f26360e25 --- /dev/null +++ b/packages/kokkos/core/unit_test/TestViewCopy.hpp @@ -0,0 +1,155 @@ +/* +//@HEADER +// ************************************************************************ +// +// Kokkos v. 2.0 +// Copyright (2014) Sandia Corporation +// +// Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, +// the U.S. Government retains certain rights in this software. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// +// 3. Neither the name of the Corporation nor the names of the +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY +// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE +// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) +// +// ************************************************************************ +//@HEADER +*/ + +#include <cstdio> + +#include <gtest/gtest.h> + +#include <Kokkos_Core.hpp> + +namespace Test { + +namespace { + +template < typename ExecSpace > +struct TestViewCopy { + + using InExecSpace = ExecSpace; + + static void test_view_copy() + { +#if defined( KOKKOS_ENABLE_CUDA ) || defined( KOKKOS_ENABLE_ROCM ) + // ExecSpace = CudaUVM, CudaHostPinned + // This test will fail at runtime with an illegal memory access if something goes wrong + // Test 1: deep_copy from host_mirror_space to ExecSpace and ExecSpace back to host_mirror_space + { + const int dim0 = 4; + const int dim1 = 2; + const int dim2 = 3; + + typedef Kokkos::View<double****,InExecSpace> Rank4ViewType; + Rank4ViewType view_4; + view_4 = Rank4ViewType("view_4", dim0, dim1, dim2, dim2); + + typedef typename Kokkos::Impl::is_space<InExecSpace>::host_mirror_space::execution_space host_space_type; + Kokkos::View<double**,Kokkos::LayoutLeft,host_space_type> srcView("srcView", dim2, dim2); + + // Strided dst view + auto dstView = Kokkos::subview(view_4, 0, 0, Kokkos::ALL(), Kokkos::ALL()); + + // host_mirror_space to ExecSpace + Kokkos::deep_copy( dstView, srcView ); + Kokkos::fence(); + + // ExecSpace to host_mirror_space + Kokkos::deep_copy( srcView, dstView ); + Kokkos::fence(); + } + + // Test 2: deep_copy from Cuda to ExecSpace and ExecSpace back to Cuda + { + const int dim0 = 4; + const int dim1 = 2; + const int dim2 = 3; + + typedef Kokkos::View<double****,InExecSpace> Rank4ViewType; + Rank4ViewType view_4; + view_4 = Rank4ViewType("view_4", dim0, dim1, dim2, dim2); + +#if defined( KOKKOS_ENABLE_CUDA ) + typedef Kokkos::Cuda space_type; +#endif +#if defined( KOKKOS_ENABLE_ROCM ) + typedef Kokkos::Experimental::ROCm space_type; +#endif + Kokkos::View<double**,Kokkos::LayoutLeft,space_type> srcView("srcView", dim2, dim2); + + // Strided dst view + auto dstView = Kokkos::subview(view_4, 0, 0, Kokkos::ALL(), Kokkos::ALL()); + + // Cuda to ExecSpace + Kokkos::deep_copy( dstView, srcView ); + Kokkos::fence(); + + // ExecSpace to Cuda + Kokkos::deep_copy( srcView, dstView ); + Kokkos::fence(); + } + + // Test 3: deep_copy from host_space to ExecSpace and ExecSpace back to host_space + { + const int dim0 = 4; + const int dim1 = 2; + const int dim2 = 3; + + typedef Kokkos::View<double****,InExecSpace> Rank4ViewType; + Rank4ViewType view_4; + view_4 = Rank4ViewType("view_4", dim0, dim1, dim2, dim2); + + typedef Kokkos::HostSpace host_space_type; + Kokkos::View<double**,Kokkos::LayoutLeft,host_space_type> srcView("srcView", dim2, dim2); + + // Strided dst view + auto dstView = Kokkos::subview(view_4, 0, 0, Kokkos::ALL(), Kokkos::ALL()); + + // host_space to ExecSpace + Kokkos::deep_copy( dstView, srcView ); + Kokkos::fence(); + + // ExecSpace to host_space + Kokkos::deep_copy( srcView, dstView ); + Kokkos::fence(); + } +#endif + } // end test_view_copy + +}; // end struct + +} // namespace + +TEST_F( TEST_CATEGORY , view_copy_tests ) { + //Only include this file to be compiled with CudaUVM and CudaHostPinned + TestViewCopy< TEST_EXECSPACE >::test_view_copy(); +} + +} // namespace Test diff --git a/packages/kokkos/core/unit_test/TestViewLayoutStrideAssignment.hpp b/packages/kokkos/core/unit_test/TestViewLayoutStrideAssignment.hpp new file mode 100644 index 0000000000000000000000000000000000000000..3185fa54739e2668a031ca09c232b55d3805f7e6 --- /dev/null +++ b/packages/kokkos/core/unit_test/TestViewLayoutStrideAssignment.hpp @@ -0,0 +1,740 @@ +/* +//@HEADER +// ************************************************************************ +// +// Kokkos v. 2.0 +// Copyright (2014) Sandia Corporation +// +// Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, +// the U.S. Government retains certain rights in this software. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// +// 3. Neither the name of the Corporation nor the names of the +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY +// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE +// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) +// +// ************************************************************************ +//@HEADER +*/ + +#include <gtest/gtest.h> + +#include <stdexcept> +#include <sstream> +#include <iostream> +#include <time.h> + +#include <Kokkos_Core.hpp> + +namespace Test { + +TEST_F( TEST_CATEGORY , view_layoutstride_left_to_layoutleft_assignment ) +{ + typedef TEST_EXECSPACE exec_space ; + + auto t = time(0); + srand(t);// Use current time as seed for random generator + printf("view_layoutstride_left_to_layoutleft_assignment: srand(%lu)\n",size_t(t)); + + { // Assignment of rank-1 LayoutLeft = LayoutStride + int ndims = 1; + int dims [] = {10}; + int order [] = {0}; + Kokkos::LayoutStride layout = Kokkos::LayoutStride::order_dimensions(ndims, order, dims); + Kokkos::View< double*, Kokkos::LayoutStride, exec_space > src("LayoutStride", layout); + + Kokkos::View< double*, Kokkos::LayoutStride, exec_space >::HostMirror h_src = Kokkos::create_mirror_view( src ); + + for(size_t i=0; i<src.span(); i++) h_src.data()[i] = (double)rand() / RAND_MAX * (100); + + Kokkos::deep_copy( src, h_src ); + + Kokkos::View< double*, Kokkos::LayoutLeft, exec_space > dst = src; + + Kokkos::View< double*, Kokkos::LayoutLeft, exec_space >::HostMirror h_dst = Kokkos::create_mirror_view( dst ); + + Kokkos::deep_copy( h_dst, dst ); + + bool test = true; + for(size_t i=0; i<src.span();i++){ + if (h_src.data()[i]!=h_dst.data()[i]) {test = false;break;} + } + ASSERT_EQ( dst.span(), src.span() ); + ASSERT_EQ( test, true ); + } + { // Assignment of rank-2 LayoutLeft = LayoutStride + int ndims = 2; + int dims [] = {10,9}; + int order [] = {0,1}; + Kokkos::LayoutStride layout = Kokkos::LayoutStride::order_dimensions(ndims, order, dims); + Kokkos::View< double**, Kokkos::LayoutStride, exec_space > src("LayoutStride", layout); + + Kokkos::View< double**, Kokkos::LayoutStride, exec_space >::HostMirror h_src = Kokkos::create_mirror_view( src ); + + for(size_t i=0; i<src.span(); i++) h_src.data()[i] = (double)rand() / RAND_MAX * (100); + + Kokkos::deep_copy( src, h_src ); + + Kokkos::View< double**, Kokkos::LayoutLeft, exec_space > dst = src; + + Kokkos::View< double**, Kokkos::LayoutLeft, exec_space >::HostMirror h_dst = Kokkos::create_mirror_view( dst ); + + Kokkos::deep_copy( h_dst, dst ); + + bool test = true; + for(size_t i=0; i<src.span();i++){ + if (h_src.data()[i]!=h_dst.data()[i]) {test = false;break;} + } + ASSERT_EQ( dst.span(), src.span() ); + ASSERT_EQ( test, true ); + } + { // Assignment of rank-3 LayoutLeft = LayoutStride + int ndims = 3; + int dims [] = {10,9,8}; + int order [] = {0,1,2}; + Kokkos::LayoutStride layout = Kokkos::LayoutStride::order_dimensions(ndims, order, dims); + Kokkos::View< double***, Kokkos::LayoutStride, exec_space > src("LayoutStride", layout); + + Kokkos::View< double***, Kokkos::LayoutStride, exec_space >::HostMirror h_src = Kokkos::create_mirror_view( src ); + + for(size_t i=0; i<src.span(); i++) h_src.data()[i] = (double)rand() / RAND_MAX * (100); + + Kokkos::deep_copy( src, h_src ); + + Kokkos::View< double***, Kokkos::LayoutLeft, exec_space > dst = src; + + Kokkos::View< double***, Kokkos::LayoutLeft, exec_space >::HostMirror h_dst = Kokkos::create_mirror_view( dst ); + + Kokkos::deep_copy( h_dst, dst ); + + bool test = true; + for(size_t i=0; i<src.span();i++){ + if (h_src.data()[i]!=h_dst.data()[i]) {test = false;break;} + } + ASSERT_EQ( dst.span(), src.span() ); + ASSERT_EQ( test, true ); + } + { // Assignment of rank-4 LayoutLeft = LayoutStride + int ndims = 4; + int dims [] = {10,9,8,7}; + int order [] = {0,1,2,3}; + Kokkos::LayoutStride layout = Kokkos::LayoutStride::order_dimensions(ndims, order, dims); + Kokkos::View< double****, Kokkos::LayoutStride, exec_space > src("LayoutStride", layout); + + Kokkos::View< double****, Kokkos::LayoutStride, exec_space >::HostMirror h_src = Kokkos::create_mirror_view( src ); + + for(size_t i=0; i<src.span(); i++) h_src.data()[i] = (double)rand() / RAND_MAX * (100); + + Kokkos::deep_copy( src, h_src ); + + Kokkos::View< double****, Kokkos::LayoutLeft, exec_space > dst = src; + + Kokkos::View< double****, Kokkos::LayoutLeft, exec_space >::HostMirror h_dst = Kokkos::create_mirror_view( dst ); + + Kokkos::deep_copy( h_dst, dst ); + + bool test = true; + for(size_t i=0; i<src.span();i++){ + if (h_src.data()[i]!=h_dst.data()[i]) {test = false;break;} + } + ASSERT_EQ( dst.span(), src.span() ); + ASSERT_EQ( test, true ); + } + { // Assignment of rank-5 LayoutLeft = LayoutStride + int ndims = 5; + int dims [] = {10,9,8,7,6}; + int order [] = {0,1,2,3,4}; + Kokkos::LayoutStride layout = Kokkos::LayoutStride::order_dimensions(ndims, order, dims); + Kokkos::View< double*****, Kokkos::LayoutStride, exec_space > src("LayoutStride", layout); + + Kokkos::View< double*****, Kokkos::LayoutStride, exec_space >::HostMirror h_src = Kokkos::create_mirror_view( src ); + + for(size_t i=0; i<src.span(); i++) h_src.data()[i] = (double)rand() / RAND_MAX * (100); + + Kokkos::deep_copy( src, h_src ); + + Kokkos::View< double*****, Kokkos::LayoutLeft, exec_space > dst = src; + + Kokkos::View< double*****, Kokkos::LayoutLeft, exec_space >::HostMirror h_dst = Kokkos::create_mirror_view( dst ); + + Kokkos::deep_copy( h_dst, dst ); + + bool test = true; + for(size_t i=0; i<src.span();i++){ + if (h_src.data()[i]!=h_dst.data()[i]) {test = false;break;} + } + ASSERT_EQ( dst.span(), src.span() ); + ASSERT_EQ( test, true ); + } + { // Assignment of rank-6 LayoutLeft = LayoutStride + int ndims = 6; + int dims [] = {10,9,8,7,6,5}; + int order [] = {0,1,2,3,4,5}; + Kokkos::LayoutStride layout = Kokkos::LayoutStride::order_dimensions(ndims, order, dims); + Kokkos::View< double******, Kokkos::LayoutStride, exec_space > src("LayoutStride", layout); + + Kokkos::View< double******, Kokkos::LayoutStride, exec_space >::HostMirror h_src = Kokkos::create_mirror_view( src ); + + for(size_t i=0; i<src.span(); i++) h_src.data()[i] = (double)rand() / RAND_MAX * (100); + + Kokkos::deep_copy( src, h_src ); + + Kokkos::View< double******, Kokkos::LayoutLeft, exec_space > dst = src; + + Kokkos::View< double******, Kokkos::LayoutLeft, exec_space >::HostMirror h_dst = Kokkos::create_mirror_view( dst ); + + Kokkos::deep_copy( h_dst, dst ); + + bool test = true; + for(size_t i=0; i<src.span();i++){ + if (h_src.data()[i]!=h_dst.data()[i]) {test = false;break;} + } + ASSERT_EQ( dst.span(), src.span() ); + ASSERT_EQ( test, true ); + } + { // Assignment of rank-7 LayoutLeft = LayoutStride + int ndims = 7; + int dims [] = {10,9,8,7,6,5,4}; + int order [] = {0,1,2,3,4,5,6}; + Kokkos::LayoutStride layout = Kokkos::LayoutStride::order_dimensions(ndims, order, dims); + Kokkos::View< double*******, Kokkos::LayoutStride, exec_space > src("LayoutStride", layout); + + Kokkos::View< double*******, Kokkos::LayoutStride, exec_space >::HostMirror h_src = Kokkos::create_mirror_view( src ); + + for(size_t i=0; i<src.span(); i++) h_src.data()[i] = (double)rand() / RAND_MAX * (100); + + Kokkos::deep_copy( src, h_src ); + + Kokkos::View< double*******, Kokkos::LayoutLeft, exec_space > dst = src; + + Kokkos::View< double*******, Kokkos::LayoutLeft, exec_space >::HostMirror h_dst = Kokkos::create_mirror_view( dst ); + + Kokkos::deep_copy( h_dst, dst ); + + bool test = true; + for(size_t i=0; i<src.span();i++){ + if (h_src.data()[i]!=h_dst.data()[i]) {test = false;break;} + } + ASSERT_EQ( dst.span(), src.span() ); + ASSERT_EQ( test, true ); + } + { // Assignment of rank-8 LayoutLeft = LayoutStride + int ndims = 8; + int dims [] = {10,9,8,7,6,5,4,3}; + int order [] = {0,1,2,3,4,5,6,7}; + Kokkos::LayoutStride layout = Kokkos::LayoutStride::order_dimensions(ndims, order, dims); + Kokkos::View< double********, Kokkos::LayoutStride, exec_space > src("LayoutStride", layout); + + Kokkos::View< double********, Kokkos::LayoutStride, exec_space >::HostMirror h_src = Kokkos::create_mirror_view( src ); + + for(size_t i=0; i<src.span(); i++) h_src.data()[i] = (double)rand() / RAND_MAX * (100); + + Kokkos::deep_copy( src, h_src ); + + Kokkos::View< double********, Kokkos::LayoutLeft, exec_space > dst = src; + + Kokkos::View< double********, Kokkos::LayoutLeft, exec_space >::HostMirror h_dst = Kokkos::create_mirror_view( dst ); + + Kokkos::deep_copy( h_dst, dst ); + + bool test = true; + for(size_t i=0; i<src.span();i++){ + if (h_src.data()[i]!=h_dst.data()[i]) {test = false;break;} + } + ASSERT_EQ( dst.span(), src.span() ); + ASSERT_EQ( test, true ); + } + +} + +TEST_F( TEST_CATEGORY , view_layoutstride_right_to_layoutright_assignment ) +{ + typedef TEST_EXECSPACE exec_space ; + + auto t = time(0); + srand(t);// Use current time as seed for random generator + printf("view_layoutstride_right_to_layoutright_assignment: srand(%lu)\n",size_t(t)); + + { // Assignment of rank-1 LayoutRight = LayoutStride + int ndims = 1; + int dims [] = {10}; + int order [] = {0}; + Kokkos::LayoutStride layout = Kokkos::LayoutStride::order_dimensions(ndims, order, dims); + Kokkos::View< double*, Kokkos::LayoutStride, exec_space > src("LayoutStride", layout); + + Kokkos::View< double*, Kokkos::LayoutStride, exec_space >::HostMirror h_src = Kokkos::create_mirror_view( src ); + + for(size_t i=0; i<src.span(); i++) h_src.data()[i] = (double)rand() / RAND_MAX * (100); + + Kokkos::deep_copy( src, h_src ); + + Kokkos::View< double*, Kokkos::LayoutRight, exec_space > dst = src; + + Kokkos::View< double*, Kokkos::LayoutRight, exec_space >::HostMirror h_dst = Kokkos::create_mirror_view( dst ); + + Kokkos::deep_copy( h_dst, dst ); + + bool test = true; + for(size_t i=0; i<src.span();i++){ + if (h_src.data()[i]!=h_dst.data()[i]) {test = false;break;} + } + ASSERT_EQ( dst.span(), src.span() ); + ASSERT_EQ( test, true ); + } + { // Assignment of rank-2 LayoutRight = LayoutStride + int ndims = 2; + int dims [] = {10,9}; + int order [] = {1,0}; + Kokkos::LayoutStride layout = Kokkos::LayoutStride::order_dimensions(ndims, order, dims); + Kokkos::View< double**, Kokkos::LayoutStride, exec_space > src("LayoutStride", layout); + + Kokkos::View< double**, Kokkos::LayoutStride, exec_space >::HostMirror h_src = Kokkos::create_mirror_view( src ); + + for(size_t i=0; i<src.span(); i++) h_src.data()[i] = (double)rand() / RAND_MAX * (100); + + Kokkos::deep_copy( src, h_src ); + + Kokkos::View< double**, Kokkos::LayoutRight, exec_space > dst = src; + + Kokkos::View< double**, Kokkos::LayoutRight, exec_space >::HostMirror h_dst = Kokkos::create_mirror_view( dst ); + + Kokkos::deep_copy( h_dst, dst ); + + bool test = true; + for(size_t i=0; i<src.span();i++){ + if (h_src.data()[i]!=h_dst.data()[i]) {test = false;break;} + } + ASSERT_EQ( dst.span(), src.span() ); + ASSERT_EQ( test, true ); + } + { // Assignment of rank-3 LayoutRight = LayoutStride + int ndims = 3; + int dims [] = {10,9,8}; + int order [] = {2,1,0}; + Kokkos::LayoutStride layout = Kokkos::LayoutStride::order_dimensions(ndims, order, dims); + Kokkos::View< double***, Kokkos::LayoutStride, exec_space > src("LayoutStride", layout); + + Kokkos::View< double***, Kokkos::LayoutStride, exec_space >::HostMirror h_src = Kokkos::create_mirror_view( src ); + + for(size_t i=0; i<src.span(); i++) h_src.data()[i] = (double)rand() / RAND_MAX * (100); + + Kokkos::deep_copy( src, h_src ); + + Kokkos::View< double***, Kokkos::LayoutRight, exec_space > dst = src; + + Kokkos::View< double***, Kokkos::LayoutRight, exec_space >::HostMirror h_dst = Kokkos::create_mirror_view( dst ); + + Kokkos::deep_copy( h_dst, dst ); + + bool test = true; + for(size_t i=0; i<src.span();i++){ + if (h_src.data()[i]!=h_dst.data()[i]) {test = false;break;} + } + ASSERT_EQ( dst.span(), src.span() ); + ASSERT_EQ( test, true ); + } + { // Assignment of rank-4 LayoutRight = LayoutStride + int ndims = 4; + int dims [] = {10,9,8,7}; + int order [] = {3,2,1,0}; + Kokkos::LayoutStride layout = Kokkos::LayoutStride::order_dimensions(ndims, order, dims); + Kokkos::View< double****, Kokkos::LayoutStride, exec_space > src("LayoutStride", layout); + + Kokkos::View< double****, Kokkos::LayoutStride, exec_space >::HostMirror h_src = Kokkos::create_mirror_view( src ); + + for(size_t i=0; i<src.span(); i++) h_src.data()[i] = (double)rand() / RAND_MAX * (100); + + Kokkos::deep_copy( src, h_src ); + + Kokkos::View< double****, Kokkos::LayoutRight, exec_space > dst = src; + + Kokkos::View< double****, Kokkos::LayoutRight, exec_space >::HostMirror h_dst = Kokkos::create_mirror_view( dst ); + + Kokkos::deep_copy( h_dst, dst ); + + bool test = true; + for(size_t i=0; i<src.span();i++){ + if (h_src.data()[i]!=h_dst.data()[i]) {test = false;break;} + } + ASSERT_EQ( dst.span(), src.span() ); + ASSERT_EQ( test, true ); + } + { // Assignment of rank-5 LayoutRight = LayoutStride + int ndims = 5; + int dims [] = {10,9,8,7,6}; + int order [] = {4,3,2,1,0}; + Kokkos::LayoutStride layout = Kokkos::LayoutStride::order_dimensions(ndims, order, dims); + Kokkos::View< double*****, Kokkos::LayoutStride, exec_space > src("LayoutStride", layout); + + Kokkos::View< double*****, Kokkos::LayoutStride, exec_space >::HostMirror h_src = Kokkos::create_mirror_view( src ); + + for(size_t i=0; i<src.span(); i++) h_src.data()[i] = (double)rand() / RAND_MAX * (100); + + Kokkos::deep_copy( src, h_src ); + + Kokkos::View< double*****, Kokkos::LayoutRight, exec_space > dst = src; + + Kokkos::View< double*****, Kokkos::LayoutRight, exec_space >::HostMirror h_dst = Kokkos::create_mirror_view( dst ); + + Kokkos::deep_copy( h_dst, dst ); + + bool test = true; + for(size_t i=0; i<src.span();i++){ + if (h_src.data()[i]!=h_dst.data()[i]) {test = false;break;} + } + ASSERT_EQ( dst.span(), src.span() ); + ASSERT_EQ( test, true ); + } + { // Assignment of rank-6 LayoutRight = LayoutStride + int ndims = 6; + int dims [] = {10,9,8,7,6,5}; + int order [] = {5,4,3,2,1,0}; + Kokkos::LayoutStride layout = Kokkos::LayoutStride::order_dimensions(ndims, order, dims); + Kokkos::View< double******, Kokkos::LayoutStride, exec_space > src("LayoutStride", layout); + + Kokkos::View< double******, Kokkos::LayoutStride, exec_space >::HostMirror h_src = Kokkos::create_mirror_view( src ); + + for(size_t i=0; i<src.span(); i++) h_src.data()[i] = (double)rand() / RAND_MAX * (100); + + Kokkos::deep_copy( src, h_src ); + + Kokkos::View< double******, Kokkos::LayoutRight, exec_space > dst = src; + + Kokkos::View< double******, Kokkos::LayoutRight, exec_space >::HostMirror h_dst = Kokkos::create_mirror_view( dst ); + + Kokkos::deep_copy( h_dst, dst ); + + bool test = true; + for(size_t i=0; i<src.span();i++){ + if (h_src.data()[i]!=h_dst.data()[i]) {test = false;break;} + } + ASSERT_EQ( dst.span(), src.span() ); + ASSERT_EQ( test, true ); + } + { // Assignment of rank-7 LayoutRight = LayoutStride + int ndims = 7; + int dims [] = {10,9,8,7,6,5,4}; + int order [] = {6,5,4,3,2,1,0}; + Kokkos::LayoutStride layout = Kokkos::LayoutStride::order_dimensions(ndims, order, dims); + Kokkos::View< double*******, Kokkos::LayoutStride, exec_space > src("LayoutStride", layout); + + Kokkos::View< double*******, Kokkos::LayoutStride, exec_space >::HostMirror h_src = Kokkos::create_mirror_view( src ); + + for(size_t i=0; i<src.span(); i++) h_src.data()[i] = (double)rand() / RAND_MAX * (100); + + Kokkos::deep_copy( src, h_src ); + + Kokkos::View< double*******, Kokkos::LayoutRight, exec_space > dst = src; + + Kokkos::View< double*******, Kokkos::LayoutRight, exec_space >::HostMirror h_dst = Kokkos::create_mirror_view( dst ); + + Kokkos::deep_copy( h_dst, dst ); + + bool test = true; + for(size_t i=0; i<src.span();i++){ + if (h_src.data()[i]!=h_dst.data()[i]) {test = false;break;} + } + ASSERT_EQ( dst.span(), src.span() ); + ASSERT_EQ( test, true ); + } + { // Assignment of rank-8 LayoutRight = LayoutStride + int ndims = 8; + int dims [] = {10,9,8,7,6,5,4,3}; + int order [] = {7,6,5,4,3,2,1,0}; + Kokkos::LayoutStride layout = Kokkos::LayoutStride::order_dimensions(ndims, order, dims); + Kokkos::View< double********, Kokkos::LayoutStride, exec_space > src("LayoutStride", layout); + + Kokkos::View< double********, Kokkos::LayoutStride, exec_space >::HostMirror h_src = Kokkos::create_mirror_view( src ); + + for(size_t i=0; i<src.span(); i++) h_src.data()[i] = (double)rand() / RAND_MAX * (100); + + Kokkos::deep_copy( src, h_src ); + + Kokkos::View< double********, Kokkos::LayoutRight, exec_space > dst = src; + + Kokkos::View< double********, Kokkos::LayoutRight, exec_space >::HostMirror h_dst = Kokkos::create_mirror_view( dst ); + + Kokkos::deep_copy( h_dst, dst ); + + bool test = true; + for(size_t i=0; i<src.span();i++){ + if (h_src.data()[i]!=h_dst.data()[i]) {test = false;break;} + } + ASSERT_EQ( dst.span(), src.span() ); + ASSERT_EQ( test, true ); + } + +} + +TEST_F( TEST_CATEGORY , view_layoutstride_right_to_layoutleft_assignment ) +{ + typedef TEST_EXECSPACE exec_space ; + + auto t = time(0); + srand(t);// Use current time as seed for random generator + printf("view_layoutstride_right_to_layoutleft_assignment: srand(%lu)\n",size_t(t)); + + { // Assignment of rank-1 LayoutLeft = LayoutStride (LayoutRight compatible) + int ndims = 1; + int dims [] = {10}; + int order [] = {0}; + Kokkos::LayoutStride layout = Kokkos::LayoutStride::order_dimensions(ndims, order, dims); + Kokkos::View< double*, Kokkos::LayoutStride, exec_space > src("LayoutStride", layout); + + Kokkos::View< double*, Kokkos::LayoutStride, exec_space >::HostMirror h_src = Kokkos::create_mirror_view( src ); + + for(size_t i=0; i<src.span(); i++) h_src.data()[i] = (double)rand() / RAND_MAX * (100); + + Kokkos::deep_copy( src, h_src ); + + Kokkos::View< double*, Kokkos::LayoutLeft, exec_space > dst; + + dst = src; + + Kokkos::View< double*, Kokkos::LayoutLeft, exec_space >::HostMirror h_dst = Kokkos::create_mirror_view( dst ); + + Kokkos::deep_copy( h_dst, dst ); + + bool test = true; + for(size_t i=0; i<src.span();i++){ + if (h_src.data()[i]!=h_dst.data()[i]) {test = false;break;} + } + ASSERT_EQ( dst.span(), src.span() ); + ASSERT_EQ( test, true ); + } + { // Assignment of rank-2 LayoutLeft = LayoutStride (LayoutRight compatible) + int ndims = 2; + int dims [] = {10,9}; + int order [] = {1,0}; + Kokkos::LayoutStride layout = Kokkos::LayoutStride::order_dimensions(ndims, order, dims); + Kokkos::View< double**, Kokkos::LayoutStride, exec_space > src("LayoutStride", layout); + + Kokkos::View< double**, Kokkos::LayoutLeft, exec_space > dst; + + ::testing::FLAGS_gtest_death_test_style = "threadsafe"; + ASSERT_DEATH({dst=src;}, "View assignment must have compatible layouts"); + } + { // Assignment of rank-3 LayoutLeft = LayoutStride (LayoutRight compatible) + int ndims = 3; + int dims [] = {10,9,8}; + int order [] = {2,1,0}; + Kokkos::LayoutStride layout = Kokkos::LayoutStride::order_dimensions(ndims, order, dims); + Kokkos::View< double***, Kokkos::LayoutStride, exec_space > src("LayoutStride", layout); + + Kokkos::View< double***, Kokkos::LayoutLeft, exec_space > dst; + + ::testing::FLAGS_gtest_death_test_style = "threadsafe"; + ASSERT_DEATH({dst=src;}, "View assignment must have compatible layouts"); + } + { // Assignment of rank-4 LayoutLeft = LayoutStride (LayoutRight compatible) + int ndims = 4; + int dims [] = {10,9,8,7}; + int order [] = {3,2,1,0}; + Kokkos::LayoutStride layout = Kokkos::LayoutStride::order_dimensions(ndims, order, dims); + Kokkos::View< double****, Kokkos::LayoutStride, exec_space > src("LayoutStride", layout); + + Kokkos::View< double****, Kokkos::LayoutLeft, exec_space > dst; + + ::testing::FLAGS_gtest_death_test_style = "threadsafe"; + ASSERT_DEATH({dst=src;}, "View assignment must have compatible layouts"); + } + { // Assignment of rank-5 LayoutLeft = LayoutStride (LayoutRight compatible) + int ndims = 5; + int dims [] = {10,9,8,7,6}; + int order [] = {4,3,2,1,0}; + Kokkos::LayoutStride layout = Kokkos::LayoutStride::order_dimensions(ndims, order, dims); + Kokkos::View< double*****, Kokkos::LayoutStride, exec_space > src("LayoutStride", layout); + + Kokkos::View< double*****, Kokkos::LayoutLeft, exec_space > dst; + + ::testing::FLAGS_gtest_death_test_style = "threadsafe"; + ASSERT_DEATH({dst=src;}, "View assignment must have compatible layouts"); + } + { // Assignment of rank-6 LayoutLeft = LayoutStride (LayoutRight compatible) + int ndims = 6; + int dims [] = {10,9,8,7,6,5}; + int order [] = {5,4,3,2,1,0}; + Kokkos::LayoutStride layout = Kokkos::LayoutStride::order_dimensions(ndims, order, dims); + Kokkos::View< double******, Kokkos::LayoutStride, exec_space > src("LayoutStride", layout); + + Kokkos::View< double******, Kokkos::LayoutLeft, exec_space > dst; + + ::testing::FLAGS_gtest_death_test_style = "threadsafe"; + ASSERT_DEATH({dst=src;}, "View assignment must have compatible layouts"); + } + { // Assignment of rank-7 LayoutLeft = LayoutStride (LayoutRight compatible) + int ndims = 7; + int dims [] = {10,9,8,7,6,5,4}; + int order [] = {6,5,4,3,2,1,0}; + Kokkos::LayoutStride layout = Kokkos::LayoutStride::order_dimensions(ndims, order, dims); + Kokkos::View< double*******, Kokkos::LayoutStride, exec_space > src("LayoutStride", layout); + + Kokkos::View< double*******, Kokkos::LayoutLeft, exec_space > dst; + + ::testing::FLAGS_gtest_death_test_style = "threadsafe"; + ASSERT_DEATH({dst=src;}, "View assignment must have compatible layouts"); + } + { // Assignment of rank-8 LayoutLeft = LayoutStride (LayoutRight compatible) + int ndims = 8; + int dims [] = {10,9,8,7,6,5,4,3}; + int order [] = {7,6,5,4,3,2,1,0}; + Kokkos::LayoutStride layout = Kokkos::LayoutStride::order_dimensions(ndims, order, dims); + Kokkos::View< double********, Kokkos::LayoutStride, exec_space > src("LayoutStride", layout); + + Kokkos::View< double********, Kokkos::LayoutLeft, exec_space > dst; + + ::testing::FLAGS_gtest_death_test_style = "threadsafe"; + ASSERT_DEATH({dst=src;}, "View assignment must have compatible layouts"); + } + +} + +TEST_F( TEST_CATEGORY , view_layoutstride_left_to_layoutright_assignment ) +{ + typedef TEST_EXECSPACE exec_space ; + + auto t = time(0); + srand(t);// Use current time as seed for random generator + printf("view_layoutstride_left_to_layoutright_assignment: srand(%lu)\n",size_t(t)); + + { // Assignment of rank-1 LayoutRight = LayoutStride (LayoutLeft compatible) + int ndims = 1; + int dims [] = {10}; + int order [] = {0}; + Kokkos::LayoutStride layout = Kokkos::LayoutStride::order_dimensions(ndims, order, dims); + Kokkos::View< double*, Kokkos::LayoutStride, exec_space > src("LayoutStride", layout); + + Kokkos::View< double*, Kokkos::LayoutStride, exec_space >::HostMirror h_src = Kokkos::create_mirror_view( src ); + + for(size_t i=0; i<src.span(); i++) h_src.data()[i] = (double)rand() / RAND_MAX * (100); + + Kokkos::deep_copy( src, h_src ); + + Kokkos::View< double*, Kokkos::LayoutRight, exec_space > dst; + + dst = src; + + Kokkos::View< double*, Kokkos::LayoutRight, exec_space >::HostMirror h_dst = Kokkos::create_mirror_view( dst ); + + Kokkos::deep_copy( h_dst, dst ); + + bool test = true; + for(size_t i=0; i<src.span();i++){ + if (h_src.data()[i]!=h_dst.data()[i]) {test = false;break;} + } + ASSERT_EQ( dst.span(), src.span() ); + ASSERT_EQ( test, true ); + } + { // Assignment of rank-2 LayoutRight = LayoutStride (LayoutLeft compatible) + int ndims = 2; + int dims [] = {10,9}; + int order [] = {0,1}; + Kokkos::LayoutStride layout = Kokkos::LayoutStride::order_dimensions(ndims, order, dims); + Kokkos::View< double**, Kokkos::LayoutStride, exec_space > src("LayoutStride", layout); + + Kokkos::View< double**, Kokkos::LayoutRight, exec_space > dst; + + ::testing::FLAGS_gtest_death_test_style = "threadsafe"; + ASSERT_DEATH({dst=src;}, "View assignment must have compatible layouts"); + } + { // Assignment of rank-3 LayoutRight = LayoutStride (LayoutLeft compatible) + int ndims = 3; + int dims [] = {10,9,8}; + int order [] = {0,1,2}; + Kokkos::LayoutStride layout = Kokkos::LayoutStride::order_dimensions(ndims, order, dims); + Kokkos::View< double***, Kokkos::LayoutStride, exec_space > src("LayoutStride", layout); + + Kokkos::View< double***, Kokkos::LayoutRight, exec_space > dst; + + ::testing::FLAGS_gtest_death_test_style = "threadsafe"; + ASSERT_DEATH({dst=src;}, "View assignment must have compatible layouts"); + } + { // Assignment of rank-4 LayoutRight = LayoutStride (LayoutLeft compatible) + int ndims = 4; + int dims [] = {10,9,8,7}; + int order [] = {0,1,2,3}; + Kokkos::LayoutStride layout = Kokkos::LayoutStride::order_dimensions(ndims, order, dims); + Kokkos::View< double****, Kokkos::LayoutStride, exec_space > src("LayoutStride", layout); + + Kokkos::View< double****, Kokkos::LayoutRight, exec_space > dst; + + ::testing::FLAGS_gtest_death_test_style = "threadsafe"; + ASSERT_DEATH({dst=src;}, "View assignment must have compatible layouts"); + } + { // Assignment of rank-5 LayoutRight = LayoutStride (LayoutLeft compatible) + int ndims = 5; + int dims [] = {10,9,8,7,6}; + int order [] = {0,1,2,3,4}; + Kokkos::LayoutStride layout = Kokkos::LayoutStride::order_dimensions(ndims, order, dims); + Kokkos::View< double*****, Kokkos::LayoutStride, exec_space > src("LayoutStride", layout); + + Kokkos::View< double*****, Kokkos::LayoutRight, exec_space > dst; + + ::testing::FLAGS_gtest_death_test_style = "threadsafe"; + ASSERT_DEATH({dst=src;}, "View assignment must have compatible layouts"); + } + { // Assignment of rank-6 LayoutRight = LayoutStride (LayoutLeft compatible) + int ndims = 6; + int dims [] = {10,9,8,7,6,5}; + int order [] = {0,1,2,3,4,5}; + Kokkos::LayoutStride layout = Kokkos::LayoutStride::order_dimensions(ndims, order, dims); + Kokkos::View< double******, Kokkos::LayoutStride, exec_space > src("LayoutStride", layout); + + Kokkos::View< double******, Kokkos::LayoutRight, exec_space > dst; + + ::testing::FLAGS_gtest_death_test_style = "threadsafe"; + ASSERT_DEATH({dst=src;}, "View assignment must have compatible layouts"); + } + { // Assignment of rank-7 LayoutRight = LayoutStride (LayoutLeft compatible) + int ndims = 7; + int dims [] = {10,9,8,7,6,5,4}; + int order [] = {0,1,2,3,4,5,6}; + Kokkos::LayoutStride layout = Kokkos::LayoutStride::order_dimensions(ndims, order, dims); + Kokkos::View< double*******, Kokkos::LayoutStride, exec_space > src("LayoutStride", layout); + + Kokkos::View< double*******, Kokkos::LayoutRight, exec_space > dst; + + ::testing::FLAGS_gtest_death_test_style = "threadsafe"; + ASSERT_DEATH({dst=src;}, "View assignment must have compatible layouts"); + } + { // Assignment of rank-8 LayoutRight = LayoutStride (LayoutLeft compatible) + int ndims = 8; + int dims [] = {10,9,8,7,6,5,4,3}; + int order [] = {0,1,2,3,4,5,6,7}; + Kokkos::LayoutStride layout = Kokkos::LayoutStride::order_dimensions(ndims, order, dims); + Kokkos::View< double********, Kokkos::LayoutStride, exec_space > src("LayoutStride", layout); + + Kokkos::View< double********, Kokkos::LayoutRight, exec_space > dst; + + ::testing::FLAGS_gtest_death_test_style = "threadsafe"; + ASSERT_DEATH({dst=src;}, "View assignment must have compatible layouts"); + } + +} + +} + diff --git a/packages/kokkos/core/unit_test/TestViewLayoutTiled.hpp b/packages/kokkos/core/unit_test/TestViewLayoutTiled.hpp new file mode 100644 index 0000000000000000000000000000000000000000..e765e8b06d3575a438d1d894cd0f995f3e1da3b3 --- /dev/null +++ b/packages/kokkos/core/unit_test/TestViewLayoutTiled.hpp @@ -0,0 +1,1215 @@ +/* +//@HEADER +// ************************************************************************ +// +// Kokkos v. 2.0 +// Copyright (2014) Sandia Corporation +// +// Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, +// the U.S. Government retains certain rights in this software. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// +// 3. Neither the name of the Corporation nor the names of the +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY +// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE +// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) +// +// ************************************************************************ +//@HEADER +*/ + +#include <cstdio> + +#include <gtest/gtest.h> + +#include <Kokkos_Core.hpp> +#include <impl/Kokkos_ViewLayoutTiled.hpp> + +#include <type_traits> +#include <typeinfo> + +namespace Test { + +#ifndef KOKKOS_ENABLE_DEPRECATED_CODE +namespace { + +template <typename ExecSpace > +struct TestViewLayoutTiled { + + typedef double Scalar; + + static constexpr int T0 = 2; + static constexpr int T1 = 4; + static constexpr int T2 = 4; + static constexpr int T3 = 2; + static constexpr int T4 = 2; + static constexpr int T5 = 2; + static constexpr int T6 = 2; + static constexpr int T7 = 2; + + // Rank 2 + typedef Kokkos::Experimental::LayoutTiled<Kokkos::Iterate::Left, Kokkos::Iterate::Left, T0, T1> LayoutLL_2D_2x4; + typedef Kokkos::Experimental::LayoutTiled<Kokkos::Iterate::Right, Kokkos::Iterate::Left, T0, T1> LayoutRL_2D_2x4; + typedef Kokkos::Experimental::LayoutTiled<Kokkos::Iterate::Left, Kokkos::Iterate::Right, T0, T1> LayoutLR_2D_2x4; + typedef Kokkos::Experimental::LayoutTiled<Kokkos::Iterate::Right, Kokkos::Iterate::Right, T0, T1> LayoutRR_2D_2x4; + + // Rank 3 + typedef Kokkos::Experimental::LayoutTiled<Kokkos::Iterate::Left, Kokkos::Iterate::Left, T0, T1, T2> LayoutLL_3D_2x4x4; + typedef Kokkos::Experimental::LayoutTiled<Kokkos::Iterate::Right, Kokkos::Iterate::Left, T0, T1, T2> LayoutRL_3D_2x4x4; + typedef Kokkos::Experimental::LayoutTiled<Kokkos::Iterate::Left, Kokkos::Iterate::Right, T0, T1, T2> LayoutLR_3D_2x4x4; + typedef Kokkos::Experimental::LayoutTiled<Kokkos::Iterate::Right, Kokkos::Iterate::Right, T0, T1, T2> LayoutRR_3D_2x4x4; + + // Rank 4 + typedef Kokkos::Experimental::LayoutTiled<Kokkos::Iterate::Left, Kokkos::Iterate::Left, T0, T1, T2, T3> LayoutLL_4D_2x4x4x2; + typedef Kokkos::Experimental::LayoutTiled<Kokkos::Iterate::Right, Kokkos::Iterate::Left, T0, T1, T2, T3> LayoutRL_4D_2x4x4x2; + typedef Kokkos::Experimental::LayoutTiled<Kokkos::Iterate::Left, Kokkos::Iterate::Right, T0, T1, T2, T3> LayoutLR_4D_2x4x4x2; + typedef Kokkos::Experimental::LayoutTiled<Kokkos::Iterate::Right, Kokkos::Iterate::Right, T0, T1, T2, T3> LayoutRR_4D_2x4x4x2; + + + static void test_view_layout_tiled_2d( const int N0, const int N1 ) + { +#if defined( KOKKOS_ENABLE_CXX11_DISPATCH_LAMBDA ) +#if !defined(KOKKOS_ENABLE_CUDA) || ( 8000 <= CUDA_VERSION ) + const int FT = T0*T1; + + const int NT0 = int( std::ceil( N0 / T0 ) ); + const int NT1 = int( std::ceil( N1 / T1 ) ); + // Test create_mirror_view, deep_copy + // Create LL View + { + typedef typename Kokkos::View< Scalar**, LayoutLL_2D_2x4, ExecSpace > ViewType; + ViewType v("v", N0, N1); + + typename ViewType::HostMirror hv = Kokkos::create_mirror_view(v); + + // Initialize host-view + for ( int tj = 0; tj < NT1; ++tj ) { + for ( int ti = 0; ti < NT0; ++ti ) { + for ( int j = 0; j < T1; ++j ) { + for ( int i = 0; i < T0; ++i ) { + hv(ti*T0 + i, tj*T1+j) = ( ti + tj*NT0 )*FT + ( i + j*T0 ); + } } + } } + + // copy to device + Kokkos::deep_copy(v, hv); + + Kokkos::MDRangePolicy< Kokkos::Rank<2, Kokkos::Iterate::Left, Kokkos::Iterate::Left>, ExecSpace > mdrangepolicy( {0,0}, {NT0, NT1}, {T0,T1} ); + + // iterate by tile + Kokkos::parallel_for( "ViewTile rank 2 LL", mdrangepolicy, + KOKKOS_LAMBDA (const int ti, const int tj) { + for ( int j = 0; j < T1; ++j ) { + for ( int i = 0; i < T0; ++i ) { + if ( (ti*T0 + i < N0) && (tj*T1 + j < N1) ) { v(ti*T0 + i, tj*T1+j) += 1; } + } } + }); + + Kokkos::deep_copy(hv, v); + + long counter_subview = 0; + long counter_inc = 0; + for ( int tj = 0; tj < NT1; ++tj ) { + for ( int ti = 0; ti < NT0; ++ti ) { + auto tile_subview = Kokkos::tile_subview( hv, ti, tj ); + for ( int j = 0; j < T1; ++j ) { + for ( int i = 0; i < T0; ++i ) { + if ( tile_subview(i,j) != hv(ti*T0+i, tj*T1+j) ) { ++counter_subview; } + if ( tile_subview(i,j) != (( ti + tj*NT0 )*FT + ( i + j*T0 ) + 1 )) { ++counter_inc; } + } } + } } + ASSERT_EQ(counter_subview, long(0)); + ASSERT_EQ(counter_inc, long(0)); + } + + // Create RL View + { + typedef typename Kokkos::View< Scalar**, LayoutRL_2D_2x4, ExecSpace > ViewType; + Kokkos::View< Scalar**, LayoutRL_2D_2x4, ExecSpace > v("v", N0, N1); + + typename ViewType::HostMirror hv = Kokkos::create_mirror_view(v); + + // Initialize host-view + for ( int ti = 0; ti < NT0; ++ti ) { + for ( int tj = 0; tj < NT1; ++tj ) { + for ( int j = 0; j < T1; ++j ) { + for ( int i = 0; i < T0; ++i ) { + hv(ti*T0 + i, tj*T1+j) = ( ti*NT1 + tj )*FT + ( i + j*T0 ); + } } + } } + + // copy to device + Kokkos::deep_copy(v, hv); + + Kokkos::MDRangePolicy< Kokkos::Rank<2, Kokkos::Iterate::Right, Kokkos::Iterate::Left>, ExecSpace > mdrangepolicy( {0,0}, {NT0, NT1}, {T0,T1} ); + + // iterate by tile + Kokkos::parallel_for( "ViewTile rank 2 RL", mdrangepolicy, + KOKKOS_LAMBDA (const int ti, const int tj) { + for ( int j = 0; j < T1; ++j ) { + for ( int i = 0; i < T0; ++i ) { + if ( (ti*T0 + i < N0) && (tj*T1 + j < N1) ) { v(ti*T0 + i, tj*T1+j) += 1; } + } } + }); + + Kokkos::deep_copy(hv, v); + + long counter_subview = 0; + long counter_inc = 0; + + for ( int ti = 0; ti < NT0; ++ti ) { + for ( int tj = 0; tj < NT1; ++tj ) { + auto tile_subview = Kokkos::tile_subview( hv, ti, tj ); + for ( int j = 0; j < T1; ++j ) { + for ( int i = 0; i < T0; ++i ) { + if ( tile_subview(i,j) != hv(ti*T0+i, tj*T1+j) ) { ++counter_subview; } + if ( tile_subview(i,j) != (( ti*NT1 + tj )*FT + ( i + j*T0 ) + 1 )) { ++counter_inc; } + } } + } } + ASSERT_EQ(counter_subview, long(0)); + ASSERT_EQ(counter_inc, long(0)); + } // end scope + + // Create LR View + { + typedef typename Kokkos::View< Scalar**, LayoutLR_2D_2x4, ExecSpace > ViewType; + Kokkos::View< Scalar**, LayoutLR_2D_2x4, ExecSpace > v("v", N0, N1); + + typename ViewType::HostMirror hv = Kokkos::create_mirror_view(v); + + // Initialize host-view + for ( int tj = 0; tj < NT1; ++tj ) { + for ( int ti = 0; ti < NT0; ++ti ) { + for ( int i = 0; i < T0; ++i ) { + for ( int j = 0; j < T1; ++j ) { + hv(ti*T0 + i, tj*T1+j) = ( ti + tj*NT0 )*FT + ( i*T1 + j ); + } } + } } + + // copy to device + Kokkos::deep_copy(v, hv); + + Kokkos::MDRangePolicy< Kokkos::Rank<2, Kokkos::Iterate::Left, Kokkos::Iterate::Right>, ExecSpace > mdrangepolicy( {0,0}, {NT0, NT1}, {T0,T1} ); + + // iterate by tile + Kokkos::parallel_for( "ViewTile rank 2 LR", mdrangepolicy, + KOKKOS_LAMBDA (const int ti, const int tj) { + for ( int j = 0; j < T1; ++j ) { + for ( int i = 0; i < T0; ++i ) { + if ( (ti*T0 + i < N0) && (tj*T1 + j < N1) ) { v(ti*T0 + i, tj*T1+j) += 1; } + } } + }); + + Kokkos::deep_copy(hv, v); + + long counter_subview = 0; + long counter_inc = 0; + + for ( int tj = 0; tj < NT1; ++tj ) { + for ( int ti = 0; ti < NT0; ++ti ) { + auto tile_subview = Kokkos::tile_subview( hv, ti, tj ); + for ( int i = 0; i < T0; ++i ) { + for ( int j = 0; j < T1; ++j ) { + if ( tile_subview(i,j) != hv(ti*T0+i, tj*T1+j) ) { ++counter_subview; } + if ( tile_subview(i,j) != ( ( ti + tj*NT0 )*FT + ( i*T1 + j ) + 1 ) ) { ++counter_inc; } + } } + } } + ASSERT_EQ(counter_subview, long(0)); + ASSERT_EQ(counter_inc, long(0)); + } // end scope + + // Create RR View + { + typedef typename Kokkos::View< Scalar**, LayoutRR_2D_2x4, ExecSpace > ViewType; + Kokkos::View< Scalar**, LayoutRR_2D_2x4, ExecSpace > v("v", N0, N1); + + typename ViewType::HostMirror hv = Kokkos::create_mirror_view(v); + + // Initialize host-view + for ( int ti = 0; ti < NT0; ++ti ) { + for ( int tj = 0; tj < NT1; ++tj ) { + for ( int i = 0; i < T0; ++i ) { + for ( int j = 0; j < T1; ++j ) { + hv(ti*T0 + i, tj*T1+j) = ( ti*NT1 + tj )*FT + ( i*T1 + j ); + } } + } } + + // copy to device + Kokkos::deep_copy(v, hv); + + Kokkos::MDRangePolicy< Kokkos::Rank<2, Kokkos::Iterate::Left, Kokkos::Iterate::Right>, ExecSpace > mdrangepolicy( {0,0}, {NT0, NT1}, {T0,T1} ); + + // iterate by tile + Kokkos::parallel_for( "ViewTile rank 2 LR", mdrangepolicy, + KOKKOS_LAMBDA (const int ti, const int tj) { + for ( int j = 0; j < T1; ++j ) { + for ( int i = 0; i < T0; ++i ) { + if ( (ti*T0 + i < N0) && (tj*T1 + j < N1) ) { v(ti*T0 + i, tj*T1+j) += 1; } + } } + }); + + Kokkos::deep_copy(hv, v); + + long counter_subview = 0; + long counter_inc = 0; + + for ( int ti = 0; ti < NT0; ++ti ) { + for ( int tj = 0; tj < NT1; ++tj ) { + auto tile_subview = Kokkos::tile_subview( hv, ti, tj ); + for ( int i = 0; i < T0; ++i ) { + for ( int j = 0; j < T1; ++j ) { + if ( tile_subview(i,j) != hv(ti*T0+i, tj*T1+j) ) { ++counter_subview; } + if ( tile_subview(i,j) != ( ( ti*NT1 + tj )*FT + ( i*T1 + j ) + 1 ) ) { ++counter_inc; } + } } + } } + ASSERT_EQ(counter_subview, long(0)); + ASSERT_EQ(counter_inc, long(0)); + } // end scope +#endif +#endif + } // end test_view_layout_tiled_2d + + + static void test_view_layout_tiled_3d( const int N0, const int N1, const int N2 ) + { +#if defined( KOKKOS_ENABLE_CXX11_DISPATCH_LAMBDA ) +#if !defined(KOKKOS_ENABLE_CUDA) || ( 8000 <= CUDA_VERSION ) + + const int FT = T0*T1*T2; + + const int NT0 = int( std::ceil( N0 / T0 ) ); + const int NT1 = int( std::ceil( N1 / T1 ) ); + const int NT2 = int( std::ceil( N2 / T2 ) ); + + // Create LL View + { + typedef Kokkos::View< Scalar***, LayoutLL_3D_2x4x4, ExecSpace > ViewType; + Kokkos::View< Scalar***, LayoutLL_3D_2x4x4, ExecSpace > dv("dv", N0, N1, N2); + + typename ViewType::HostMirror v = Kokkos::create_mirror_view(dv); + + // Initialize on host + for ( int tk = 0; tk < NT2; ++tk ) { + for ( int tj = 0; tj < NT1; ++tj ) { + for ( int ti = 0; ti < NT0; ++ti ) { + for ( int k = 0; k < T2; ++k ) { + for ( int j = 0; j < T1; ++j ) { + for ( int i = 0; i < T0; ++i ) { + v(ti*T0 + i, tj*T1+j, tk*T2 + k) = ( ti + tj*NT0 + tk*N0*N1 )*FT + ( i + j*T0 + k*T0*T1 ); + } } } + } } } + + // copy to device + Kokkos::deep_copy(dv, v); + + Kokkos::MDRangePolicy< Kokkos::Rank<3, Kokkos::Iterate::Left, Kokkos::Iterate::Left>, ExecSpace > mdrangepolicy( {0,0,0}, {N0,N1,N2}, {T0,T1,T2} ); + + // iterate by tile + Kokkos::parallel_for( "ViewTile rank 3 LL", mdrangepolicy, + KOKKOS_LAMBDA (const int i, const int j, const int k) { + dv(i,j,k) += 1; + }); + + Kokkos::deep_copy(v, dv); + + long counter_subview = 0; + long counter_inc = 0; + + for ( int tk = 0; tk < NT2; ++tk ) { + for ( int tj = 0; tj < NT1; ++tj ) { + for ( int ti = 0; ti < NT0; ++ti ) { + auto tile_subview = Kokkos::tile_subview( v, ti, tj, tk ); + for ( int k = 0; k < T2; ++k ) { + for ( int j = 0; j < T1; ++j ) { + for ( int i = 0; i < T0; ++i ) { + if ( tile_subview(i,j,k) != v(ti*T0+i, tj*T1+j, tk*T2+k) ) { ++counter_subview; } + if ( tile_subview(i,j,k) != ( ( ti + tj*NT0 + tk*N0*N1 )*FT + ( i + j*T0 + k*T0*T1 ) + 1 ) ) { ++counter_inc; } + } } } + } } } + ASSERT_EQ(counter_subview, long(0)); + ASSERT_EQ(counter_inc, long(0)); + } // end scope + + // Create RL View + { + typedef Kokkos::View< Scalar***, LayoutRL_3D_2x4x4, ExecSpace > ViewType; + Kokkos::View< Scalar***, LayoutRL_3D_2x4x4, ExecSpace > dv("dv", N0, N1, N2); + + typename ViewType::HostMirror v = Kokkos::create_mirror_view(dv); + + // Initialize on host + for ( int ti = 0; ti < NT0; ++ti ) { + for ( int tj = 0; tj < NT1; ++tj ) { + for ( int tk = 0; tk < NT2; ++tk ) { + for ( int k = 0; k < T2; ++k ) { + for ( int j = 0; j < T1; ++j ) { + for ( int i = 0; i < T0; ++i ) { + v(ti*T0 + i, tj*T1+j, tk*T2 + k) = ( ti*NT1*NT2 + tj*NT2 + tk )*FT + ( i + j*T0 + k*T0*T1 ); + } } } + } } } + + // copy to device + Kokkos::deep_copy(dv, v); + + Kokkos::MDRangePolicy< Kokkos::Rank<3, Kokkos::Iterate::Right, Kokkos::Iterate::Left>, ExecSpace > mdrangepolicy( {0,0,0}, {N0,N1,N2}, {T0,T1,T2} ); + + // iterate by tile + Kokkos::parallel_for( "ViewTile rank 3 RL", mdrangepolicy, + KOKKOS_LAMBDA (const int i, const int j, const int k) { + dv(i,j,k) += 1; + }); + + Kokkos::deep_copy(v, dv); + + long counter_subview = 0; + long counter_inc = 0; + + for ( int ti = 0; ti < NT0; ++ti ) { + for ( int tj = 0; tj < NT1; ++tj ) { + for ( int tk = 0; tk < NT2; ++tk ) { + auto tile_subview = Kokkos::tile_subview( v, ti, tj, tk ); + for ( int k = 0; k < T2; ++k ) { + for ( int j = 0; j < T1; ++j ) { + for ( int i = 0; i < T0; ++i ) { + if ( tile_subview(i,j,k) != v(ti*T0+i, tj*T1+j, tk*T2+k) ) { ++counter_subview; } + if ( tile_subview(i,j,k) != ( ( ti*NT1*NT2 + tj*NT2 + tk )*FT + ( i + j*T0 + k*T0*T1 ) + 1 ) ) { ++counter_inc; } + } } } + } } } + ASSERT_EQ(counter_subview, long(0)); + ASSERT_EQ(counter_inc, long(0)); + } // end scope + + // Create LR View + { + typedef Kokkos::View< Scalar***, LayoutLR_3D_2x4x4, ExecSpace > ViewType; + Kokkos::View< Scalar***, LayoutLR_3D_2x4x4, ExecSpace > dv("dv", N0, N1, N2); + + typename ViewType::HostMirror v = Kokkos::create_mirror_view(dv); + + // Initialize on host + for ( int tk = 0; tk < NT2; ++tk ) { + for ( int tj = 0; tj < NT1; ++tj ) { + for ( int ti = 0; ti < NT0; ++ti ) { + for ( int i = 0; i < T0; ++i ) { + for ( int j = 0; j < T1; ++j ) { + for ( int k = 0; k < T2; ++k ) { + v(ti*T0 + i, tj*T1+j, tk*T2 + k) = ( ti + tj*NT0 + tk*NT0*NT1 )*FT + ( i*T1*T2 + j*T2 + k ); + } } } + } } } + + // copy to device + Kokkos::deep_copy(dv, v); + + Kokkos::MDRangePolicy< Kokkos::Rank<3, Kokkos::Iterate::Left, Kokkos::Iterate::Right>, ExecSpace > mdrangepolicy( {0,0,0}, {N0,N1,N2}, {T0,T1,T2} ); + + // iterate by tile + Kokkos::parallel_for( "ViewTile rank 3 LR", mdrangepolicy, + KOKKOS_LAMBDA (const int i, const int j, const int k) { + dv(i,j,k) += 1; + }); + + Kokkos::deep_copy(v, dv); + + long counter_subview = 0; + long counter_inc = 0; + + for ( int tk = 0; tk < NT2; ++tk ) { + for ( int tj = 0; tj < NT1; ++tj ) { + for ( int ti = 0; ti < NT0; ++ti ) { + auto tile_subview = Kokkos::tile_subview( v, ti, tj, tk ); + for ( int i = 0; i < T0; ++i ) { + for ( int j = 0; j < T1; ++j ) { + for ( int k = 0; k < T2; ++k ) { + if ( tile_subview(i,j,k) != v(ti*T0+i, tj*T1+j, tk*T2+k) ) { ++counter_subview; } + if ( tile_subview(i,j,k) != ( ( ti + tj*NT0 + tk*NT0*NT1 )*FT + ( i*T1*T2 + j*T2 + k ) + 1 ) ) { ++counter_inc; } + } } } + } } } + ASSERT_EQ(counter_subview, long(0)); + ASSERT_EQ(counter_inc, long(0)); + } // end scope + + // Create RR View + { + typedef Kokkos::View< Scalar***, LayoutRR_3D_2x4x4, ExecSpace > ViewType; + Kokkos::View< Scalar***, LayoutRR_3D_2x4x4, ExecSpace > dv("dv", N0, N1, N2); + + typename ViewType::HostMirror v = Kokkos::create_mirror_view(dv); + + // Initialize on host + for ( int ti = 0; ti < NT0; ++ti ) { + for ( int tj = 0; tj < NT1; ++tj ) { + for ( int tk = 0; tk < NT2; ++tk ) { + for ( int i = 0; i < T0; ++i ) { + for ( int j = 0; j < T1; ++j ) { + for ( int k = 0; k < T2; ++k ) { + v(ti*T0 + i, tj*T1+j, tk*T2 + k) = ( ti*NT1*NT2 + tj*NT2 + tk )*FT + ( i*T1*T2 + j*T2 + k ); + } } } + } } } + + // copy to device + Kokkos::deep_copy(dv, v); + + Kokkos::MDRangePolicy< Kokkos::Rank<3, Kokkos::Iterate::Right, Kokkos::Iterate::Right>, ExecSpace > mdrangepolicy( {0,0,0}, {N0,N1,N2}, {T0,T1,T2} ); + + // iterate by tile + Kokkos::parallel_for( "ViewTile rank 3 RR", mdrangepolicy, + KOKKOS_LAMBDA (const int i, const int j, const int k) { + dv(i,j,k) += 1; + }); + + Kokkos::deep_copy(v, dv); + + long counter_subview = 0; + long counter_inc = 0; + + for ( int ti = 0; ti < NT0; ++ti ) { + for ( int tj = 0; tj < NT1; ++tj ) { + for ( int tk = 0; tk < NT2; ++tk ) { + auto tile_subview = Kokkos::tile_subview( v, ti, tj, tk ); + for ( int i = 0; i < T0; ++i ) { + for ( int j = 0; j < T1; ++j ) { + for ( int k = 0; k < T2; ++k ) { + if ( tile_subview(i,j,k) != v(ti*T0+i, tj*T1+j, tk*T2+k) ) { ++counter_subview; } + if ( tile_subview(i,j,k) != ( ( ti*NT1*NT2 + tj*NT2 + tk )*FT + ( i*T1*T2 + j*T2 + k ) + 1 ) ) { ++counter_inc; } + } } } + } } } + ASSERT_EQ(counter_subview, long(0)); + ASSERT_EQ(counter_inc, long(0)); + } // end scope +#endif +#endif + } // end test_view_layout_tiled_3d + + + static void test_view_layout_tiled_4d( const int N0, const int N1, const int N2, const int N3 ) + { +#if defined( KOKKOS_ENABLE_CXX11_DISPATCH_LAMBDA ) +#if !defined(KOKKOS_ENABLE_CUDA) || ( 8000 <= CUDA_VERSION ) + const int FT = T0*T1*T2*T3; + + const int NT0 = int( std::ceil( N0 / T0 ) ); + const int NT1 = int( std::ceil( N1 / T1 ) ); + const int NT2 = int( std::ceil( N2 / T2 ) ); + const int NT3 = int( std::ceil( N3 / T3 ) ); + + // Create LL View + { + typedef Kokkos::View< Scalar****, LayoutLL_4D_2x4x4x2, ExecSpace > ViewType; + Kokkos::View< Scalar****, LayoutLL_4D_2x4x4x2, ExecSpace > dv("dv", N0, N1, N2, N3); + + typename ViewType::HostMirror v = Kokkos::create_mirror_view(dv); + + // Initialize on host + for ( int tl = 0; tl < NT3; ++tl ) { + for ( int tk = 0; tk < NT2; ++tk ) { + for ( int tj = 0; tj < NT1; ++tj ) { + for ( int ti = 0; ti < NT0; ++ti ) { + for ( int l = 0; l < T3; ++l ) { + for ( int k = 0; k < T2; ++k ) { + for ( int j = 0; j < T1; ++j ) { + for ( int i = 0; i < T0; ++i ) { + v(ti*T0 + i, tj*T1+j, tk*T2 + k, tl*T3 + l) = ( ti + tj*NT0 + tk*N0*N1 + tl*N0*N1*N2 )*FT + ( i + j*T0 + k*T0*T1 + l*T0*T1*T2 ); + } } } } + } } } } + + // copy to device + Kokkos::deep_copy(dv, v); + + Kokkos::MDRangePolicy< Kokkos::Rank<4, Kokkos::Iterate::Left, Kokkos::Iterate::Left>, ExecSpace > mdrangepolicy( {0,0,0,0}, {N0,N1,N2,N3}, {T0,T1,T2,T3} ); + + // iterate by tile + Kokkos::parallel_for( "ViewTile rank 4 LL", mdrangepolicy, + KOKKOS_LAMBDA (const int i, const int j, const int k, const int l) { + dv(i,j,k,l) += 1; + }); + + Kokkos::deep_copy(v, dv); + + long counter_subview = 0; + long counter_inc = 0; + + for ( int tl = 0; tl < NT3; ++tl ) { + for ( int tk = 0; tk < NT2; ++tk ) { + for ( int tj = 0; tj < NT1; ++tj ) { + for ( int ti = 0; ti < NT0; ++ti ) { + auto tile_subview = Kokkos::tile_subview( v, ti, tj, tk, tl ); + for ( int l = 0; l < T3; ++l ) { + for ( int k = 0; k < T2; ++k ) { + for ( int j = 0; j < T1; ++j ) { + for ( int i = 0; i < T0; ++i ) { + if ( tile_subview(i,j,k,l) != v(ti*T0+i, tj*T1+j, tk*T2+k, tl*T3 + l) ) { ++counter_subview; } + if ( tile_subview(i,j,k,l) != ( ( ti + tj*NT0 + tk*N0*N1 + tl*N0*N1*N2 )*FT + ( i + j*T0 + k*T0*T1 + l*T0*T1*T2 ) + 1 ) ) { ++counter_inc; } + } } } } + } } } } + ASSERT_EQ(counter_subview, long(0)); + ASSERT_EQ(counter_inc, long(0)); + } // end scope + + // Create RL View + { + typedef Kokkos::View< Scalar****, LayoutRL_4D_2x4x4x2, ExecSpace > ViewType; + Kokkos::View< Scalar****, LayoutRL_4D_2x4x4x2, ExecSpace > dv("dv", N0, N1, N2, N3); + + typename ViewType::HostMirror v = Kokkos::create_mirror_view(dv); + + // Initialize on host + for ( int ti = 0; ti < NT0; ++ti ) { + for ( int tj = 0; tj < NT1; ++tj ) { + for ( int tk = 0; tk < NT2; ++tk ) { + for ( int tl = 0; tl < NT3; ++tl ) { + for ( int l = 0; l < T3; ++l ) { + for ( int k = 0; k < T2; ++k ) { + for ( int j = 0; j < T1; ++j ) { + for ( int i = 0; i < T0; ++i ) { + v(ti*T0 + i, tj*T1+j, tk*T2 + k, tl*T3 + l) = ( ti*NT1*NT2*N3 + tj*NT2*N3 + tk*N3 + tl )*FT + ( i + j*T0 + k*T0*T1 + l*T0*T1*T2 ); + } } } } + } } } } + + // copy to device + Kokkos::deep_copy(dv, v); + + Kokkos::MDRangePolicy< Kokkos::Rank<4, Kokkos::Iterate::Right, Kokkos::Iterate::Left>, ExecSpace > mdrangepolicy( {0,0,0,0}, {N0,N1,N2,N3}, {T0,T1,T2,T3} ); + + // iterate by tile + Kokkos::parallel_for( "ViewTile rank 4 RL", mdrangepolicy, + KOKKOS_LAMBDA (const int i, const int j, const int k, const int l) { + dv(i,j,k,l) += 1; + }); + + Kokkos::deep_copy(v, dv); + + long counter_subview = 0; + long counter_inc = 0; + + for ( int ti = 0; ti < NT0; ++ti ) { + for ( int tj = 0; tj < NT1; ++tj ) { + for ( int tk = 0; tk < NT2; ++tk ) { + for ( int tl = 0; tl < NT3; ++tl ) { + auto tile_subview = Kokkos::tile_subview( v, ti, tj, tk, tl ); + for ( int l = 0; l < T3; ++l ) { + for ( int k = 0; k < T2; ++k ) { + for ( int j = 0; j < T1; ++j ) { + for ( int i = 0; i < T0; ++i ) { + if ( tile_subview(i,j,k,l) != v(ti*T0+i, tj*T1+j, tk*T2+k, tl*T3 + l) ) { ++counter_subview; } + if ( tile_subview(i,j,k,l) != ( ( ti*NT1*NT2*N3 + tj*NT2*N3 + tk*N3 + tl )*FT + ( i + j*T0 + k*T0*T1 + l*T0*T1*T2 ) + 1 ) ) { ++counter_inc; } + } } } } + } } } } + ASSERT_EQ(counter_subview, long(0)); + ASSERT_EQ(counter_inc, long(0)); + } // end scope + + // Create LR View + { + typedef Kokkos::View< Scalar****, LayoutLR_4D_2x4x4x2, ExecSpace > ViewType; + Kokkos::View< Scalar****, LayoutLR_4D_2x4x4x2, ExecSpace > dv("dv", N0, N1, N2, N3); + + typename ViewType::HostMirror v = Kokkos::create_mirror_view(dv); + + // Initialize on host + for ( int tl = 0; tl < NT3; ++tl ) { + for ( int tk = 0; tk < NT2; ++tk ) { + for ( int tj = 0; tj < NT1; ++tj ) { + for ( int ti = 0; ti < NT0; ++ti ) { + for ( int i = 0; i < T0; ++i ) { + for ( int j = 0; j < T1; ++j ) { + for ( int k = 0; k < T2; ++k ) { + for ( int l = 0; l < T3; ++l ) { + v(ti*T0 + i, tj*T1+j, tk*T2 + k, tl*T3 + l) = ( ti + tj*NT0 + tk*NT0*NT1 + tl*NT0*NT1*NT2 )*FT + ( i*T1*T2*T3 + j*T2*T3 + k*T3 + l ); + } } } } + } } } } + + // copy to device + Kokkos::deep_copy(dv, v); + + Kokkos::MDRangePolicy< Kokkos::Rank<4, Kokkos::Iterate::Left, Kokkos::Iterate::Right>, ExecSpace > mdrangepolicy( {0,0,0,0}, {N0,N1,N2,N3}, {T0,T1,T2,T3} ); + + // iterate by tile + Kokkos::parallel_for( "ViewTile rank 4 LR", mdrangepolicy, + KOKKOS_LAMBDA (const int i, const int j, const int k, const int l) { + dv(i,j,k,l) += 1; + }); + + Kokkos::deep_copy(v, dv); + + long counter_subview = 0; + long counter_inc = 0; + + for ( int tl = 0; tl < NT3; ++tl ) { + for ( int tk = 0; tk < NT2; ++tk ) { + for ( int tj = 0; tj < NT1; ++tj ) { + for ( int ti = 0; ti < NT0; ++ti ) { + auto tile_subview = Kokkos::tile_subview( v, ti, tj, tk, tl ); + for ( int i = 0; i < T0; ++i ) { + for ( int j = 0; j < T1; ++j ) { + for ( int k = 0; k < T2; ++k ) { + for ( int l = 0; l < T3; ++l ) { + if ( tile_subview(i,j,k,l) != v(ti*T0+i, tj*T1+j, tk*T2+k, tl*T3 + l) ) { ++counter_subview; } + if ( tile_subview(i,j,k,l) != ( ( ti + tj*NT0 + tk*NT0*NT1 + tl*NT0*NT1*NT2 )*FT + ( i*T1*T2*T3 + j*T2*T3 + k*T3 + l ) + 1 ) ) { ++counter_inc; } + } } } } + } } } } + ASSERT_EQ(counter_subview, long(0)); + ASSERT_EQ(counter_inc, long(0)); + } // end scope + + // Create RR View + { + typedef Kokkos::View< Scalar****, LayoutRR_4D_2x4x4x2, ExecSpace > ViewType; + Kokkos::View< Scalar****, LayoutRR_4D_2x4x4x2, ExecSpace > dv("dv", N0, N1, N2, N3); + + typename ViewType::HostMirror v = Kokkos::create_mirror_view(dv); + + // Initialize on host + for ( int ti = 0; ti < NT0; ++ti ) { + for ( int tj = 0; tj < NT1; ++tj ) { + for ( int tk = 0; tk < NT2; ++tk ) { + for ( int tl = 0; tl < NT3; ++tl ) { + for ( int i = 0; i < T0; ++i ) { + for ( int j = 0; j < T1; ++j ) { + for ( int k = 0; k < T2; ++k ) { + for ( int l = 0; l < T3; ++l ) { + v(ti*T0 + i, tj*T1+j, tk*T2 + k, tl*T3 + l) = ( ti*NT1*NT2*NT3 + tj*NT2*NT3 + tk*NT3 + tl )*FT + ( i*T1*T2*T3 + j*T2*T3 + k*T3 + l ); + } } } } + } } } } + + // copy to device + Kokkos::deep_copy(dv, v); + + Kokkos::MDRangePolicy< Kokkos::Rank<4, Kokkos::Iterate::Right, Kokkos::Iterate::Right>, ExecSpace > mdrangepolicy( {0,0,0,0}, {N0,N1,N2,N3}, {T0,T1,T2,T3} ); + + // iterate by tile + Kokkos::parallel_for( "ViewTile rank 4 RR", mdrangepolicy, + KOKKOS_LAMBDA (const int i, const int j, const int k, const int l) { + dv(i,j,k,l) += 1; + }); + + Kokkos::deep_copy(v, dv); + + long counter_subview = 0; + long counter_inc = 0; + + + for ( int ti = 0; ti < NT0; ++ti ) { + for ( int tj = 0; tj < NT1; ++tj ) { + for ( int tk = 0; tk < NT2; ++tk ) { + for ( int tl = 0; tl < NT3; ++tl ) { + auto tile_subview = Kokkos::tile_subview( v, ti, tj, tk, tl ); + for ( int i = 0; i < T0; ++i ) { + for ( int j = 0; j < T1; ++j ) { + for ( int k = 0; k < T2; ++k ) { + for ( int l = 0; l < T3; ++l ) { + if ( tile_subview(i,j,k,l) != v(ti*T0+i, tj*T1+j, tk*T2+k, tl*T3 + l) ) { ++counter_subview; } + if ( tile_subview(i,j,k,l) != ( ( ti*NT1*NT2*NT3 + tj*NT2*NT3 + tk*NT3 + tl )*FT + ( i*T1*T2*T3 + j*T2*T3 + k*T3 + l ) + 1 ) ) { ++counter_inc; } + } } } } + } } } } + ASSERT_EQ(counter_subview, long(0)); + ASSERT_EQ(counter_inc, long(0)); + } // end scope +#endif +#endif + } // end test_view_layout_tiled_4d + + + static void test_view_layout_tiled_subtile_2d( const int N0, const int N1 ) + { + const int FT = T0*T1; + + const int NT0 = int( std::ceil( N0 / T0 ) ); + const int NT1 = int( std::ceil( N1 / T1 ) ); + + // Counter to check for errors at the end + long counter[4] = {0}; + + // Create LL View + { + Kokkos::View< Scalar**, LayoutLL_2D_2x4, Kokkos::HostSpace > v("v", N0, N1); + for ( int tj = 0; tj < NT1; ++tj ) { + for ( int ti = 0; ti < NT0; ++ti ) { + for ( int j = 0; j < T1; ++j ) { + for ( int i = 0; i < T0; ++i ) { + v(ti*T0 + i, tj*T1+j) = ( ti + tj*NT0 )*FT + ( i + j*T0 ); + } } + } } + + for ( int tj = 0; tj < NT1; ++tj ) { + for ( int ti = 0; ti < NT0; ++ti ) { + auto tile_subview = Kokkos::tile_subview( v, ti, tj ); + for ( int j = 0; j < T1; ++j ) { + for ( int i = 0; i < T0; ++i ) { + if ( tile_subview(i,j) != v(ti*T0+i, tj*T1+j) ) { ++counter[0]; } +#ifdef KOKKOS_VERBOSE_LAYOUTTILED_OUTPUT + std::cout << "idx0,idx1 = " << ti*T0 + i << "," << tj*T1 + j << std::endl; + std::cout << "ti,tj,i,j: " << ti << "," << tj << "," << i << "," << j << " v = " << v(ti*T0 + i, tj*T1+j) << " flat idx = " << ( ti + tj*NT0 )*FT + ( i + j*T0 ) << std::endl; + std::cout << "subview_tile output = " << tile_subview(i,j) << std::endl; +#endif + } } + } } + } // end scope + + // Create RL View + { + Kokkos::View< Scalar**, LayoutRL_2D_2x4, Kokkos::HostSpace > v("v", N0, N1); + for ( int ti = 0; ti < NT0; ++ti ) { + for ( int tj = 0; tj < NT1; ++tj ) { + for ( int j = 0; j < T1; ++j ) { + for ( int i = 0; i < T0; ++i ) { + v(ti*T0 + i, tj*T1+j) = ( ti*NT1 + tj )*FT + ( i + j*T0 ); + } } + } } + + for ( int ti = 0; ti < NT0; ++ti ) { + for ( int tj = 0; tj < NT1; ++tj ) { + auto tile_subview = Kokkos::tile_subview( v, ti, tj ); + for ( int j = 0; j < T1; ++j ) { + for ( int i = 0; i < T0; ++i ) { + if ( tile_subview(i,j) != v(ti*T0+i, tj*T1+j) ) { ++counter[1]; } +#ifdef KOKKOS_VERBOSE_LAYOUTTILED_OUTPUT + std::cout << "idx0,idx1 = " << ti*T0 + i << "," << tj*T1 + j << std::endl; + std::cout << "ti,tj,i,j: " << ti << "," << tj << "," << i << "," << j << " v = " << v(ti*T0 + i, tj*T1+j) << " flat idx = " << ( ti*NT1 + tj )*FT + ( i + j*T0 ) << std::endl; + std::cout << "subview_tile output = " << tile_subview(i,j) << std::endl; +#endif + } } + } } + } // end scope + + // Create LR View + { + Kokkos::View< Scalar**, LayoutLR_2D_2x4, Kokkos::HostSpace > v("v", N0, N1); + for ( int tj = 0; tj < NT1; ++tj ) { + for ( int ti = 0; ti < NT0; ++ti ) { + for ( int i = 0; i < T0; ++i ) { + for ( int j = 0; j < T1; ++j ) { + v(ti*T0 + i, tj*T1+j) = ( ti + tj*NT0 )*FT + ( i*T1 + j ); + } } + } } + + for ( int tj = 0; tj < NT1; ++tj ) { + for ( int ti = 0; ti < NT0; ++ti ) { + auto tile_subview = Kokkos::tile_subview( v, ti, tj ); + for ( int i = 0; i < T0; ++i ) { + for ( int j = 0; j < T1; ++j ) { + if ( tile_subview(i,j) != v(ti*T0+i, tj*T1+j) ) { ++counter[2]; } +#ifdef KOKKOS_VERBOSE_LAYOUTTILED_OUTPUT + std::cout << "idx0,idx1 = " << ti*T0 + i << "," << tj*T1 + j << std::endl; + std::cout << "ti,tj,i,j: " << ti << "," << tj << "," << i << "," << j << " v = " << v(ti*T0 + i, tj*T1+j) << " flat idx = " << ( ti + tj*NT0 )*FT + ( i*T1 + j ) << std::endl; + std::cout << "subview_tile output = " << tile_subview(i,j) << std::endl; +#endif + } } + } } + } // end scope + + // Create RR View + { + Kokkos::View< Scalar**, LayoutRR_2D_2x4, Kokkos::HostSpace > v("v", N0, N1); + for ( int ti = 0; ti < NT0; ++ti ) { + for ( int tj = 0; tj < NT1; ++tj ) { + for ( int i = 0; i < T0; ++i ) { + for ( int j = 0; j < T1; ++j ) { + v(ti*T0 + i, tj*T1+j) = ( ti*NT1 + tj )*FT + ( i*T1 + j ); + } } + } } + + for ( int ti = 0; ti < NT0; ++ti ) { + for ( int tj = 0; tj < NT1; ++tj ) { + auto tile_subview = Kokkos::tile_subview( v, ti, tj ); + for ( int i = 0; i < T0; ++i ) { + for ( int j = 0; j < T1; ++j ) { + if ( tile_subview(i,j) != v(ti*T0+i, tj*T1+j) ) { ++counter[3]; } +#ifdef KOKKOS_VERBOSE_LAYOUTTILED_OUTPUT + std::cout << "idx0,idx1 = " << ti*T0 + i << "," << tj*T1 + j << std::endl; + std::cout << "ti,tj,i,j: " << ti << "," << tj << "," << i << "," << j << " v = " << v(ti*T0 + i, tj*T1+j) << " flat idx = " << ( ti*NT1 + tj )*FT + ( i*T1 + j ) << std::endl; + std::cout << "subview_tile output = " << tile_subview(i,j) << std::endl; + std::cout << "subview tile rank = " << Kokkos::rank(tile_subview) << std::endl; +#endif + } } + } } + } // end scope + +#ifdef KOKKOS_VERBOSE_LAYOUTTILED_OUTPUT + std::cout << "subview_tile vs view errors:\n" + << " LL: " << counter[0] + << " RL: " << counter[1] + << " LR: " << counter[2] + << " RR: " << counter[3] + << std::endl; +#endif + + ASSERT_EQ(counter[0], long(0)); + ASSERT_EQ(counter[1], long(0)); + ASSERT_EQ(counter[2], long(0)); + ASSERT_EQ(counter[3], long(0)); + } // end test_view_layout_tiled_subtile_2d + + + static void test_view_layout_tiled_subtile_3d( const int N0, const int N1, const int N2 ) + { + + const int FT = T0*T1*T2; + + const int NT0 = int( std::ceil( N0 / T0 ) ); + const int NT1 = int( std::ceil( N1 / T1 ) ); + const int NT2 = int( std::ceil( N2 / T2 ) ); + + // Counter to check for errors at the end + long counter[4] = {0}; + // Create LL View + { + Kokkos::View< Scalar***, LayoutLL_3D_2x4x4, Kokkos::HostSpace > v("v", N0, N1, N2); + for ( int tk = 0; tk < NT2; ++tk ) { + for ( int tj = 0; tj < NT1; ++tj ) { + for ( int ti = 0; ti < NT0; ++ti ) { + for ( int k = 0; k < T2; ++k ) { + for ( int j = 0; j < T1; ++j ) { + for ( int i = 0; i < T0; ++i ) { + v(ti*T0 + i, tj*T1+j, tk*T2 + k) = ( ti + tj*NT0 + tk*N0*N1 )*FT + ( i + j*T0 + k*T0*T1 ); + } } } + } } } + + for ( int tk = 0; tk < NT2; ++tk ) { + for ( int tj = 0; tj < NT1; ++tj ) { + for ( int ti = 0; ti < NT0; ++ti ) { + auto tile_subview = Kokkos::tile_subview( v, ti, tj, tk ); + for ( int k = 0; k < T2; ++k ) { + for ( int j = 0; j < T1; ++j ) { + for ( int i = 0; i < T0; ++i ) { + if ( tile_subview(i,j,k) != v(ti*T0+i, tj*T1+j, tk*T2+k) ) { ++counter[0]; } +#ifdef KOKKOS_VERBOSE_LAYOUTTILED_OUTPUT + std::cout << "idx0,idx1,idx2 = " << ti*T0 + i << "," << tj*T1 + j << "," << tk*T2 + k << std::endl; + std::cout << "ti,tj,tk,i,j,k: " << ti << "," << tj << "," << tk << "," << i << "," << j << "," << k << " v = " << v(ti*T0 + i, tj*T1+j, tk*T2 + k) << " flat idx = " << ( ti + tj*NT0 + tk*N0*N1 )*FT + ( i + j*T0 + k*T0*T1 ) << std::endl; + std::cout << "subview_tile output = " << tile_subview(i,j,k) << std::endl; + std::cout << "subview tile rank = " << Kokkos::rank(tile_subview) << std::endl; +#endif + } } } + } } } + } // end scope + + // Create RL View + { + Kokkos::View< Scalar***, LayoutRL_3D_2x4x4, Kokkos::HostSpace > v("v", N0, N1, N2); + for ( int ti = 0; ti < NT0; ++ti ) { + for ( int tj = 0; tj < NT1; ++tj ) { + for ( int tk = 0; tk < NT2; ++tk ) { + for ( int k = 0; k < T2; ++k ) { + for ( int j = 0; j < T1; ++j ) { + for ( int i = 0; i < T0; ++i ) { + v(ti*T0 + i, tj*T1+j, tk*T2 + k) = ( ti*NT1*NT2 + tj*NT2 + tk )*FT + ( i + j*T0 + k*T0*T1 ); + } } } + } } } + + for ( int ti = 0; ti < NT0; ++ti ) { + for ( int tj = 0; tj < NT1; ++tj ) { + for ( int tk = 0; tk < NT2; ++tk ) { + auto tile_subview = Kokkos::tile_subview( v, ti, tj, tk ); + for ( int k = 0; k < T2; ++k ) { + for ( int j = 0; j < T1; ++j ) { + for ( int i = 0; i < T0; ++i ) { + if ( tile_subview(i,j,k) != v(ti*T0+i, tj*T1+j, tk*T2+k) ) { ++counter[1]; } +#ifdef KOKKOS_VERBOSE_LAYOUTTILED_OUTPUT + std::cout << "idx0,idx1,idx2 = " << ti*T0 + i << "," << tj*T1 + j << "," << tk*T2 + k << std::endl; + std::cout << "ti,tj,tk,i,j,k: " << ti << "," << tj << "," << tk << "," << i << "," << j << "," << k << " v = " << v(ti*T0 + i, tj*T1+j, tk*T2 + k) << " flat idx = " << ( ti*NT1*NT2 + tj*NT2 + tk )*FT + ( i + j*T0 + k*T0*T1 ) << std::endl; + std::cout << "subview_tile output = " << tile_subview(i,j,k) << std::endl; +#endif + } } } + } } } + } // end scope + + // Create LR View + { + Kokkos::View< Scalar***, LayoutLR_3D_2x4x4, Kokkos::HostSpace > v("v", N0, N1, N2); + for ( int tk = 0; tk < NT2; ++tk ) { + for ( int tj = 0; tj < NT1; ++tj ) { + for ( int ti = 0; ti < NT0; ++ti ) { + for ( int i = 0; i < T0; ++i ) { + for ( int j = 0; j < T1; ++j ) { + for ( int k = 0; k < T2; ++k ) { + v(ti*T0 + i, tj*T1+j, tk*T2 + k) = ( ti + tj*NT0 + tk*NT0*NT1 )*FT + ( i*T1*T2 + j*T2 + k ); + } } } + } } } + + for ( int tk = 0; tk < NT2; ++tk ) { + for ( int tj = 0; tj < NT1; ++tj ) { + for ( int ti = 0; ti < NT0; ++ti ) { + auto tile_subview = Kokkos::tile_subview( v, ti, tj, tk ); + for ( int i = 0; i < T0; ++i ) { + for ( int j = 0; j < T1; ++j ) { + for ( int k = 0; k < T2; ++k ) { + if ( tile_subview(i,j,k) != v(ti*T0+i, tj*T1+j, tk*T2+k) ) { ++counter[2]; } +#ifdef KOKKOS_VERBOSE_LAYOUTTILED_OUTPUT + std::cout << "idx0,idx1,idx2 = " << ti*T0 + i << "," << tj*T1 + j << "," << tk*T2 + k << std::endl; + std::cout << "ti,tj,tk,i,j,k: " << ti << "," << tj << "," << tk << "," << i << "," << j << "," << k << " v = " << v(ti*T0 + i, tj*T1+j, tk*T2 + k) << " flat idx = " << ( ti + tj*NT0 + tk*NT0*NT1 )*FT + ( i*T1*T2 + j*T2 + k ) << std::endl; + std::cout << "subview_tile output = " << tile_subview(i,j,k) << std::endl; + std::cout << "subview tile rank = " << Kokkos::rank(tile_subview) << std::endl; +#endif + } } } + } } } + } // end scope + + // Create RR View + { + Kokkos::View< Scalar***, LayoutRR_3D_2x4x4, Kokkos::HostSpace > v("v", N0, N1, N2); + for ( int ti = 0; ti < NT0; ++ti ) { + for ( int tj = 0; tj < NT1; ++tj ) { + for ( int tk = 0; tk < NT2; ++tk ) { + for ( int i = 0; i < T0; ++i ) { + for ( int j = 0; j < T1; ++j ) { + for ( int k = 0; k < T2; ++k ) { + v(ti*T0 + i, tj*T1+j, tk*T2 + k) = ( ti*NT1*NT2 + tj*NT2 + tk )*FT + ( i*T1*T2 + j*T2 + k ); + } } } + } } } + + for ( int ti = 0; ti < NT0; ++ti ) { + for ( int tj = 0; tj < NT1; ++tj ) { + for ( int tk = 0; tk < NT2; ++tk ) { + auto tile_subview = Kokkos::tile_subview( v, ti, tj, tk ); + for ( int i = 0; i < T0; ++i ) { + for ( int j = 0; j < T1; ++j ) { + for ( int k = 0; k < T2; ++k ) { + if ( tile_subview(i,j,k) != v(ti*T0+i, tj*T1+j, tk*T2+k) ) { ++counter[3]; } +#ifdef KOKKOS_VERBOSE_LAYOUTTILED_OUTPUT + std::cout << "idx0,idx1,idx2 = " << ti*T0 + i << "," << tj*T1 + j << "," << tk*T2 + k << std::endl; + std::cout << "ti,tj,tk,i,j,k: " << ti << "," << tj << "," << tk << "," << i << "," << j << "," << k << " v = " << v(ti*T0 + i, tj*T1+j, tk*T2 + k) << " flat idx = " << ( ti*NT1*NT2 + tj*NT2 + tk )*FT + ( i*T1*T2 + j*T2 + k ) << std::endl; + std::cout << "subview_tile output = " << tile_subview(i,j,k) << std::endl; + std::cout << "subview tile rank = " << Kokkos::rank(tile_subview) << std::endl; +#endif + } } } + } } } + } // end scope + +#ifdef KOKKOS_VERBOSE_LAYOUTTILED_OUTPUT + std::cout << "subview_tile vs view errors:\n" + << " LL: " << counter[0] + << " RL: " << counter[1] + << " LR: " << counter[2] + << " RR: " << counter[3] + << std::endl; +#endif + + ASSERT_EQ(counter[0], long(0)); + ASSERT_EQ(counter[1], long(0)); + ASSERT_EQ(counter[2], long(0)); + ASSERT_EQ(counter[3], long(0)); + + } // end test_view_layout_tiled_subtile_3d + + + static void test_view_layout_tiled_subtile_4d( const int N0, const int N1, const int N2, const int N3 ) + { + const int FT = T0*T1*T2*T3; + + const int NT0 = int( std::ceil( N0 / T0 ) ); + const int NT1 = int( std::ceil( N1 / T1 ) ); + const int NT2 = int( std::ceil( N2 / T2 ) ); + const int NT3 = int( std::ceil( N3 / T3 ) ); + + // Counter to check for errors at the end + long counter[4] = {0}; + // Create LL View + { + Kokkos::View< Scalar****, LayoutLL_4D_2x4x4x2, Kokkos::HostSpace > v("v", N0, N1, N2, N3); + for ( int tl = 0; tl < NT3; ++tl ) { + for ( int tk = 0; tk < NT2; ++tk ) { + for ( int tj = 0; tj < NT1; ++tj ) { + for ( int ti = 0; ti < NT0; ++ti ) { + for ( int l = 0; l < T3; ++l ) { + for ( int k = 0; k < T2; ++k ) { + for ( int j = 0; j < T1; ++j ) { + for ( int i = 0; i < T0; ++i ) { + v(ti*T0 + i, tj*T1+j, tk*T2 + k, tl*T3 + l) = ( ti + tj*NT0 + tk*N0*N1 + tl*N0*N1*N2 )*FT + ( i + j*T0 + k*T0*T1 + l*T0*T1*T2 ); + } } } } + } } } } + + for ( int tl = 0; tl < NT3; ++tl ) { + for ( int tk = 0; tk < NT2; ++tk ) { + for ( int tj = 0; tj < NT1; ++tj ) { + for ( int ti = 0; ti < NT0; ++ti ) { + auto tile_subview = Kokkos::tile_subview( v, ti, tj, tk, tl ); + for ( int l = 0; l < T3; ++l ) { + for ( int k = 0; k < T2; ++k ) { + for ( int j = 0; j < T1; ++j ) { + for ( int i = 0; i < T0; ++i ) { + if ( tile_subview(i,j,k,l) != v(ti*T0+i, tj*T1+j, tk*T2+k, tl*T3 + l) ) { ++counter[0]; } +#ifdef KOKKOS_VERBOSE_LAYOUTTILED_OUTPUT + std::cout << "idx0,idx1,idx2,idx3 = " << ti*T0 + i << "," << tj*T1 + j << "," << tk*T2 + k << "," << tl*T3 + l<< std::endl; + std::cout << "ti,tj,tk,tl: " << ti << "," << tj << "," << tk << "," << tl << "," + << " i,j,k,l: " << i << "," << j << "," << k << "," << l + << " v = " << v(ti*T0 + i, tj*T1+j, tk*T2 + k, tl*T3 + l) + << " flat idx = " << ( ti + tj*NT0 + tk*N0*N1 + tl*N0*N1*N2 )*FT + ( i + j*T0 + k*T0*T1 + l*T0*T1*T2 ) << std::endl; + std::cout << "subview_tile output = " << tile_subview(i,j,k,l) << std::endl; + std::cout << "subview tile rank = " << Kokkos::rank(tile_subview) << std::endl; +#endif + } } } } + } } } } + } // end scope + + // Create RL View + { + Kokkos::View< Scalar****, LayoutRL_4D_2x4x4x2, Kokkos::HostSpace > v("v", N0, N1, N2, N3); + for ( int ti = 0; ti < NT0; ++ti ) { + for ( int tj = 0; tj < NT1; ++tj ) { + for ( int tk = 0; tk < NT2; ++tk ) { + for ( int tl = 0; tl < NT3; ++tl ) { + for ( int l = 0; l < T3; ++l ) { + for ( int k = 0; k < T2; ++k ) { + for ( int j = 0; j < T1; ++j ) { + for ( int i = 0; i < T0; ++i ) { + v(ti*T0 + i, tj*T1+j, tk*T2 + k, tl*T3 + l) = ( ti*NT1*NT2*N3 + tj*NT2*N3 + tk*N3 + tl )*FT + ( i + j*T0 + k*T0*T1 + l*T0*T1*T2 ); + } } } } + } } } } + + for ( int ti = 0; ti < NT0; ++ti ) { + for ( int tj = 0; tj < NT1; ++tj ) { + for ( int tk = 0; tk < NT2; ++tk ) { + for ( int tl = 0; tl < NT3; ++tl ) { + auto tile_subview = Kokkos::tile_subview( v, ti, tj, tk, tl ); + for ( int l = 0; l < T3; ++l ) { + for ( int k = 0; k < T2; ++k ) { + for ( int j = 0; j < T1; ++j ) { + for ( int i = 0; i < T0; ++i ) { + if ( tile_subview(i,j,k,l) != v(ti*T0+i, tj*T1+j, tk*T2+k, tl*T3 + l) ) { ++counter[1]; } +#ifdef KOKKOS_VERBOSE_LAYOUTTILED_OUTPUT + std::cout << "idx0,idx1,idx2,idx3 = " << ti*T0 + i << "," << tj*T1 + j << "," << tk*T2 + k << "," << tl*T3 + l<< std::endl; + std::cout << "ti,tj,tk,tl: " << ti << "," << tj << "," << tk << "," << tl << "," + << " i,j,k,l: " << i << "," << j << "," << k << "," << l + << " v = " << v(ti*T0 + i, tj*T1+j, tk*T2 + k, tl*T3 + l) + << " flat idx = " << ( ti*NT1*NT2*N3 + tj*NT2*N3 + tk*N3 + tl )*FT + ( i + j*T0 + k*T0*T1 + l*T0*T1*T2 ) << std::endl; + std::cout << "subview_tile output = " << tile_subview(i,j,k,l) << std::endl; + std::cout << "subview tile rank = " << Kokkos::rank(tile_subview) << std::endl; +#endif + } } } } + } } } } + } // end scope + + // Create LR View + { + Kokkos::View< Scalar****, LayoutLR_4D_2x4x4x2, Kokkos::HostSpace > v("v", N0, N1, N2, N3); + for ( int tl = 0; tl < NT3; ++tl ) { + for ( int tk = 0; tk < NT2; ++tk ) { + for ( int tj = 0; tj < NT1; ++tj ) { + for ( int ti = 0; ti < NT0; ++ti ) { + for ( int i = 0; i < T0; ++i ) { + for ( int j = 0; j < T1; ++j ) { + for ( int k = 0; k < T2; ++k ) { + for ( int l = 0; l < T3; ++l ) { + v(ti*T0 + i, tj*T1+j, tk*T2 + k, tl*T3 + l) = ( ti + tj*NT0 + tk*NT0*NT1 + tl*NT0*NT1*NT2 )*FT + ( i*T1*T2*T3 + j*T2*T3 + k*T3 + l ); + } } } } + } } } } + + for ( int tl = 0; tl < NT3; ++tl ) { + for ( int tk = 0; tk < NT2; ++tk ) { + for ( int tj = 0; tj < NT1; ++tj ) { + for ( int ti = 0; ti < NT0; ++ti ) { + auto tile_subview = Kokkos::tile_subview( v, ti, tj, tk, tl ); + for ( int i = 0; i < T0; ++i ) { + for ( int j = 0; j < T1; ++j ) { + for ( int k = 0; k < T2; ++k ) { + for ( int l = 0; l < T3; ++l ) { + if ( tile_subview(i,j,k,l) != v(ti*T0+i, tj*T1+j, tk*T2+k, tl*T3 + l) ) { ++counter[2]; } +#ifdef KOKKOS_VERBOSE_LAYOUTTILED_OUTPUT + std::cout << "idx0,idx1,idx2,idx3 = " << ti*T0 + i << "," << tj*T1 + j << "," << tk*T2 + k << "," << tl*T3 + l<< std::endl; + std::cout << "ti,tj,tk,tl: " << ti << "," << tj << "," << tk << "," << tl << "," + << " i,j,k,l: " << i << "," << j << "," << k << "," << l + << " v = " << v(ti*T0 + i, tj*T1+j, tk*T2 + k, tl*T3 + l) + << " flat idx = " << ( ti + tj*NT0 + tk*NT0*NT1 + tl*NT0*NT1*NT2 )*FT + ( i*T1*T2*T3 + j*T2*T3 + k*T3 + l ) << std::endl; + std::cout << "subview_tile output = " << tile_subview(i,j,k,l) << std::endl; + std::cout << "subview tile rank = " << Kokkos::rank(tile_subview) << std::endl; +#endif + } } } } + } } } } + } // end scope + + // Create RR View + { + Kokkos::View< Scalar****, LayoutRR_4D_2x4x4x2, Kokkos::HostSpace > v("v", N0, N1, N2, N3); + for ( int ti = 0; ti < NT0; ++ti ) { + for ( int tj = 0; tj < NT1; ++tj ) { + for ( int tk = 0; tk < NT2; ++tk ) { + for ( int tl = 0; tl < NT3; ++tl ) { + for ( int i = 0; i < T0; ++i ) { + for ( int j = 0; j < T1; ++j ) { + for ( int k = 0; k < T2; ++k ) { + for ( int l = 0; l < T3; ++l ) { + v(ti*T0 + i, tj*T1+j, tk*T2 + k, tl*T3 + l) = ( ti*NT1*NT2*NT3 + tj*NT2*NT3 + tk*NT3 + tl )*FT + ( i*T1*T2*T3 + j*T2*T3 + k*T3 + l ); + } } } } + } } } } + + for ( int ti = 0; ti < NT0; ++ti ) { + for ( int tj = 0; tj < NT1; ++tj ) { + for ( int tk = 0; tk < NT2; ++tk ) { + for ( int tl = 0; tl < NT3; ++tl ) { + auto tile_subview = Kokkos::tile_subview( v, ti, tj, tk, tl ); + for ( int i = 0; i < T0; ++i ) { + for ( int j = 0; j < T1; ++j ) { + for ( int k = 0; k < T2; ++k ) { + for ( int l = 0; l < T3; ++l ) { + if ( tile_subview(i,j,k,l) != v(ti*T0+i, tj*T1+j, tk*T2+k, tl*T3 + l) ) { ++counter[3]; } +#ifdef KOKKOS_VERBOSE_LAYOUTTILED_OUTPUT + std::cout << "idx0,idx1,idx2,idx3 = " << ti*T0 + i << "," << tj*T1 + j << "," << tk*T2 + k << "," << tl*T3 + l<< std::endl; + std::cout << "ti,tj,tk,tl: " << ti << "," << tj << "," << tk << "," << tl << "," + << " i,j,k,l: " << i << "," << j << "," << k << "," << l + << " v = " << v(ti*T0 + i, tj*T1+j, tk*T2 + k, tl*T3 + l) + << " flat idx = " << ( ti*NT1*NT2*NT3 + tj*NT2*NT3 + tk*NT3 + tl )*FT + ( i*T1*T2*T3 + j*T2*T3 + k*T3 + l ) << std::endl; + std::cout << "subview_tile output = " << tile_subview(i,j,k,l) << std::endl; + std::cout << "subview tile rank = " << Kokkos::rank(tile_subview) << std::endl; +#endif + } } } } + } } } } + } // end scope + +#ifdef KOKKOS_VERBOSE_LAYOUTTILED_OUTPUT + std::cout << "subview_tile vs view errors:\n" + << " LL: " << counter[0] + << " RL: " << counter[1] + << " LR: " << counter[2] + << " RR: " << counter[3] + << std::endl; +#endif + + ASSERT_EQ(counter[0], long(0)); + ASSERT_EQ(counter[1], long(0)); + ASSERT_EQ(counter[2], long(0)); + ASSERT_EQ(counter[3], long(0)); + + } // end test_view_layout_tiled_subtile_4d + +}; // end TestViewLayoutTiled struct + +} // namespace + +TEST_F( TEST_CATEGORY , view_layouttiled) { + // These two examples are iterating by tile, then within a tile - not by extents + // If N# is not a power of two, but want to iterate by tile then within a tile, need to check that mapped index is within extent + TestViewLayoutTiled< TEST_EXECSPACE >::test_view_layout_tiled_2d( 4, 12 ); + TestViewLayoutTiled< TEST_EXECSPACE >::test_view_layout_tiled_3d( 4, 12, 16 ); + TestViewLayoutTiled< TEST_EXECSPACE >::test_view_layout_tiled_4d( 4, 12, 16, 12 ); +} +TEST_F( TEST_CATEGORY , view_layouttiled_subtile) { + // These two examples are iterating by tile, then within a tile - not by extents + // If N# is not a power of two, but want to iterate by tile then within a tile, need to check that mapped index is within extent + TestViewLayoutTiled< TEST_EXECSPACE >::test_view_layout_tiled_subtile_2d( 4, 12 ); + TestViewLayoutTiled< TEST_EXECSPACE >::test_view_layout_tiled_subtile_3d( 4, 12, 16 ); + TestViewLayoutTiled< TEST_EXECSPACE >::test_view_layout_tiled_subtile_4d( 4, 12, 16, 12 ); +} +#endif +} // namespace Test diff --git a/packages/kokkos/core/unit_test/cuda/TestCudaHostPinned_ViewCopy.cpp b/packages/kokkos/core/unit_test/cuda/TestCudaHostPinned_ViewCopy.cpp new file mode 100644 index 0000000000000000000000000000000000000000..37485923555d7bbb06181d94d3182548f664906c --- /dev/null +++ b/packages/kokkos/core/unit_test/cuda/TestCudaHostPinned_ViewCopy.cpp @@ -0,0 +1,45 @@ +/* +//@HEADER +// ************************************************************************ +// +// Kokkos v. 2.0 +// Copyright (2014) Sandia Corporation +// +// Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, +// the U.S. Government retains certain rights in this software. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// +// 3. Neither the name of the Corporation nor the names of the +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY +// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE +// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) +// +// ************************************************************************ +//@HEADER +*/ + +#include <cuda/TestCudaHostPinned_Category.hpp> +#include <TestViewCopy.hpp> diff --git a/packages/kokkos/core/unit_test/cuda/TestCudaUVM_ViewCopy.cpp b/packages/kokkos/core/unit_test/cuda/TestCudaUVM_ViewCopy.cpp new file mode 100644 index 0000000000000000000000000000000000000000..b0ea67a1b5cca4254728d0cdc627725caa54dd18 --- /dev/null +++ b/packages/kokkos/core/unit_test/cuda/TestCudaUVM_ViewCopy.cpp @@ -0,0 +1,45 @@ +/* +//@HEADER +// ************************************************************************ +// +// Kokkos v. 2.0 +// Copyright (2014) Sandia Corporation +// +// Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, +// the U.S. Government retains certain rights in this software. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// +// 3. Neither the name of the Corporation nor the names of the +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY +// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE +// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) +// +// ************************************************************************ +//@HEADER +*/ + +#include <cuda/TestCudaUVM_Category.hpp> +#include <TestViewCopy.hpp> diff --git a/packages/kokkos/core/unit_test/cuda/TestCuda_Other.cpp b/packages/kokkos/core/unit_test/cuda/TestCuda_Other.cpp index f63409da29ccd1975dbed248a54724712d0afad9..788e458eea8875fefc628b78afbe4311554fd21c 100644 --- a/packages/kokkos/core/unit_test/cuda/TestCuda_Other.cpp +++ b/packages/kokkos/core/unit_test/cuda/TestCuda_Other.cpp @@ -50,3 +50,4 @@ #include<TestTile.hpp> #include<TestViewCtorPropEmbeddedDim.hpp> +#include<TestViewLayoutTiled.hpp> diff --git a/packages/kokkos/core/unit_test/cuda/TestCuda_Reductions_DeviceView.cpp b/packages/kokkos/core/unit_test/cuda/TestCuda_Reductions_DeviceView.cpp new file mode 100644 index 0000000000000000000000000000000000000000..5b340901493c8cdd64779355b80e6fc2a3bbaa65 --- /dev/null +++ b/packages/kokkos/core/unit_test/cuda/TestCuda_Reductions_DeviceView.cpp @@ -0,0 +1,45 @@ +/* +//@HEADER +// ************************************************************************ +// +// Kokkos v. 2.0 +// Copyright (2014) Sandia Corporation +// +// Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, +// the U.S. Government retains certain rights in this software. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// +// 3. Neither the name of the Corporation nor the names of the +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY +// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE +// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) +// +// ************************************************************************ +//@HEADER +*/ + +#include <cuda/TestCuda_Category.hpp> +#include <TestReduceDeviceView.hpp> diff --git a/packages/kokkos/core/unit_test/cuda/TestCuda_Team.cpp b/packages/kokkos/core/unit_test/cuda/TestCuda_Team.cpp index c633585096b8711e8d93e2a83fe92a1a3edc3e4b..3740683450d94192511701ab1a32b338d05271d9 100644 --- a/packages/kokkos/core/unit_test/cuda/TestCuda_Team.cpp +++ b/packages/kokkos/core/unit_test/cuda/TestCuda_Team.cpp @@ -68,6 +68,22 @@ TEST_F( TEST_CATEGORY, team_reduce ) TestTeamPolicy< TEST_EXECSPACE, Kokkos::Schedule<Kokkos::Static> >::test_reduce( 1000 ); TestTeamPolicy< TEST_EXECSPACE, Kokkos::Schedule<Kokkos::Dynamic> >::test_reduce( 1000 ); } + +TEST_F( TEST_CATEGORY, team_broadcast ) +{ + TestTeamBroadcast< TEST_EXECSPACE, Kokkos::Schedule<Kokkos::Static> >::test_teambroadcast( 0 ); + TestTeamBroadcast< TEST_EXECSPACE, Kokkos::Schedule<Kokkos::Dynamic> >::test_teambroadcast( 0 ); + + TestTeamBroadcast< TEST_EXECSPACE, Kokkos::Schedule<Kokkos::Static> >::test_teambroadcast( 2 ); + TestTeamBroadcast< TEST_EXECSPACE, Kokkos::Schedule<Kokkos::Dynamic> >::test_teambroadcast( 2 ); + + TestTeamBroadcast< TEST_EXECSPACE, Kokkos::Schedule<Kokkos::Static> >::test_teambroadcast( 16 ); + TestTeamBroadcast< TEST_EXECSPACE, Kokkos::Schedule<Kokkos::Dynamic> >::test_teambroadcast( 16 ); + + TestTeamBroadcast< TEST_EXECSPACE, Kokkos::Schedule<Kokkos::Static> >::test_teambroadcast( 1000 ); + TestTeamBroadcast< TEST_EXECSPACE, Kokkos::Schedule<Kokkos::Dynamic> >::test_teambroadcast( 1000 ); +} + } #include <TestTeamVector.hpp> diff --git a/packages/kokkos/core/unit_test/cuda/TestCuda_TeamScratch.cpp b/packages/kokkos/core/unit_test/cuda/TestCuda_TeamScratch.cpp index 879633b0c85834fe06268e01639e01e15d8c77f4..dcb6896b8f67dfec67a0c3485140438d0607da73 100644 --- a/packages/kokkos/core/unit_test/cuda/TestCuda_TeamScratch.cpp +++ b/packages/kokkos/core/unit_test/cuda/TestCuda_TeamScratch.cpp @@ -65,6 +65,10 @@ TEST_F( TEST_CATEGORY, team_lambda_shared_request ) TestLambdaSharedTeam< Kokkos::HostSpace, TEST_EXECSPACE, Kokkos::Schedule<Kokkos::Static> >(); TestLambdaSharedTeam< Kokkos::HostSpace, TEST_EXECSPACE, Kokkos::Schedule<Kokkos::Dynamic> >(); } + +TEST_F( TEST_CATEGORY, scratch_align) { + TestScratchAlignment< TEST_EXECSPACE >(); +} #endif #endif diff --git a/packages/kokkos/core/unit_test/cuda/TestCuda_TeamTeamSize.cpp b/packages/kokkos/core/unit_test/cuda/TestCuda_TeamTeamSize.cpp new file mode 100644 index 0000000000000000000000000000000000000000..7e61e0810b3a070a29bea04dc9bfbc9adc1a0b4f --- /dev/null +++ b/packages/kokkos/core/unit_test/cuda/TestCuda_TeamTeamSize.cpp @@ -0,0 +1,45 @@ +/* +//@HEADER +// ************************************************************************ +// +// Kokkos v. 2.0 +// Copyright (2014) Sandia Corporation +// +// Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, +// the U.S. Government retains certain rights in this software. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// +// 3. Neither the name of the Corporation nor the names of the +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY +// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE +// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) +// +// ************************************************************************ +//@HEADER +*/ + +#include <cuda/TestCuda_Category.hpp> +#include <TestTeamTeamSize.hpp> diff --git a/packages/kokkos/core/unit_test/cuda/TestCuda_ViewLayoutStrideAssignment.cpp b/packages/kokkos/core/unit_test/cuda/TestCuda_ViewLayoutStrideAssignment.cpp new file mode 100644 index 0000000000000000000000000000000000000000..2732cd4baa107c79f1b2743e0c057f1cec094b99 --- /dev/null +++ b/packages/kokkos/core/unit_test/cuda/TestCuda_ViewLayoutStrideAssignment.cpp @@ -0,0 +1,46 @@ +/* +//@HEADER +// ************************************************************************ +// +// Kokkos v. 2.0 +// Copyright (2014) Sandia Corporation +// +// Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, +// the U.S. Government retains certain rights in this software. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// +// 3. Neither the name of the Corporation nor the names of the +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY +// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE +// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) +// +// ************************************************************************ +//@HEADER +*/ + +#include <cuda/TestCuda_Category.hpp> +#include <TestViewLayoutStrideAssignment.hpp> + diff --git a/packages/kokkos/core/unit_test/openmp/TestOpenMP_Other.cpp b/packages/kokkos/core/unit_test/openmp/TestOpenMP_Other.cpp index 566891bb354b38b8460ed47f99144d026655e3a0..0ddd67acf90965e9e414418d45b49ba0b3c3876c 100644 --- a/packages/kokkos/core/unit_test/openmp/TestOpenMP_Other.cpp +++ b/packages/kokkos/core/unit_test/openmp/TestOpenMP_Other.cpp @@ -50,6 +50,7 @@ #include<TestTile.hpp> #include<TestViewCtorPropEmbeddedDim.hpp> +#include<TestViewLayoutTiled.hpp> #include <mutex> diff --git a/packages/kokkos/core/unit_test/openmp/TestOpenMP_Reductions_DeviceView.cpp b/packages/kokkos/core/unit_test/openmp/TestOpenMP_Reductions_DeviceView.cpp new file mode 100644 index 0000000000000000000000000000000000000000..99fe5842cb8c179cc4153092bba86cecf8aaa2aa --- /dev/null +++ b/packages/kokkos/core/unit_test/openmp/TestOpenMP_Reductions_DeviceView.cpp @@ -0,0 +1,45 @@ +/* +//@HEADER +// ************************************************************************ +// +// Kokkos v. 2.0 +// Copyright (2014) Sandia Corporation +// +// Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, +// the U.S. Government retains certain rights in this software. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// +// 3. Neither the name of the Corporation nor the names of the +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY +// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE +// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) +// +// ************************************************************************ +//@HEADER +*/ + +#include <openmp/TestOpenMP_Category.hpp> +#include <TestReduceDeviceView.hpp> diff --git a/packages/kokkos/core/unit_test/openmp/TestOpenMP_Team.cpp b/packages/kokkos/core/unit_test/openmp/TestOpenMP_Team.cpp index 790ea9e6da2974ed2d1081d313b4e00cd48b949e..e5b900ac5836e5708e83a58a7fd5016e6700fd73 100644 --- a/packages/kokkos/core/unit_test/openmp/TestOpenMP_Team.cpp +++ b/packages/kokkos/core/unit_test/openmp/TestOpenMP_Team.cpp @@ -68,6 +68,21 @@ TEST_F( TEST_CATEGORY, team_reduce ) TestTeamPolicy< TEST_EXECSPACE, Kokkos::Schedule<Kokkos::Static> >::test_reduce( 1000 ); TestTeamPolicy< TEST_EXECSPACE, Kokkos::Schedule<Kokkos::Dynamic> >::test_reduce( 1000 ); } + +TEST_F( TEST_CATEGORY, team_broadcast ) +{ + TestTeamBroadcast< TEST_EXECSPACE, Kokkos::Schedule<Kokkos::Static> >::test_teambroadcast( 0 ); + TestTeamBroadcast< TEST_EXECSPACE, Kokkos::Schedule<Kokkos::Dynamic> >::test_teambroadcast( 0 ); + + TestTeamBroadcast< TEST_EXECSPACE, Kokkos::Schedule<Kokkos::Static> >::test_teambroadcast( 2 ); + TestTeamBroadcast< TEST_EXECSPACE, Kokkos::Schedule<Kokkos::Dynamic> >::test_teambroadcast( 2 ); + + TestTeamBroadcast< TEST_EXECSPACE, Kokkos::Schedule<Kokkos::Static> >::test_teambroadcast( 16 ); + TestTeamBroadcast< TEST_EXECSPACE, Kokkos::Schedule<Kokkos::Dynamic> >::test_teambroadcast( 16 ); + + TestTeamBroadcast< TEST_EXECSPACE, Kokkos::Schedule<Kokkos::Static> >::test_teambroadcast( 1000 ); + TestTeamBroadcast< TEST_EXECSPACE, Kokkos::Schedule<Kokkos::Dynamic> >::test_teambroadcast( 1000 ); +} } #include <TestTeamVector.hpp> diff --git a/packages/kokkos/core/unit_test/openmp/TestOpenMP_TeamScratch.cpp b/packages/kokkos/core/unit_test/openmp/TestOpenMP_TeamScratch.cpp index f57da139a62614a5aa1dace9244f697c10514c6e..64d757533983eeb1893703ea9ebb6a856de8aa2a 100644 --- a/packages/kokkos/core/unit_test/openmp/TestOpenMP_TeamScratch.cpp +++ b/packages/kokkos/core/unit_test/openmp/TestOpenMP_TeamScratch.cpp @@ -65,6 +65,9 @@ TEST_F( TEST_CATEGORY, team_lambda_shared_request ) TestLambdaSharedTeam< Kokkos::HostSpace, TEST_EXECSPACE, Kokkos::Schedule<Kokkos::Static> >(); TestLambdaSharedTeam< Kokkos::HostSpace, TEST_EXECSPACE, Kokkos::Schedule<Kokkos::Dynamic> >(); } +TEST_F( TEST_CATEGORY, scratch_align) { + TestScratchAlignment< TEST_EXECSPACE >(); +} #endif #endif diff --git a/packages/kokkos/core/unit_test/openmp/TestOpenMP_TeamTeamSize.cpp b/packages/kokkos/core/unit_test/openmp/TestOpenMP_TeamTeamSize.cpp new file mode 100644 index 0000000000000000000000000000000000000000..a98728f02c53b9d49022ab35e6cdf0a6b4309aab --- /dev/null +++ b/packages/kokkos/core/unit_test/openmp/TestOpenMP_TeamTeamSize.cpp @@ -0,0 +1,46 @@ +/* +//@HEADER +// ************************************************************************ +// +// Kokkos v. 2.0 +// Copyright (2014) Sandia Corporation +// +// Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, +// the U.S. Government retains certain rights in this software. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// +// 3. Neither the name of the Corporation nor the names of the +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY +// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE +// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) +// +// ************************************************************************ +//@HEADER +*/ + +#include <openmp/TestOpenMP_Category.hpp> +#include <TestTeamTeamSize.hpp> + diff --git a/packages/kokkos/core/unit_test/openmp/TestOpenMP_ViewLayoutStrideAssignment.cpp b/packages/kokkos/core/unit_test/openmp/TestOpenMP_ViewLayoutStrideAssignment.cpp new file mode 100644 index 0000000000000000000000000000000000000000..81b296d15db472869dfb9d2c7c3573a70894f75e --- /dev/null +++ b/packages/kokkos/core/unit_test/openmp/TestOpenMP_ViewLayoutStrideAssignment.cpp @@ -0,0 +1,46 @@ +/* +//@HEADER +// ************************************************************************ +// +// Kokkos v. 2.0 +// Copyright (2014) Sandia Corporation +// +// Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, +// the U.S. Government retains certain rights in this software. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// +// 3. Neither the name of the Corporation nor the names of the +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY +// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE +// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) +// +// ************************************************************************ +//@HEADER +*/ + +#include <openmp/TestOpenMP_Category.hpp> +#include <TestViewLayoutStrideAssignment.hpp> + diff --git a/packages/kokkos/core/unit_test/rocm/TestROCmHostPinned_ViewCopy.cpp b/packages/kokkos/core/unit_test/rocm/TestROCmHostPinned_ViewCopy.cpp new file mode 100644 index 0000000000000000000000000000000000000000..4636691d993db5257dd024f23fff81c527c0d67f --- /dev/null +++ b/packages/kokkos/core/unit_test/rocm/TestROCmHostPinned_ViewCopy.cpp @@ -0,0 +1,45 @@ +/* +//@HEADER +// ************************************************************************ +// +// Kokkos v. 2.0 +// Copyright (2014) Sandia Corporation +// +// Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, +// the U.S. Government retains certain rights in this software. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// +// 3. Neither the name of the Corporation nor the names of the +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY +// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE +// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) +// +// ************************************************************************ +//@HEADER +*/ + +#include <rocm/TestROCmHostPinned_Category.hpp> +#include <TestViewCopy.hpp> diff --git a/packages/kokkos/core/unit_test/rocm/TestROCm_Crs.cpp b/packages/kokkos/core/unit_test/rocm/TestROCm_Crs.cpp new file mode 100644 index 0000000000000000000000000000000000000000..05a90da83bc7343f1d2c2fd7486914aecdc82e7c --- /dev/null +++ b/packages/kokkos/core/unit_test/rocm/TestROCm_Crs.cpp @@ -0,0 +1,47 @@ + +/* +//@HEADER +// ************************************************************************ +// +// Kokkos v. 2.0 +// Copyright (2014) Sandia Corporation +// +// Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, +// the U.S. Government retains certain rights in this software. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// +// 3. Neither the name of the Corporation nor the names of the +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY +// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE +// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) +// +// ************************************************************************ +//@HEADER +*/ + +#include<rocm/TestROCm_Category.hpp> +#include<TestCrs.hpp> + diff --git a/packages/kokkos/core/unit_test/rocm/TestROCm_MDRangeReduce_a.cpp b/packages/kokkos/core/unit_test/rocm/TestROCm_MDRangeReduce_a.cpp new file mode 100644 index 0000000000000000000000000000000000000000..23edcbcc3122eb2a094f2cf6a51b477fc2eca340 --- /dev/null +++ b/packages/kokkos/core/unit_test/rocm/TestROCm_MDRangeReduce_a.cpp @@ -0,0 +1,54 @@ + +/* +//@HEADER +// ************************************************************************ +// +// Kokkos v. 2.0 +// Copyright (2014) Sandia Corporation +// +// Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, +// the U.S. Government retains certain rights in this software. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// +// 3. Neither the name of the Corporation nor the names of the +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY +// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE +// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) +// +// ************************************************************************ +//@HEADER +*/ + +#include<rocm/TestROCm_Category.hpp> +#include<TestMDRange.hpp> +namespace Test { + +TEST_F( TEST_CATEGORY , mdrange_5d_reduce ) { + TestMDRange_5D< TEST_EXECSPACE >::test_reduce5( 100, 10, 10, 10, 5 ); +} + +} + diff --git a/packages/kokkos/core/unit_test/rocm/TestROCm_MDRangeReduce_b.cpp b/packages/kokkos/core/unit_test/rocm/TestROCm_MDRangeReduce_b.cpp new file mode 100644 index 0000000000000000000000000000000000000000..5f02e893a93190a3d992c7e464a2afc1bb0a8c55 --- /dev/null +++ b/packages/kokkos/core/unit_test/rocm/TestROCm_MDRangeReduce_b.cpp @@ -0,0 +1,54 @@ + +/* +//@HEADER +// ************************************************************************ +// +// Kokkos v. 2.0 +// Copyright (2014) Sandia Corporation +// +// Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, +// the U.S. Government retains certain rights in this software. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// +// 3. Neither the name of the Corporation nor the names of the +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY +// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE +// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) +// +// ************************************************************************ +//@HEADER +*/ + +#include<rocm/TestROCm_Category.hpp> +#include<TestMDRange.hpp> +namespace Test { + +TEST_F( TEST_CATEGORY , mdrange_6d_reduce ) { + TestMDRange_6D< TEST_EXECSPACE >::test_reduce6( 10, 10, 10, 10, 10, 5 ); +} + +} + diff --git a/packages/kokkos/core/unit_test/rocm/TestROCm_MDRangeReduce_c.cpp b/packages/kokkos/core/unit_test/rocm/TestROCm_MDRangeReduce_c.cpp new file mode 100644 index 0000000000000000000000000000000000000000..6a84962d1673d520005c96451ca48c95b130a288 --- /dev/null +++ b/packages/kokkos/core/unit_test/rocm/TestROCm_MDRangeReduce_c.cpp @@ -0,0 +1,54 @@ + +/* +//@HEADER +// ************************************************************************ +// +// Kokkos v. 2.0 +// Copyright (2014) Sandia Corporation +// +// Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, +// the U.S. Government retains certain rights in this software. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// +// 3. Neither the name of the Corporation nor the names of the +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY +// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE +// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) +// +// ************************************************************************ +//@HEADER +*/ + +#include<rocm/TestROCm_Category.hpp> +#include<TestMDRange.hpp> +namespace Test { + +TEST_F( TEST_CATEGORY , mdrange_2d_reduce ) { + TestMDRange_2D< TEST_EXECSPACE >::test_reduce2( 100, 100 ); +} + +} + diff --git a/packages/kokkos/core/unit_test/rocm/TestROCm_MDRangeReduce_d.cpp b/packages/kokkos/core/unit_test/rocm/TestROCm_MDRangeReduce_d.cpp new file mode 100644 index 0000000000000000000000000000000000000000..c6c6ba29184b268dd0bd749c018c7bb096fedacf --- /dev/null +++ b/packages/kokkos/core/unit_test/rocm/TestROCm_MDRangeReduce_d.cpp @@ -0,0 +1,54 @@ + +/* +//@HEADER +// ************************************************************************ +// +// Kokkos v. 2.0 +// Copyright (2014) Sandia Corporation +// +// Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, +// the U.S. Government retains certain rights in this software. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// +// 3. Neither the name of the Corporation nor the names of the +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY +// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE +// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) +// +// ************************************************************************ +//@HEADER +*/ + +#include<rocm/TestROCm_Category.hpp> +#include<TestMDRange.hpp> +namespace Test { + +TEST_F( TEST_CATEGORY , mdrange_3d_reduce ) { + TestMDRange_3D< TEST_EXECSPACE >::test_reduce3( 100, 100, 5 ); +} + +} + diff --git a/packages/kokkos/core/unit_test/rocm/TestROCm_MDRangeReduce_e.cpp b/packages/kokkos/core/unit_test/rocm/TestROCm_MDRangeReduce_e.cpp new file mode 100644 index 0000000000000000000000000000000000000000..6afd8b8ecedfd99c8ce52a8b7006c88950f39b8b --- /dev/null +++ b/packages/kokkos/core/unit_test/rocm/TestROCm_MDRangeReduce_e.cpp @@ -0,0 +1,54 @@ + +/* +//@HEADER +// ************************************************************************ +// +// Kokkos v. 2.0 +// Copyright (2014) Sandia Corporation +// +// Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, +// the U.S. Government retains certain rights in this software. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// +// 3. Neither the name of the Corporation nor the names of the +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY +// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE +// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) +// +// ************************************************************************ +//@HEADER +*/ + +#include<rocm/TestROCm_Category.hpp> +#include<TestMDRange.hpp> +namespace Test { + +TEST_F( TEST_CATEGORY , mdrange_4d_reduce ) { + TestMDRange_4D< TEST_EXECSPACE >::test_reduce4( 100, 100, 10, 5 ); +} + +} + diff --git a/packages/kokkos/core/unit_test/rocm/TestROCm_SubView_c13.cpp b/packages/kokkos/core/unit_test/rocm/TestROCm_SubView_c13.cpp new file mode 100644 index 0000000000000000000000000000000000000000..03b39972a3912ba77c014187d86beb91b5e9a1a9 --- /dev/null +++ b/packages/kokkos/core/unit_test/rocm/TestROCm_SubView_c13.cpp @@ -0,0 +1,54 @@ +/* +//@HEADER +// ************************************************************************ +// +// Kokkos v. 2.0 +// Copyright (2014) Sandia Corporation +// +// Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, +// the U.S. Government retains certain rights in this software. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// +// 3. Neither the name of the Corporation nor the names of the +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY +// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE +// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) +// +// ************************************************************************ +//@HEADER +*/ + +#include <rocm/TestROCmHostPinned_Category.hpp> +#include <TestViewSubview.hpp> + +namespace Test { + +TEST_F( TEST_CATEGORY, view_test_unmanaged_subview_reset ) +{ + TestViewSubview::test_unmanaged_subview_reset< TEST_EXECSPACE >(); +} + +} // namespace Test diff --git a/packages/kokkos/core/unit_test/rocm/TestROCm_TeamReductionScan.cpp b/packages/kokkos/core/unit_test/rocm/TestROCm_TeamReductionScan.cpp index e1025f1baa140c4d95fca606a58727eedde4f86c..57887450e2abca8ac93ca70cfc6acf6b0aac14f7 100644 --- a/packages/kokkos/core/unit_test/rocm/TestROCm_TeamReductionScan.cpp +++ b/packages/kokkos/core/unit_test/rocm/TestROCm_TeamReductionScan.cpp @@ -46,7 +46,6 @@ namespace Test { -#if !defined(KOKKOS_ROCM_CLANG_WORKAROUND) TEST_F( TEST_CATEGORY, team_scan ) { TestScanTeam< TEST_EXECSPACE, Kokkos::Schedule<Kokkos::Static> >( 0 ); @@ -56,7 +55,6 @@ TEST_F( TEST_CATEGORY, team_scan ) TestScanTeam< TEST_EXECSPACE, Kokkos::Schedule<Kokkos::Static> >( 10000 ); TestScanTeam< TEST_EXECSPACE, Kokkos::Schedule<Kokkos::Dynamic> >( 10000 ); } -#endif TEST_F( TEST_CATEGORY, team_long_reduce ) { diff --git a/packages/kokkos/core/unit_test/rocm/TestROCm_TeamScratch.cpp b/packages/kokkos/core/unit_test/rocm/TestROCm_TeamScratch.cpp index 1968ab31ea0a705d97d8a8780d4cca9573174a93..c7255919d9a3910c9381a9e6a4d5594bfc2e1f6d 100644 --- a/packages/kokkos/core/unit_test/rocm/TestROCm_TeamScratch.cpp +++ b/packages/kokkos/core/unit_test/rocm/TestROCm_TeamScratch.cpp @@ -65,6 +65,10 @@ TEST_F( TEST_CATEGORY, team_lambda_shared_request ) TestLambdaSharedTeam< Kokkos::HostSpace, TEST_EXECSPACE, Kokkos::Schedule<Kokkos::Static> >(); TestLambdaSharedTeam< Kokkos::HostSpace, TEST_EXECSPACE, Kokkos::Schedule<Kokkos::Dynamic> >(); } + +TEST_F( TEST_CATEGORY, scratch_align) { + TestScratchAlignment< TEST_EXECSPACE >(); +} #endif #endif diff --git a/packages/kokkos/core/unit_test/rocm/TestROCm_TeamTeamSize.cpp b/packages/kokkos/core/unit_test/rocm/TestROCm_TeamTeamSize.cpp new file mode 100644 index 0000000000000000000000000000000000000000..583e01fcb66eab7c3eea6d4d2eb874835f79a284 --- /dev/null +++ b/packages/kokkos/core/unit_test/rocm/TestROCm_TeamTeamSize.cpp @@ -0,0 +1,49 @@ +/* +//@HEADER +// ************************************************************************ +// +// Kokkos v. 2.0 +// Copyright (2014) Sandia Corporation +// +// Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, +// the U.S. Government retains certain rights in this software. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// +// 3. Neither the name of the Corporation nor the names of the +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY +// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE +// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) +// +// ************************************************************************ +//@HEADER +*/ + +// Doesn't work right now due to bug with static sized array member + +//#include <rocm/TestROCm_Category.hpp> +//#ifndef KOKKOS_IMPL_ROCM_CLANG_WORKAROUND +//#include <TestTeamTeamSize.hpp> +//#endif diff --git a/packages/kokkos/core/unit_test/serial/TestSerial_Other.cpp b/packages/kokkos/core/unit_test/serial/TestSerial_Other.cpp index 0c3bae3774446b0d76f75ebdc5ccec89b0f9a4c5..26a218c5c19742d6dc0124c56f39422ef3884a1b 100644 --- a/packages/kokkos/core/unit_test/serial/TestSerial_Other.cpp +++ b/packages/kokkos/core/unit_test/serial/TestSerial_Other.cpp @@ -50,3 +50,4 @@ #include<TestTile.hpp> #include<TestViewCtorPropEmbeddedDim.hpp> +#include<TestViewLayoutTiled.hpp> diff --git a/packages/kokkos/core/unit_test/serial/TestSerial_Reductions_DeviceView.cpp b/packages/kokkos/core/unit_test/serial/TestSerial_Reductions_DeviceView.cpp new file mode 100644 index 0000000000000000000000000000000000000000..1c20670c285cc066895e6e3e5443d6f0b897fc56 --- /dev/null +++ b/packages/kokkos/core/unit_test/serial/TestSerial_Reductions_DeviceView.cpp @@ -0,0 +1,45 @@ +/* +//@HEADER +// ************************************************************************ +// +// Kokkos v. 2.0 +// Copyright (2014) Sandia Corporation +// +// Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, +// the U.S. Government retains certain rights in this software. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// +// 3. Neither the name of the Corporation nor the names of the +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY +// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE +// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) +// +// ************************************************************************ +//@HEADER +*/ + +#include <serial/TestSerial_Category.hpp> +#include <TestReduceDeviceView.hpp> diff --git a/packages/kokkos/core/unit_test/serial/TestSerial_Team.cpp b/packages/kokkos/core/unit_test/serial/TestSerial_Team.cpp index 619cb727ac9e94e257c5bdc8298e34e136295bf2..47d02f70010649a0ebcd5b9ff543f1a6979370ef 100644 --- a/packages/kokkos/core/unit_test/serial/TestSerial_Team.cpp +++ b/packages/kokkos/core/unit_test/serial/TestSerial_Team.cpp @@ -68,6 +68,21 @@ TEST_F( TEST_CATEGORY, team_reduce ) TestTeamPolicy< TEST_EXECSPACE, Kokkos::Schedule<Kokkos::Static> >::test_reduce( 1000 ); TestTeamPolicy< TEST_EXECSPACE, Kokkos::Schedule<Kokkos::Dynamic> >::test_reduce( 1000 ); } + +TEST_F( TEST_CATEGORY, team_broadcast ) +{ + TestTeamBroadcast< TEST_EXECSPACE, Kokkos::Schedule<Kokkos::Static> >::test_teambroadcast( 0 ); + TestTeamBroadcast< TEST_EXECSPACE, Kokkos::Schedule<Kokkos::Dynamic> >::test_teambroadcast( 0 ); + + TestTeamBroadcast< TEST_EXECSPACE, Kokkos::Schedule<Kokkos::Static> >::test_teambroadcast( 2 ); + TestTeamBroadcast< TEST_EXECSPACE, Kokkos::Schedule<Kokkos::Dynamic> >::test_teambroadcast( 2 ); + + TestTeamBroadcast< TEST_EXECSPACE, Kokkos::Schedule<Kokkos::Static> >::test_teambroadcast( 16 ); + TestTeamBroadcast< TEST_EXECSPACE, Kokkos::Schedule<Kokkos::Dynamic> >::test_teambroadcast( 16 ); + + TestTeamBroadcast< TEST_EXECSPACE, Kokkos::Schedule<Kokkos::Static> >::test_teambroadcast( 1000 ); + TestTeamBroadcast< TEST_EXECSPACE, Kokkos::Schedule<Kokkos::Dynamic> >::test_teambroadcast( 1000 ); +} } #include <TestTeamVector.hpp> diff --git a/packages/kokkos/core/unit_test/serial/TestSerial_TeamScratch.cpp b/packages/kokkos/core/unit_test/serial/TestSerial_TeamScratch.cpp index 963908c92d76b63904128cb7b1bb355ed708aecc..029999ab724c2de6fb058ef851c45672f17fc150 100644 --- a/packages/kokkos/core/unit_test/serial/TestSerial_TeamScratch.cpp +++ b/packages/kokkos/core/unit_test/serial/TestSerial_TeamScratch.cpp @@ -65,6 +65,10 @@ TEST_F( TEST_CATEGORY, team_lambda_shared_request ) TestLambdaSharedTeam< Kokkos::HostSpace, TEST_EXECSPACE, Kokkos::Schedule<Kokkos::Static> >(); TestLambdaSharedTeam< Kokkos::HostSpace, TEST_EXECSPACE, Kokkos::Schedule<Kokkos::Dynamic> >(); } + +TEST_F( TEST_CATEGORY, scratch_align) { + TestScratchAlignment< TEST_EXECSPACE >(); +} #endif #endif diff --git a/packages/kokkos/core/unit_test/serial/TestSerial_TeamTeamSize.cpp b/packages/kokkos/core/unit_test/serial/TestSerial_TeamTeamSize.cpp new file mode 100644 index 0000000000000000000000000000000000000000..53451b30c9150a43058e596cf7b84d922e02e25d --- /dev/null +++ b/packages/kokkos/core/unit_test/serial/TestSerial_TeamTeamSize.cpp @@ -0,0 +1,45 @@ +/* +//@HEADER +// ************************************************************************ +// +// Kokkos v. 2.0 +// Copyright (2014) Sandia Corporation +// +// Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, +// the U.S. Government retains certain rights in this software. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// +// 3. Neither the name of the Corporation nor the names of the +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY +// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE +// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) +// +// ************************************************************************ +//@HEADER +*/ + +#include <serial/TestSerial_Category.hpp> +#include <TestTeamTeamSize.hpp> diff --git a/packages/kokkos/core/unit_test/serial/TestSerial_ViewLayoutStrideAssignment.cpp b/packages/kokkos/core/unit_test/serial/TestSerial_ViewLayoutStrideAssignment.cpp new file mode 100644 index 0000000000000000000000000000000000000000..64c5b642d89684c50de597002c75a7f2a7c04104 --- /dev/null +++ b/packages/kokkos/core/unit_test/serial/TestSerial_ViewLayoutStrideAssignment.cpp @@ -0,0 +1,46 @@ +/* +//@HEADER +// ************************************************************************ +// +// Kokkos v. 2.0 +// Copyright (2014) Sandia Corporation +// +// Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, +// the U.S. Government retains certain rights in this software. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// +// 3. Neither the name of the Corporation nor the names of the +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY +// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE +// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) +// +// ************************************************************************ +//@HEADER +*/ + +#include <serial/TestSerial_Category.hpp> +#include <TestViewLayoutStrideAssignment.hpp> + diff --git a/packages/kokkos/core/unit_test/standalone/Makefile b/packages/kokkos/core/unit_test/standalone/Makefile new file mode 100644 index 0000000000000000000000000000000000000000..f8a75616c5bdd4cd3ba672dd36d293049486149f --- /dev/null +++ b/packages/kokkos/core/unit_test/standalone/Makefile @@ -0,0 +1,55 @@ +KOKKOS_DEVICES=Cuda +KOKKOS_CUDA_OPTIONS=enable_lambda +KOKKOS_ARCH = "SNB,Kepler35" + +MAKEFILE_PATH := $(subst Makefile,,$(abspath $(lastword $(MAKEFILE_LIST)))) + +ifndef KOKKOS_PATH + KOKKOS_PATH = $(MAKEFILE_PATH)../../../ +endif + +SRC = $(wildcard $(MAKEFILE_PATH)*.cpp) +HEADERS = $(wildcard $(MAKEFILE_PATH)*.hpp) +HEADERS = $(wildcard $(MAKEFILE_PATH)/../*.hpp) + +vpath %.cpp $(sort $(dir $(SRC))) + +default: build + echo "Start Build" + +ifneq (,$(findstring Cuda,$(KOKKOS_DEVICES))) +CXX = ${KOKKOS_PATH}/bin/nvcc_wrapper +EXE = test.cuda +else +CXX = g++ +EXE = test.host +endif + +CXXFLAGS ?= -O3 -g +override CXXFLAGS += -I$(MAKEFILE_PATH) -I$(KOKKOS_PATH)/core/unit_test -I$(KOKKOS_PATH)/tpls/gtest -DTESTFILE=$(TESTFILE) +#SRC += $(KOKKOS_PATH)/tpls/gtest/gtest/gtest-all.cc + +DEPFLAGS = -M +LINK = ${CXX} +LINKFLAGS = + +OBJ = $(notdir $(SRC:.cpp=.o)) +LIB = + +include $(KOKKOS_PATH)/Makefile.kokkos + +build: $(EXE) + +$(EXE): $(OBJ) $(KOKKOS_LINK_DEPENDS) gtest-all.o + $(LINK) $(KOKKOS_LDFLAGS) $(LINKFLAGS) $(EXTRA_PATH) $(OBJ) $(KOKKOS_LIBS) $(LIB) gtest-all.o -o $(EXE) + +clean: kokkos-clean + rm -f *.o *.cuda *.host + +# Compilation rules + +%.o:%.cpp $(KOKKOS_CPP_DEPENDS) $(HEADERS) + $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) $(EXTRA_INC) -c $< -o $(notdir $@) + +gtest-all.o:$(KOKKOS_PATH)/tpls/gtest/gtest/gtest-all.cc + $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) $(EXTRA_INC) -c $(KOKKOS_PATH)/tpls/gtest/gtest/gtest-all.cc diff --git a/packages/kokkos/core/unit_test/standalone/UnitTestMainInit.cpp b/packages/kokkos/core/unit_test/standalone/UnitTestMainInit.cpp new file mode 100644 index 0000000000000000000000000000000000000000..2db51658cd6bd9f7d3e514a6666a59968806863c --- /dev/null +++ b/packages/kokkos/core/unit_test/standalone/UnitTestMainInit.cpp @@ -0,0 +1,71 @@ +/* +//@HEADER +// ************************************************************************ +// +// Kokkos v. 2.0 +// Copyright (2014) Sandia Corporation +// +// Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, +// the U.S. Government retains certain rights in this software. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// +// 3. Neither the name of the Corporation nor the names of the +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY +// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE +// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) +// +// ************************************************************************ +//@HEADER +*/ + +#include <gtest/gtest.h> +#include <cstdlib> + +#include <Kokkos_Core.hpp> + +#ifdef KOKKOS_ENABLE_ROCM +#include <rocm/TestROCm_Category.hpp> +#endif +#ifdef KOKKOS_ENABLE_CUDA +#include <cuda/TestCuda_Category.hpp> +#endif +#ifdef KOKKOS_ENABLE_OPENMP +#include <openmp/TestOpenMP_Category.hpp> +#endif +#ifdef KOKKOS_ENABLE_THREADS +#include <threads/TestThreads_Category.hpp> +#endif + +#include <TestMemoryPool.hpp> + +int main( int argc, char *argv[] ) { + Kokkos::initialize(argc,argv); + ::testing::InitGoogleTest( &argc, argv ); + + int result = RUN_ALL_TESTS(); + Kokkos::finalize(); + return result; +} diff --git a/packages/kokkos/core/unit_test/threads/TestThreads_Other.cpp b/packages/kokkos/core/unit_test/threads/TestThreads_Other.cpp index a0c8b4159735bbd90d6fd896a7d3f5c18efde241..13786aa4a6729813e714eca23cf2cfbe12280b63 100644 --- a/packages/kokkos/core/unit_test/threads/TestThreads_Other.cpp +++ b/packages/kokkos/core/unit_test/threads/TestThreads_Other.cpp @@ -50,3 +50,4 @@ #include<TestTile.hpp> #include<TestViewCtorPropEmbeddedDim.hpp> +#include<TestViewLayoutTiled.hpp> diff --git a/packages/kokkos/core/unit_test/threads/TestThreads_Reductions_DeviceView.cpp b/packages/kokkos/core/unit_test/threads/TestThreads_Reductions_DeviceView.cpp new file mode 100644 index 0000000000000000000000000000000000000000..28f4b7d579d9d3701cdbd59a76be8ae9f8e10e97 --- /dev/null +++ b/packages/kokkos/core/unit_test/threads/TestThreads_Reductions_DeviceView.cpp @@ -0,0 +1,45 @@ +/* +//@HEADER +// ************************************************************************ +// +// Kokkos v. 2.0 +// Copyright (2014) Sandia Corporation +// +// Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, +// the U.S. Government retains certain rights in this software. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// +// 3. Neither the name of the Corporation nor the names of the +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY +// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE +// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) +// +// ************************************************************************ +//@HEADER +*/ + +#include <threads/TestThreads_Category.hpp> +#include <TestReduceDeviceView.hpp> diff --git a/packages/kokkos/core/unit_test/threads/TestThreads_Team.cpp b/packages/kokkos/core/unit_test/threads/TestThreads_Team.cpp index b87c1f77d3c60384ec5f067897ee77ea75e86244..63d2509355d3742c7389811e7e3839871ca1f261 100644 --- a/packages/kokkos/core/unit_test/threads/TestThreads_Team.cpp +++ b/packages/kokkos/core/unit_test/threads/TestThreads_Team.cpp @@ -68,6 +68,21 @@ TEST_F( TEST_CATEGORY, team_reduce ) TestTeamPolicy< TEST_EXECSPACE, Kokkos::Schedule<Kokkos::Static> >::test_reduce( 1000 ); TestTeamPolicy< TEST_EXECSPACE, Kokkos::Schedule<Kokkos::Dynamic> >::test_reduce( 1000 ); } + +TEST_F( TEST_CATEGORY, team_broadcast ) +{ + TestTeamBroadcast< TEST_EXECSPACE, Kokkos::Schedule<Kokkos::Static> >::test_teambroadcast( 0 ); + TestTeamBroadcast< TEST_EXECSPACE, Kokkos::Schedule<Kokkos::Dynamic> >::test_teambroadcast( 0 ); + + TestTeamBroadcast< TEST_EXECSPACE, Kokkos::Schedule<Kokkos::Static> >::test_teambroadcast( 2 ); + TestTeamBroadcast< TEST_EXECSPACE, Kokkos::Schedule<Kokkos::Dynamic> >::test_teambroadcast( 2 ); + + TestTeamBroadcast< TEST_EXECSPACE, Kokkos::Schedule<Kokkos::Static> >::test_teambroadcast( 16 ); + TestTeamBroadcast< TEST_EXECSPACE, Kokkos::Schedule<Kokkos::Dynamic> >::test_teambroadcast( 16 ); + + TestTeamBroadcast< TEST_EXECSPACE, Kokkos::Schedule<Kokkos::Static> >::test_teambroadcast( 1000 ); + TestTeamBroadcast< TEST_EXECSPACE, Kokkos::Schedule<Kokkos::Dynamic> >::test_teambroadcast( 1000 ); +} } #include <TestTeamVector.hpp> diff --git a/packages/kokkos/core/unit_test/threads/TestThreads_TeamScratch.cpp b/packages/kokkos/core/unit_test/threads/TestThreads_TeamScratch.cpp index c07fae77c3964f59331518cfb54c1f16561e6958..d171195798441f8815a4c79630d34381fd4365a4 100644 --- a/packages/kokkos/core/unit_test/threads/TestThreads_TeamScratch.cpp +++ b/packages/kokkos/core/unit_test/threads/TestThreads_TeamScratch.cpp @@ -65,6 +65,10 @@ TEST_F( TEST_CATEGORY, team_lambda_shared_request ) TestLambdaSharedTeam< Kokkos::HostSpace, TEST_EXECSPACE, Kokkos::Schedule<Kokkos::Static> >(); TestLambdaSharedTeam< Kokkos::HostSpace, TEST_EXECSPACE, Kokkos::Schedule<Kokkos::Dynamic> >(); } + +TEST_F( TEST_CATEGORY, scratch_align) { + TestScratchAlignment< TEST_EXECSPACE >(); +} #endif #endif diff --git a/packages/kokkos/core/unit_test/threads/TestThreads_TeamTeamSize.cpp b/packages/kokkos/core/unit_test/threads/TestThreads_TeamTeamSize.cpp new file mode 100644 index 0000000000000000000000000000000000000000..b1cf4ec8752b3cf21d1336300f4f777f13b2b788 --- /dev/null +++ b/packages/kokkos/core/unit_test/threads/TestThreads_TeamTeamSize.cpp @@ -0,0 +1,47 @@ +/* +//@HEADER +// ************************************************************************ +// +// Kokkos v. 2.0 +// Copyright (2014) Sandia Corporation +// +// Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, +// the U.S. Government retains certain rights in this software. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// +// 3. Neither the name of the Corporation nor the names of the +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY +// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE +// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) +// +// ************************************************************************ +//@HEADER +*/ + +#include <threads/TestThreads_Category.hpp> +#include <TestTeamTeamSize.hpp> + + diff --git a/packages/kokkos/core/unit_test/threads/TestThreads_ViewLayoutStrideAssignment.cpp b/packages/kokkos/core/unit_test/threads/TestThreads_ViewLayoutStrideAssignment.cpp new file mode 100644 index 0000000000000000000000000000000000000000..5ddd07108b54c2a92436d42a16ddc8cf5d17c857 --- /dev/null +++ b/packages/kokkos/core/unit_test/threads/TestThreads_ViewLayoutStrideAssignment.cpp @@ -0,0 +1,46 @@ +/* +//@HEADER +// ************************************************************************ +// +// Kokkos v. 2.0 +// Copyright (2014) Sandia Corporation +// +// Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, +// the U.S. Government retains certain rights in this software. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// +// 3. Neither the name of the Corporation nor the names of the +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY +// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE +// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) +// +// ************************************************************************ +//@HEADER +*/ + +#include <threads/TestThreads_Category.hpp> +#include <TestViewLayoutStrideAssignment.hpp> + diff --git a/packages/kokkos/doc/kokkos-promotion.txt b/packages/kokkos/doc/kokkos-promotion.txt index 5a1306eccfd878dea1b751838c183401eec9195e..0aede5f328fe824cea5e61bd213fbe97b523b5a0 100644 --- a/packages/kokkos/doc/kokkos-promotion.txt +++ b/packages/kokkos/doc/kokkos-promotion.txt @@ -149,7 +149,9 @@ Step 5: This step can be done on any SEMS machine (e.g. kokkos-dev). Actually, t git clone -b kokkos-develop git@github.com:trilinos/Trilinos.git TRILINOS_PATH=$PWD/Trilinos - 5.2. Snapshot Kokkos into Trilinos - this requires python/2.7.9 and that both Trilinos and Kokkos be clean - no untracked or modified files. Run the following outside of the Kokkos and Trilinos source trees. + 5.2. Snapshot Kokkos into Trilinos - this requires python/2.7.9 and that both Trilinos and Kokkos be clean - no untracked or modified files. Run the following outside of the Kokkos and Trilinos source trees. + + * Use the master branch of Kokkos for this. module load sems-python/2.7.9 python $KOKKOS_PATH/scripts/snapshot.py $KOKKOS_PATH $TRILINOS_PATH/packages @@ -173,20 +175,22 @@ Step 5: This step can be done on any SEMS machine (e.g. kokkos-dev). Actually, t ## KokkosKernels Changelog - 5.4. Run checkin-test to push to trilinos using the CI build modules (gcc/4.9.3) - - cd $TRILINOS_PATH - mkdir CHECKIN - cd CHECKIN - nohup ../cmake/std/sems/checkin-test-sems.sh --do-all --push & - - Although Trilinos has experimental Pull Request testing, it is not good enough to replace the checkin script yet. + 5.4. Wait for Trilinos Autotester results 5.5. If there are failures, fix and backtrack. Otherwise, go to next step // -------------------------------------------------------------------------------- // -Step 6: Push Kokkos master to GitHub (requires Owner permission). +Step 6: Push Kokkos master and develop to GitHub (requires Owner permission). + 6.1. Master branch: cd KOKKOS_PATH + git checkout master git push --follow-tags origin master + + 6.2. Develop branch: First merge (--no-ff) master back into develop + cd KOKKOS_PATH + git checkout develop + git merge --no-ff maseter + git push origin develop + diff --git a/packages/kokkos/example/tutorial/Hierarchical_Parallelism/01_thread_teams/thread_teams.cpp b/packages/kokkos/example/tutorial/Hierarchical_Parallelism/01_thread_teams/thread_teams.cpp index ff3002e645d265765fa38b437fbe0711d5408d78..e8c1550fc6aa0e1c7273ef1888e9152324d84726 100644 --- a/packages/kokkos/example/tutorial/Hierarchical_Parallelism/01_thread_teams/thread_teams.cpp +++ b/packages/kokkos/example/tutorial/Hierarchical_Parallelism/01_thread_teams/thread_teams.cpp @@ -81,13 +81,22 @@ int main(int narg, char* args[]) { Kokkos::initialize(narg,args); // Launch 12 teams of the maximum number of threads per team - const team_policy policy( 12 , team_policy::team_size_max( hello_world() ) ); - + const int team_size_max = team_policy(1,1).team_size_max(hello_world(), Kokkos::ParallelReduceTag()); + const team_policy policy_a( 12 , team_size_max ); + int sum = 0; - Kokkos::parallel_reduce( policy , hello_world() , sum ); + Kokkos::parallel_reduce( policy_a , hello_world() , sum ); + + // The result will be 12*team_size_max + printf("Result A: %i == %i\n",sum, team_size_max*12); + + // In practice it is often better to let Kokkos decide on the team_size + const team_policy policy_b( 12 , Kokkos::AUTO ); - // The result will be 12*team_policy::team_size_max( hello_world()) - printf("Result %i\n",sum); + Kokkos::parallel_reduce( policy_b , hello_world() , sum ); + // The result will be 12*policy_b.team_size_recommended( hello_world(), Kokkos::ParallelReduceTag()) + const int team_size_recommended = policy_b.team_size_recommended( hello_world(), Kokkos::ParallelReduceTag()); + printf("Result B: %i %i\n",sum, team_size_recommended*12); Kokkos::finalize(); } diff --git a/packages/kokkos/example/tutorial/Hierarchical_Parallelism/02_nested_parallel_for/nested_parallel_for.cpp b/packages/kokkos/example/tutorial/Hierarchical_Parallelism/02_nested_parallel_for/nested_parallel_for.cpp index 721aab2d3e382fcb92f51f1845b9c7aaa21b0d5e..bbb1000e907a8ce65e064d054faf66f549561389 100644 --- a/packages/kokkos/example/tutorial/Hierarchical_Parallelism/02_nested_parallel_for/nested_parallel_for.cpp +++ b/packages/kokkos/example/tutorial/Hierarchical_Parallelism/02_nested_parallel_for/nested_parallel_for.cpp @@ -79,7 +79,8 @@ int main(int narg, char* args[]) { Kokkos::initialize(narg,args); // Launch 3 teams of the maximum number of threads per team - const team_policy policy( 3 , team_policy::team_size_max( hello_world() ) ); + const int team_size_max = team_policy(3,1).team_size_max( hello_world(), Kokkos::ParallelReduceTag()); + const team_policy policy( 3 , team_size_max ); int sum = 0; Kokkos::parallel_reduce( policy , hello_world() , sum ); diff --git a/packages/kokkos/example/virtual_functions/Makefile b/packages/kokkos/example/virtual_functions/Makefile new file mode 100644 index 0000000000000000000000000000000000000000..06186786c27b02d9a0cf3739e7756115ce35570b --- /dev/null +++ b/packages/kokkos/example/virtual_functions/Makefile @@ -0,0 +1,55 @@ +KOKKOS_DEVICES=Cuda +KOKKOS_CUDA_OPTIONS=enable_lambda +KOKKOS_ARCH = "SNB,Kepler35" + +#KOKKOS_DEVICES=OpenMP +#KOKKOS_CUDA_OPTIONS=enable_lambda +#KOKKOS_ARCH = "SNB" + +MAKEFILE_PATH := $(subst Makefile,,$(abspath $(lastword $(MAKEFILE_LIST)))) + +ifndef KOKKOS_PATH + KOKKOS_PATH = $(MAKEFILE_PATH)../.. +endif + +SRC = $(wildcard $(MAKEFILE_PATH)*.cpp) +HEADERS = $(wildcard $(MAKEFILE_PATH)*.hpp) + +vpath %.cpp $(sort $(dir $(SRC))) + +default: build + echo "Start Build" + +LINKFLAGS = +ifneq (,$(findstring Cuda,$(KOKKOS_DEVICES))) +CXX = ${KOKKOS_PATH}/bin/nvcc_wrapper +EXE = virtual.cuda +override LINKFLAGS += --remove-duplicate-link-files +else +CXX = g++ +EXE = virtual.host +endif + +CXXFLAGS ?= -O3 -g +override CXXFLAGS += -I$(MAKEFILE_PATH) + +DEPFLAGS = -M +LINK = ${CXX} + +OBJ = $(notdir $(SRC:.cpp=.o)) +LIB = + +include $(KOKKOS_PATH)/Makefile.kokkos + +build: $(EXE) + +$(EXE): $(OBJ) $(KOKKOS_LINK_DEPENDS) + $(LINK) $(KOKKOS_LDFLAGS) $(LINKFLAGS) $(EXTRA_PATH) $(OBJ) $(KOKKOS_LIBS) $(LIB) -o $(EXE) + +clean: kokkos-clean + rm -f *.o *.cuda *.host + +# Compilation rules + +%.o:%.cpp $(KOKKOS_CPP_DEPENDS) $(HEADERS) + $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) $(EXTRA_INC) -c $< -o $(notdir $@) diff --git a/packages/kokkos/example/virtual_functions/classes.cpp b/packages/kokkos/example/virtual_functions/classes.cpp new file mode 100644 index 0000000000000000000000000000000000000000..1b9d7cb385bb8ea7b576e7cd4fea4d7ff2434745 --- /dev/null +++ b/packages/kokkos/example/virtual_functions/classes.cpp @@ -0,0 +1,26 @@ +#include<classes.hpp> + +KOKKOS_FUNCTION +Foo::Foo() { + val = 0; +} + +KOKKOS_FUNCTION +Foo_1::Foo_1() { + val = 1; +} + +KOKKOS_FUNCTION +int Foo_1::value() { + return val; +} + +KOKKOS_FUNCTION +Foo_2::Foo_2() { + val = 2; +} + +KOKKOS_FUNCTION +int Foo_2::value() { + return val; +} diff --git a/packages/kokkos/example/virtual_functions/classes.hpp b/packages/kokkos/example/virtual_functions/classes.hpp new file mode 100644 index 0000000000000000000000000000000000000000..362c473ce6d23a6814e158127352ba6af6d6e503 --- /dev/null +++ b/packages/kokkos/example/virtual_functions/classes.hpp @@ -0,0 +1,39 @@ +#ifndef KOKKOS_EXAMPLE_VIRTUAL_FUNCTIONS_CLASSES_HPP +#define KOKKOS_EXAMPLE_VIRTUAL_FUNCTIONS_CLASSES_HPP + +#include<Kokkos_Core.hpp> + +class Foo { + protected: + int val; + public: + KOKKOS_FUNCTION + Foo(); + + KOKKOS_FUNCTION + virtual int value() { return 0; }; + + KOKKOS_FUNCTION + virtual ~Foo() {} +}; + +class Foo_1: public Foo { + public: + KOKKOS_FUNCTION + Foo_1(); + + KOKKOS_FUNCTION + int value(); +}; + +class Foo_2: public Foo { + public: + KOKKOS_FUNCTION + Foo_2(); + + KOKKOS_FUNCTION + int value(); +}; + +#endif //KOKKOS_EXAMPLE_VIRTUAL_FUNCTIONS_CLASSES_HPP + diff --git a/packages/kokkos/example/virtual_functions/main.cpp b/packages/kokkos/example/virtual_functions/main.cpp new file mode 100644 index 0000000000000000000000000000000000000000..a16e0cf73fc0ca5ad3f91f713ea63d78746f7eb6 --- /dev/null +++ b/packages/kokkos/example/virtual_functions/main.cpp @@ -0,0 +1,36 @@ +#include<classes.hpp> + +int main(int argc, char* argv[]) { + Kokkos::initialize(argc,argv); + + { + Foo* f_1 = (Foo*) Kokkos::kokkos_malloc(sizeof(Foo_1)); + Foo* f_2 = (Foo*) Kokkos::kokkos_malloc(sizeof(Foo_2)); + + Kokkos::parallel_for("CreateObjects",1, KOKKOS_LAMBDA (const int&) { + new ((Foo_1*)f_1) Foo_1(); + new ((Foo_2*)f_2) Foo_2(); + }); + + int value_1,value_2; + Kokkos::parallel_reduce("CheckValues",1, KOKKOS_LAMBDA (const int&, int& lsum) { + lsum = f_1->value(); + },value_1); + + Kokkos::parallel_reduce("CheckValues",1, KOKKOS_LAMBDA (const int&, int& lsum) { + lsum = f_2->value(); + },value_2); + + printf("Values: %i %i\n",value_1,value_2); + + Kokkos::parallel_for("DestroyObjects",1, KOKKOS_LAMBDA (const int&) { + f_1->~Foo(); + f_2->~Foo(); + }); + + Kokkos::kokkos_free(f_1); + Kokkos::kokkos_free(f_2); + } + + Kokkos::finalize(); +} diff --git a/packages/kokkos/generate_makefile.bash b/packages/kokkos/generate_makefile.bash index 4225e5b2deff8fb58483d3904826dbd2aed16c2e..34be03f9802dc5dcc4f49ec968bfb5c513094a20 100755 --- a/packages/kokkos/generate_makefile.bash +++ b/packages/kokkos/generate_makefile.bash @@ -97,12 +97,21 @@ do echo "Invalid compiler by --compiler command: '${COMPILER}'" exit fi + # ... valid compiler, ensure absolute path set + WCOMPATH=`which $COMPILER` + COMPDIR=`dirname $WCOMPATH` + COMPNAME=`basename $WCOMPATH` + COMPILER=${COMPDIR}/${COMPNAME} ;; --with-options*) KOKKOS_OPT="${key#*=}" ;; + --gcc-toolchain*) + KOKKOS_GCC_TOOLCHAIN="${key#*=}" + ;; --help) echo "Kokkos configure options:" + echo "" echo "--kokkos-path=/Path/To/Kokkos: Path to the Kokkos root directory." echo "--qthreads-path=/Path/To/Qthreads: Path to Qthreads install directory." echo " Overrides path given by --with-qthreads." @@ -171,6 +180,7 @@ do echo " " echo "--with-cuda-options=[OPT]: Additional options to CUDA:" echo " force_uvm, use_ldg, enable_lambda, rdc" + echo "--gcc-toolchain=/Path/To/GccRoot: Set the gcc toolchain to use with clang (e.g. /usr)" echo "--make-j=[NUM]: DEPRECATED: call make with appropriate" echo " -j flag" exit 0 @@ -195,7 +205,7 @@ else fi if [ "${KOKKOS_PATH}" = "${PWD}" ] || [ "${KOKKOS_PATH}" = "${PWD}/" ]; then - echo "Running generate_makefile.sh in the Kokkos root directory is not allowed" + echo "Running generate_makefile.bash in the Kokkos root directory is not allowed" exit fi @@ -204,8 +214,13 @@ KOKKOS_SRC_PATH=${KOKKOS_PATH} KOKKOS_SETTINGS="KOKKOS_SRC_PATH=${KOKKOS_SRC_PATH}" #KOKKOS_SETTINGS="KOKKOS_PATH=${KOKKOS_PATH}" +# The double [[ ]] in the elif branch is not a typo if [ ${#COMPILER} -gt 0 ]; then KOKKOS_SETTINGS="${KOKKOS_SETTINGS} CXX=${COMPILER}" +elif + [ ${#COMPILER} -eq 0 ] && [[ ${KOKKOS_DEVICES} =~ .*Cuda.* ]]; then + COMPILER="${KOKKOS_PATH}/bin/nvcc_wrapper" + KOKKOS_SETTINGS="${KOKKOS_SETTINGS} CXX=${COMPILER}" fi if [ ${#KOKKOS_DEVICES} -gt 0 ]; then @@ -265,6 +280,10 @@ if [ ${#KOKKOS_CUDA_OPT} -gt 0 ]; then KOKKOS_SETTINGS="${KOKKOS_SETTINGS} KOKKOS_CUDA_OPTIONS=${KOKKOS_CUDA_OPT}" fi +if [ ${#KOKKOS_GCC_TOOLCHAIN} -gt 0 ]; then + KOKKOS_SETTINGS="${KOKKOS_SETTINGS} KOKKOS_INTERNAL_GCC_TOOLCHAIN=${KOKKOS_GCC_TOOLCHAIN}" +fi + KOKKOS_SETTINGS_NO_KOKKOS_PATH="${KOKKOS_SETTINGS}" KOKKOS_TEST_INSTALL_PATH="${PWD}/install" @@ -276,7 +295,7 @@ fi mkdir -p install gen_makefile=Makefile.kokkos -echo "#Makefile to satisfy existens of target kokkos-clean before installing the library" > install/${gen_makefile} +echo "#Makefile to satisfy existence of target kokkos-clean before installing the library" > install/${gen_makefile} echo "kokkos-clean:" >> install/${gen_makefile} echo "" >> install/${gen_makefile} mkdir -p core diff --git a/packages/kokkos/master_history.txt b/packages/kokkos/master_history.txt index fe90cc2960cd9abe7d099a628971f1f121b5cdc3..08453309dae19de682bf9c260d29152f4eed8aaa 100644 --- a/packages/kokkos/master_history.txt +++ b/packages/kokkos/master_history.txt @@ -14,3 +14,4 @@ tag: 2.04.11 date: 10:28:2017 master: 54a1330a develop: ed36c017 tag: 2.5.00 date: 12:15:2017 master: dfe685f4 develop: ec7ad6d8 tag: 2.6.00 date: 03:07:2018 master: 62e760fa develop: d1ba7d71 tag: 2.7.00 date: 05:24:2018 master: e01945d0 develop: 2d13f608 +tag: 2.7.24 date: 11:04:2018 master: d3a94192 develop: 7a06fc81 diff --git a/packages/kokkos/scripts/eti/generate_view_copy_cpp_files_write b/packages/kokkos/scripts/eti/generate_view_copy_cpp_files_write index ffe2a593b98dc6b48eb0c15653d1ad4804fcf302..45208e76b05733a68d3527ad484ca9f954c532fc 100755 --- a/packages/kokkos/scripts/eti/generate_view_copy_cpp_files_write +++ b/packages/kokkos/scripts/eti/generate_view_copy_cpp_files_write @@ -19,8 +19,8 @@ echo "KOKKOS_IMPL_VIEWCOPY_ETI_DECL(${SCALAR_TYPE}${RANK_STARS},${LAYOUT_TYPE},L echo "KOKKOS_IMPL_VIEWFILL_ETI_DECL(${SCALAR_TYPE}${RANK_STARS},${LAYOUT_TYPE},KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE,${INDEX_TYPE})" >> common/Kokkos_ViewFillCopyETIDecl_Macros.hpp -FileName=${EXECUTION_SPACE_DIR}/Kokkos_${EXECUTION_SPACE}_ViewCopyETIInst_${INDEX_TYPE}_${SCALAR_TYPE}_${LAYOUT_TYPE}_Rank${RANK}.cpp -ObjectName=Kokkos_${EXECUTION_SPACE}_ViewCopyETIInst_${INDEX_TYPE}_${SCALAR_TYPE}_${LAYOUT_TYPE}_Rank${RANK}.o +FileName=${EXECUTION_SPACE_DIR}/Kokkos_${EXECUTION_SPACE_DIR}_ViewCopyETIInst_${INDEX_TYPE}_${SCALAR_TYPE}_${LAYOUT_TYPE}_Rank${RANK}.cpp +ObjectName=Kokkos_${EXECUTION_SPACE_DIR}_ViewCopyETIInst_${INDEX_TYPE}_${SCALAR_TYPE}_${LAYOUT_TYPE}_Rank${RANK}.o cp ${SCRIPT_PATH}/../../LICENSE ${FileName} @@ -37,5 +37,5 @@ echo "" >> ${FileName} echo "}" >> ${FileName} echo "}" >> ${FileName} -echo "${ObjectName}: \$(KOKKOS_CPP_DEPENDS) \$(KOKKOS_ETI_PATH)/${FileName}" >> ${EXECUTION_SPACE_DIR}/Makefile.eti_${EXECUTION_SPACE} -echo -e "\t\$(CXX) \$(KOKKOS_CPPFLAGS) \$(KOKKOS_CXXFLAGS) \$(CXXFLAGS) -c \$(KOKKOS_ETI_PATH)/${FileName}" >> ${EXECUTION_SPACE_DIR}/Makefile.eti_${EXECUTION_SPACE} +echo "${ObjectName}: \$(KOKKOS_CPP_DEPENDS) \$(KOKKOS_ETI_PATH)/${FileName}" >> ${EXECUTION_SPACE_DIR}/Makefile.eti_${EXECUTION_SPACE_DIR} +echo -e "\t\$(CXX) \$(KOKKOS_CPPFLAGS) \$(KOKKOS_CXXFLAGS) \$(CXXFLAGS) -c \$(KOKKOS_ETI_PATH)/${FileName}" >> ${EXECUTION_SPACE_DIR}/Makefile.eti_${EXECUTION_SPACE_DIR} diff --git a/packages/kokkos/scripts/testing_scripts/test_all_sandia b/packages/kokkos/scripts/testing_scripts/test_all_sandia new file mode 100755 index 0000000000000000000000000000000000000000..d1424ade81838fdd4da6d122f32cc4dc27332566 --- /dev/null +++ b/packages/kokkos/scripts/testing_scripts/test_all_sandia @@ -0,0 +1,790 @@ +#!/bin/bash -e + +# +# Global config +# + +set -o pipefail + +# Determine current machine. + +MACHINE="" +HOSTNAME=$(hostname) +PROCESSOR=`uname -p` + +if [[ "$HOSTNAME" =~ (white|ride).* ]]; then + MACHINE=white + module load git +fi + +if [[ "$HOSTNAME" =~ .*bowman.* ]]; then + MACHINE=bowman + module load git +fi + +if [[ "$HOSTNAME" == *blake* ]]; then # Warning: very generic name + MACHINE=blake + module load git +fi + +if [[ "$HOSTNAME" == apollo\.* ]]; then + MACHINE=apollo + module load git +fi + +if [[ "$HOSTNAME" == mayer\.* ]]; then + MACHINE=mayer +# module load git +fi +if [[ "$HOSTNAME" == cn* ]]; then # Warning: very generic name + MACHINE=mayer +fi + +if [ ! -z "$SEMS_MODULEFILES_ROOT" ]; then + if [[ "$MACHINE" = "" ]]; then + MACHINE=sems + module load sems-git + fi +fi + +if [[ "$MACHINE" = "" ]]; then + echo "Unrecognized machine" >&2 + exit 1 +fi + +echo "Running on machine: $MACHINE" + +GCC_BUILD_LIST="OpenMP,Pthread,Serial,OpenMP_Serial,Pthread_Serial" +IBM_BUILD_LIST="OpenMP,Serial,OpenMP_Serial" +ARM_GCC_BUILD_LIST="OpenMP,Serial,OpenMP_Serial" +INTEL_BUILD_LIST="OpenMP,Pthread,Serial,OpenMP_Serial,Pthread_Serial" +CLANG_BUILD_LIST="Pthread,Serial,Pthread_Serial" +CUDA_BUILD_LIST="Cuda_OpenMP,Cuda_Pthread,Cuda_Serial" +CUDA_IBM_BUILD_LIST="Cuda_OpenMP,Cuda_Serial" + +GCC_WARNING_FLAGS="-Wall,-Wshadow,-pedantic,-Werror,-Wsign-compare,-Wtype-limits,-Wignored-qualifiers,-Wempty-body,-Wclobbered,-Wuninitialized" +IBM_WARNING_FLAGS="-Wall,-Wshadow,-pedantic,-Wsign-compare,-Wtype-limits,-Wuninitialized" +CLANG_WARNING_FLAGS="-Wall,-Wshadow,-pedantic,-Werror,-Wsign-compare,-Wtype-limits,-Wuninitialized" +INTEL_WARNING_FLAGS="-Wall,-Wshadow,-pedantic,-Werror,-Wsign-compare,-Wtype-limits,-Wuninitialized" +CUDA_WARNING_FLAGS="-Wall,-Wshadow,-pedantic,-Werror,-Wsign-compare,-Wtype-limits,-Wuninitialized" +#CUDA_WARNING_FLAGS="-Wall,-Wshadow,-pedantic,-Wsign-compare,-Wtype-limits,-Wuninitialized" +PGI_WARNING_FLAGS="" + +# Default. Machine specific can override. +DEBUG=False +ARGS="" +CUSTOM_BUILD_LIST="" +QTHREADS_PATH="" +DRYRUN=False +BUILD_ONLY=False +declare -i NUM_JOBS_TO_RUN_IN_PARALLEL=1 +TEST_SCRIPT=False +SKIP_HWLOC=False +SPOT_CHECK=False + +PRINT_HELP=False +OPT_FLAG="" +CXX_FLAGS_EXTRA="" +LD_FLAGS_EXTRA="" +KOKKOS_OPTIONS="" + +# +# Handle arguments. +# + +while [[ $# > 0 ]] +do + key="$1" + + case $key in + --kokkos-path*) + KOKKOS_PATH="${key#*=}" + ;; + --qthreads-path*) + QTHREADS_PATH="${key#*=}" + ;; + --build-list*) + CUSTOM_BUILD_LIST="${key#*=}" + ;; + --debug*) + DEBUG=True + ;; + --build-only*) + BUILD_ONLY=True + ;; + --test-script*) + TEST_SCRIPT=True + ;; + --skip-hwloc*) + SKIP_HWLOC=True + ;; + --num*) + NUM_JOBS_TO_RUN_IN_PARALLEL="${key#*=}" + ;; + --dry-run*) + DRYRUN=True + ;; + --spot-check*) + SPOT_CHECK=True + ;; + --arch*) + ARCH_FLAG="--arch=${key#*=}" + ;; + --opt-flag*) + OPT_FLAG="${key#*=}" + ;; + --with-cuda-options*) + KOKKOS_CUDA_OPTIONS="--with-cuda-options=${key#*=}" + ;; + --with-options*) + KOKKOS_OPTIONS="--with-options=${key#*=}" + ;; + --cxxflags-extra*) + CXX_FLAGS_EXTRA="${key#*=}" + ;; + --ldflags-extra*) + LD_FLAGS_EXTRA="${key#*=}" + ;; + --help*) + PRINT_HELP=True + ;; + *) + # args, just append + ARGS="$ARGS $1" + ;; + esac + + shift +done + +SCRIPT_KOKKOS_ROOT=$( cd "$( dirname "$0" )" && cd ../.. && pwd ) + +# Set kokkos path. +if [ -z "$KOKKOS_PATH" ]; then + KOKKOS_PATH=$SCRIPT_KOKKOS_ROOT +else + # Ensure KOKKOS_PATH is abs path. + KOKKOS_PATH=$( cd $KOKKOS_PATH && pwd ) +fi + +UNCOMMITTED=`cd ${KOKKOS_PATH}; git status --porcelain 2>/dev/null` +if ! [ -z "$UNCOMMITTED" ]; then + echo "WARNING!! THE FOLLOWING CHANGES ARE UNCOMMITTED!! :" + echo "$UNCOMMITTED" + echo "" +fi + +GITSTATUS=`cd ${KOKKOS_PATH}; git log -n 1 --format=oneline` +echo "Repository Status: " ${GITSTATUS} +echo "" +echo "" + +# +# Machine specific config. +# + +if [ "$MACHINE" = "sems" ]; then + source /projects/sems/modulefiles/utils/sems-modules-init.sh + + BASE_MODULE_LIST="sems-env,kokkos-env,kokkos-hwloc/1.10.1/base,sems-<COMPILER_NAME>/<COMPILER_VERSION>" + CUDA_MODULE_LIST="sems-env,kokkos-env,kokkos-<COMPILER_NAME>/<COMPILER_VERSION>,sems-gcc/4.8.4,kokkos-hwloc/1.10.1/base" + CUDA8_MODULE_LIST="sems-env,kokkos-env,kokkos-<COMPILER_NAME>/<COMPILER_VERSION>,sems-gcc/5.3.0,kokkos-hwloc/1.10.1/base" + + if [ -z "$ARCH_FLAG" ]; then + ARCH_FLAG="" + fi + + if [ "$SPOT_CHECK" = "True" ]; then + # Format: (compiler module-list build-list exe-name warning-flag) + COMPILERS=("gcc/5.3.0 $BASE_MODULE_LIST "OpenMP" g++ $GCC_WARNING_FLAGS" + "gcc/7.3.0 $BASE_MODULE_LIST "Serial" g++ $GCC_WARNING_FLAGS" + "intel/17.0.1 $BASE_MODULE_LIST "OpenMP" icpc $INTEL_WARNING_FLAGS" + "clang/4.0.1 $BASE_MODULE_LIST "Pthread_Serial" clang++ $CLANG_WARNING_FLAGS" + "cuda/8.0.44 $CUDA8_MODULE_LIST "Cuda_OpenMP" $KOKKOS_PATH/bin/nvcc_wrapper $CUDA_WARNING_FLAGS" + ) + else + # Format: (compiler module-list build-list exe-name warning-flag) + COMPILERS=("gcc/4.8.4 $BASE_MODULE_LIST $GCC_BUILD_LIST g++ $GCC_WARNING_FLAGS" + "gcc/4.9.3 $BASE_MODULE_LIST $GCC_BUILD_LIST g++ $GCC_WARNING_FLAGS" + "gcc/5.3.0 $BASE_MODULE_LIST $GCC_BUILD_LIST g++ $GCC_WARNING_FLAGS" + "gcc/6.1.0 $BASE_MODULE_LIST $GCC_BUILD_LIST g++ $GCC_WARNING_FLAGS" + "gcc/7.3.0 $BASE_MODULE_LIST $GCC_BUILD_LIST g++ $GCC_WARNING_FLAGS" + "intel/15.0.2 $BASE_MODULE_LIST $INTEL_BUILD_LIST icpc $INTEL_WARNING_FLAGS" + "intel/16.0.3 $BASE_MODULE_LIST $INTEL_BUILD_LIST icpc $INTEL_WARNING_FLAGS" + "intel/17.0.1 $BASE_MODULE_LIST $INTEL_BUILD_LIST icpc $INTEL_WARNING_FLAGS" + "clang/3.6.1 $BASE_MODULE_LIST $CLANG_BUILD_LIST clang++ $CLANG_WARNING_FLAGS" + "clang/3.7.1 $BASE_MODULE_LIST $CLANG_BUILD_LIST clang++ $CLANG_WARNING_FLAGS" + "clang/3.8.1 $BASE_MODULE_LIST $CLANG_BUILD_LIST clang++ $CLANG_WARNING_FLAGS" + "clang/3.9.0 $BASE_MODULE_LIST $CLANG_BUILD_LIST clang++ $CLANG_WARNING_FLAGS" + "clang/4.0.1 $BASE_MODULE_LIST $CLANG_BUILD_LIST clang++ $CLANG_WARNING_FLAGS" + "cuda/7.5.18 $CUDA_MODULE_LIST $CUDA_BUILD_LIST $KOKKOS_PATH/bin/nvcc_wrapper $CUDA_WARNING_FLAGS" + "cuda/8.0.44 $CUDA8_MODULE_LIST $CUDA_BUILD_LIST $KOKKOS_PATH/bin/nvcc_wrapper $CUDA_WARNING_FLAGS" + ) + fi +elif [ "$MACHINE" = "white" ]; then + source /etc/profile.d/modules.sh + SKIP_HWLOC=True + export SLURM_TASKS_PER_NODE=32 + + BASE_MODULE_LIST="<COMPILER_NAME>/<COMPILER_VERSION>" + IBM_MODULE_LIST="<COMPILER_NAME>/xl/<COMPILER_VERSION>" + CUDA_MODULE_LIST="<COMPILER_NAME>/<COMPILER_VERSION>,gcc/7.2.0,ibm/xl/16.1.0" + + # Don't do pthread on white. + GCC_BUILD_LIST="OpenMP,Serial,OpenMP_Serial" + + # Format: (compiler module-list build-list exe-name warning-flag) + COMPILERS=("gcc/6.4.0 $BASE_MODULE_LIST $IBM_BUILD_LIST g++ $GCC_WARNING_FLAGS" + "gcc/7.2.0 $BASE_MODULE_LIST $IBM_BUILD_LIST g++ $GCC_WARNING_FLAGS" + "ibm/16.1.0 $IBM_MODULE_LIST $IBM_BUILD_LIST xlC $IBM_WARNING_FLAGS" + "cuda/9.2.88 $CUDA_MODULE_LIST $CUDA_IBM_BUILD_LIST ${KOKKOS_PATH}/bin/nvcc_wrapper $CUDA_WARNING_FLAGS" + ) + + if [ -z "$ARCH_FLAG" ]; then + ARCH_FLAG="--arch=Power8,Kepler37" + fi + +elif [ "$MACHINE" = "bowman" ]; then + source /etc/profile.d/modules.sh + SKIP_HWLOC=True + export SLURM_TASKS_PER_NODE=32 + + BASE_MODULE_LIST="<COMPILER_NAME>/compilers/<COMPILER_VERSION>" + + OLD_INTEL_BUILD_LIST="Pthread,Serial,Pthread_Serial" + + # Format: (compiler module-list build-list exe-name warning-flag) + COMPILERS=("intel/16.4.258 $BASE_MODULE_LIST $OLD_INTEL_BUILD_LIST icpc $INTEL_WARNING_FLAGS" + "intel/17.2.174 $BASE_MODULE_LIST $INTEL_BUILD_LIST icpc $INTEL_WARNING_FLAGS" + "intel/18.2.199 $BASE_MODULE_LIST $INTEL_BUILD_LIST icpc $INTEL_WARNING_FLAGS" + ) + + if [ -z "$ARCH_FLAG" ]; then + ARCH_FLAG="--arch=KNL" + fi + +elif [ "$MACHINE" = "mayer" ]; then + SKIP_HWLOC=True + export SLURM_TASKS_PER_NODE=96 + + BASE_MODULE_LIST="<COMPILER_NAME>/<COMPILER_VERSION>" + ARM_MODULE_LIST="<COMPILER_NAME>/compilers/<COMPILER_VERSION>" + + # Format: (compiler module-list build-list exe-name warning-flag) + COMPILERS=("gcc/7.2.0 $BASE_MODULE_LIST $ARM_GCC_BUILD_LIST g++ $GCC_WARNING_FLAGS" + "arm/18.4.0 $ARM_MODULE_LIST $ARM_GCC_BUILD_LIST armclang++ $CLANG_WARNING_FLAGS") + + if [ -z "$ARCH_FLAG" ]; then + ARCH_FLAG="--arch=ARMv8-TX2" + fi + +elif [ "$MACHINE" = "blake" ]; then + source /etc/profile.d/modules.sh + SKIP_HWLOC=True + export SLURM_TASKS_PER_NODE=32 + + BASE_MODULE_LIST="<COMPILER_NAME>/<COMPILER_VERSION>" + BASE_MODULE_LIST_INTEL="<COMPILER_NAME>/compilers/<COMPILER_VERSION>" + + if [ "$SPOT_CHECK" = "True" ]; then + + # Format: (compiler module-list build-list exe-name warning-flag) + COMPILERS=("intel/18.1.163 $BASE_MODULE_LIST_INTEL $INTEL_BUILD_LIST icpc $INTEL_WARNING_FLAGS" + "gcc/7.2.0 $BASE_MODULE_LIST $GCC_BUILD_LIST g++ $GCC_WARNING_FLAGS" + "pgi/17.10.0 $BASE_MODULE_LIST $GCC_BUILD_LIST pgc++ $PGI_WARNING_FLAGS" + ) + else + COMPILERS=("intel/18.1.163 $BASE_MODULE_LIST_INTEL $INTEL_BUILD_LIST icpc $INTEL_WARNING_FLAGS" + "gcc/4.9.3 $BASE_MODULE_LIST $GCC_BUILD_LIST g++ $GCC_WARNING_FLAGS" + "gcc/5.5.0 $BASE_MODULE_LIST $GCC_BUILD_LIST g++ $GCC_WARNING_FLAGS" + "gcc/6.4.0 $BASE_MODULE_LIST $GCC_BUILD_LIST g++ $GCC_WARNING_FLAGS" + "gcc/7.2.0 $BASE_MODULE_LIST $GCC_BUILD_LIST g++ $GCC_WARNING_FLAGS" + "gcc/8.1.0 $BASE_MODULE_LIST $GCC_BUILD_LIST g++ $GCC_WARNING_FLAGS" + "pgi/17.10.0 $BASE_MODULE_LIST $GCC_BUILD_LIST pgc++ $PGI_WARNING_FLAGS" + ) + + fi + if [ -z "$ARCH_FLAG" ]; then + ARCH_FLAG="--arch=SKX" + fi + +elif [ "$MACHINE" = "apollo" ]; then + source /projects/sems/modulefiles/utils/sems-modules-init.sh + module use /home/projects/modulefiles/local/x86-64 + module load kokkos-env + + module load sems-git + module load sems-tex + module load sems-cmake/3.5.2 + module load sems-gdb + + SKIP_HWLOC=True + + BASE_MODULE_LIST="sems-env,kokkos-env,sems-<COMPILER_NAME>/<COMPILER_VERSION>,kokkos-hwloc/1.10.1/base" + CUDA_MODULE_LIST="sems-env,kokkos-env,kokkos-<COMPILER_NAME>/<COMPILER_VERSION>,sems-gcc/4.8.4,kokkos-hwloc/1.10.1/base" + CUDA8_MODULE_LIST="sems-env,kokkos-env,kokkos-<COMPILER_NAME>/<COMPILER_VERSION>,sems-gcc/5.3.0,kokkos-hwloc/1.10.1/base" + + CLANG_MODULE_LIST="sems-env,kokkos-env,sems-git,sems-cmake/3.5.2,<COMPILER_NAME>/<COMPILER_VERSION>,cuda/9.0.69" + CLANG7_MODULE_LIST="sems-env,kokkos-env,sems-git,sems-cmake/3.5.2,<COMPILER_NAME>/<COMPILER_VERSION>,cuda/9.1" + NVCC_MODULE_LIST="sems-env,kokkos-env,sems-git,sems-cmake/3.5.2,<COMPILER_NAME>/<COMPILER_VERSION>,sems-gcc/5.3.0" + + BUILD_LIST_CUDA_NVCC="Cuda_Serial,Cuda_OpenMP" + BUILD_LIST_CUDA_CLANG="Cuda_Serial,Cuda_Pthread" + BUILD_LIST_CLANG="Serial,Pthread,OpenMP" + + if [ "$SPOT_CHECK" = "True" ]; then + # Format: (compiler module-list build-list exe-name warning-flag) + COMPILERS=("gcc/4.8.4 $BASE_MODULE_LIST "OpenMP,Pthread" g++ $GCC_WARNING_FLAGS" + "gcc/5.3.0 $BASE_MODULE_LIST "Serial" g++ $GCC_WARNING_FLAGS" + "intel/16.0.1 $BASE_MODULE_LIST "OpenMP" icpc $INTEL_WARNING_FLAGS" + "clang/3.9.0 $BASE_MODULE_LIST "Pthread_Serial" clang++ $CLANG_WARNING_FLAGS" + "clang/6.0 $CLANG_MODULE_LIST "Cuda_Pthread,OpenMP" clang++ $CUDA_WARNING_FLAGS" + "cuda/9.1 $CUDA_MODULE_LIST "Cuda_OpenMP" $KOKKOS_PATH/bin/nvcc_wrapper $CUDA_WARNING_FLAGS" + ) + else + # Format: (compiler module-list build-list exe-name warning-flag) + COMPILERS=("cuda/9.1 $CUDA8_MODULE_LIST $BUILD_LIST_CUDA_NVCC $KOKKOS_PATH/bin/nvcc_wrapper $CUDA_WARNING_FLAGS" + "clang/6.0 $CLANG_MODULE_LIST $BUILD_LIST_CUDA_CLANG clang++ $CUDA_WARNING_FLAGS" + "clang/7.0 $CLANG7_MODULE_LIST $BUILD_LIST_CUDA_CLANG clang++ $CUDA_WARNING_FLAGS" + "clang/3.9.0 $CLANG_MODULE_LIST $BUILD_LIST_CLANG clang++ $CLANG_WARNING_FLAGS" + "gcc/4.8.4 $BASE_MODULE_LIST $GCC_BUILD_LIST g++ $GCC_WARNING_FLAGS" + "gcc/4.9.3 $BASE_MODULE_LIST $GCC_BUILD_LIST g++ $GCC_WARNING_FLAGS" + "gcc/5.3.0 $BASE_MODULE_LIST $GCC_BUILD_LIST g++ $GCC_WARNING_FLAGS" + "gcc/6.1.0 $BASE_MODULE_LIST $GCC_BUILD_LIST g++ $GCC_WARNING_FLAGS" + "intel/15.0.2 $BASE_MODULE_LIST $INTEL_BUILD_LIST icpc $INTEL_WARNING_FLAGS" + "intel/16.0.1 $BASE_MODULE_LIST $INTEL_BUILD_LIST icpc $INTEL_WARNING_FLAGS" + "intel/17.0.1 $BASE_MODULE_LIST $INTEL_BUILD_LIST icpc $INTEL_WARNING_FLAGS" + "clang/3.5.2 $BASE_MODULE_LIST $CLANG_BUILD_LIST clang++ $CLANG_WARNING_FLAGS" + "clang/3.6.1 $BASE_MODULE_LIST $CLANG_BUILD_LIST clang++ $CLANG_WARNING_FLAGS" + ) + fi + + if [ -z "$ARCH_FLAG" ]; then + ARCH_FLAG="--arch=SNB,Volta70" + fi + +else + echo "Unhandled machine $MACHINE" >&2 + exit 1 +fi + +export OMP_NUM_THREADS=8 +export OMP_PROC_BIND=spread +export OMP_PLACES=cores + +declare -i NUM_RESULTS_TO_KEEP=7 + +RESULT_ROOT_PREFIX=TestAll + +if [ "$PRINT_HELP" = "True" ]; then + echo "test_all_sandia <ARGS> <OPTIONS>:" + echo "--kokkos-path=/Path/To/Kokkos: Path to the Kokkos root directory" + echo " Defaults to root repo containing this script" + echo "--debug: Run tests in debug. Defaults to False" + echo "--test-script: Test this script, not Kokkos" + echo "--skip-hwloc: Do not do hwloc tests" + echo "--num=N: Number of jobs to run in parallel" + echo "--spot-check: Minimal test set to issue pull request" + echo "--dry-run: Just print what would be executed" + echo "--build-only: Just do builds, don't run anything" + echo "--opt-flag=FLAG: Optimization flag (default: -O3)" + echo "--cxxflags-extra=FLAGS: Extra flags to be added to CXX_FLAGS" + echo "--ldflags-extra=FLAGS: Extra flags to be added to LD_FLAGS" + echo "--arch=ARCHITECTURE: overwrite architecture flags" + echo "--with-cuda-options=OPT: set KOKKOS_CUDA_OPTIONS" + echo "--build-list=BUILD,BUILD,BUILD..." + echo " Provide a comma-separated list of builds instead of running all builds" + echo " Valid items:" + echo " OpenMP, Pthread, Qthreads, Serial, OpenMP_Serial, Pthread_Serial" + echo " Qthreads_Serial, Cuda_OpenMP, Cuda_Pthread, Cuda_Serial" + echo "" + + echo "ARGS: list of expressions matching compilers to test" + echo " supported compilers sems" + for COMPILER_DATA in "${COMPILERS[@]}"; do + ARR=($COMPILER_DATA) + COMPILER=${ARR[0]} + echo " $COMPILER" + done + echo "" + + echo "Examples:" + echo " Run all tests" + echo " % test_all_sandia" + echo "" + echo " Run all gcc tests" + echo " % test_all_sandia gcc" + echo "" + echo " Run all gcc/4.8.4 and all intel tests" + echo " % test_all_sandia gcc/4.8.4 intel" + echo "" + echo " Run all tests in debug" + echo " % test_all_sandia --debug" + echo "" + echo " Run gcc/4.8.4 and only do OpenMP and OpenMP_Serial builds" + echo " % test_all_sandia gcc/4.8.4 --build-list=OpenMP,OpenMP_Serial" + echo "" + echo "If you want to kill the tests, do:" + echo " hit ctrl-z" + echo " % kill -9 %1" + echo + exit 0 +fi + +# Set build type. +if [ "$DEBUG" = "True" ]; then + BUILD_TYPE=debug +else + BUILD_TYPE=release +fi + +# If no args provided, do all compilers. +if [ -z "$ARGS" ]; then + ARGS='?' +fi + +# Process args to figure out which compilers to test. +COMPILERS_TO_TEST="" + +for ARG in $ARGS; do + for COMPILER_DATA in "${COMPILERS[@]}"; do + ARR=($COMPILER_DATA) + COMPILER=${ARR[0]} + + if [[ "$COMPILER" = $ARG* ]]; then + if [[ "$COMPILERS_TO_TEST" != *${COMPILER}* ]]; then + COMPILERS_TO_TEST="$COMPILERS_TO_TEST $COMPILER" + else + echo "Tried to add $COMPILER twice" + fi + fi + done +done + +# Check if Qthreads build requested. +HAVE_QTHREADS_BUILD="False" +if [ -n "$CUSTOM_BUILD_LIST" ]; then + if [[ "$CUSTOM_BUILD_LIST" = *Qthreads* ]]; then + HAVE_QTHREADS_BUILD="True" + fi +else + for COMPILER_DATA in "${COMPILERS[@]}"; do + ARR=($COMPILER_DATA) + BUILD_LIST=${ARR[2]} + if [[ "$BUILD_LIST" = *Qthreads* ]]; then + HAVE_QTHREADS_BUILD="True" + fi + done +fi + +# Ensure Qthreads path is set if Qthreads build is requested. +if [ "$HAVE_QTHREADS_BUILD" = "True" ]; then + if [ -z "$QTHREADS_PATH" ]; then + echo "Need to supply Qthreads path (--qthreads-path) when testing Qthreads backend." >&2 + exit 1 + else + # Strip trailing slashes from path. + QTHREADS_PATH=$(echo $QTHREADS_PATH | sed 's/\/*$//') + fi +fi + +# +# Functions. +# + +# get_compiler_name <COMPILER> +get_compiler_name() { + echo $1 | cut -d/ -f1 +} + +# get_compiler_version <COMPILER> +get_compiler_version() { + echo $1 | cut -d/ -f2 +} + +# Do not call directly. +get_compiler_data() { + local compiler=$1 + local item=$2 + local compiler_name=$(get_compiler_name $compiler) + local compiler_vers=$(get_compiler_version $compiler) + + local compiler_data + for compiler_data in "${COMPILERS[@]}" ; do + local arr=($compiler_data) + + if [ "$compiler" = "${arr[0]}" ]; then + echo "${arr[$item]}" | tr , ' ' | sed -e "s/<COMPILER_NAME>/$compiler_name/g" -e "s/<COMPILER_VERSION>/$compiler_vers/g" + return 0 + fi + done + + # Not found. + echo "Unreconized compiler $compiler" >&2 + exit 1 +} + +# +# For all getters, usage: <GETTER> <COMPILER> +# + +get_compiler_modules() { + get_compiler_data $1 1 +} + +get_compiler_build_list() { + get_compiler_data $1 2 +} + +get_compiler_exe_name() { + get_compiler_data $1 3 +} + +get_compiler_warning_flags() { + get_compiler_data $1 4 +} + +run_cmd() { + echo "RUNNING: $*" + if [ "$DRYRUN" != "True" ]; then + eval "$* 2>&1" + fi +} + +# report_and_log_test_results <SUCCESS> <DESC> <COMMENT> +report_and_log_test_result() { + # Use sane var names. + local success=$1; local desc=$2; local comment=$3; + + if [ "$success" = "0" ]; then + echo " PASSED $desc" + echo $comment > $PASSED_DIR/$desc + else + # For failures, comment should be the name of the phase that failed. + echo " FAILED $desc" >&2 + echo $comment > $FAILED_DIR/$desc + cat ${desc}.${comment}.log + fi +} + +setup_env() { + local compiler=$1 + local compiler_modules=$(get_compiler_modules $compiler) + + module purge + + local mod + for mod in $compiler_modules; do + echo "Loading module $mod" + module load $mod 2>&1 + # It is ridiculously hard to check for the success of a loaded + # module. Module does not return error codes and piping to grep + # causes module to run in a subshell. + module list 2>&1 | grep "$mod" >& /dev/null || return 1 + done + + return 0 +} + +# single_build_and_test <COMPILER> <BUILD> <BUILD_TYPE> +single_build_and_test() { + # Use sane var names. + local compiler=$1; local build=$2; local build_type=$3; + + # Set up env. + mkdir -p $ROOT_DIR/$compiler/"${build}-$build_type" + cd $ROOT_DIR/$compiler/"${build}-$build_type" + local desc=$(echo "${compiler}-${build}-${build_type}" | sed 's:/:-:g') + setup_env $compiler >& ${desc}.configure.log || { report_and_log_test_result 1 ${desc} configure && return 0; } + + # Set up flags. + local compiler_warning_flags=$(get_compiler_warning_flags $compiler) + local compiler_exe=$(get_compiler_exe_name $compiler) + + if [[ "$build_type" = hwloc* ]]; then + local extra_args=--with-hwloc=$(dirname $(dirname $(which hwloc-info))) + fi + + if [[ "$build" = *Qthreads* ]]; then + if [[ "$build_type" = hwloc* ]]; then + local extra_args="$extra_args --qthreads-path=${QTHREADS_PATH}_hwloc" + else + local extra_args="$extra_args --qthreads-path=$QTHREADS_PATH" + fi + fi + + if [[ "$OPT_FLAG" = "" ]]; then + OPT_FLAG="-O3" + fi + + if [[ "$build_type" = *debug* ]]; then + local extra_args="$extra_args --debug" + local cxxflags="-g $compiler_warning_flags" + local ldflags="-g" + else + local cxxflags="$OPT_FLAG $compiler_warning_flags" + local ldflags="${OPT_FLAG}" + fi + + local cxxflags="${cxxflags} ${CXX_FLAGS_EXTRA}" + local ldflags="${ldflags} ${LD_FLAGS_EXTRA}" + + if [[ "$KOKKOS_CUDA_OPTIONS" != "" ]]; then + local extra_args="$extra_args $KOKKOS_CUDA_OPTIONS" + fi + if [[ "$KOKKOS_OPTIONS" != "" ]]; then + local extra_args="$extra_args $KOKKOS_OPTIONS" + else + local extra_args="$extra_args --with-options=enable_large_mem_tests" + fi + + echo " Starting job $desc" + + local comment="no_comment" + + if [ "$TEST_SCRIPT" = "True" ]; then + local rand=$[ 1 + $[ RANDOM % 10 ]] + sleep $rand + + if [ $rand -gt 5 ]; then + run_cmd ls fake_problem >& ${desc}.configure.log || { report_and_log_test_result 1 $desc configure && return 0; } + fi + else + run_cmd ${KOKKOS_PATH}/generate_makefile.bash --with-devices=$build $ARCH_FLAG --compiler=$(which $compiler_exe) --cxxflags=\"$cxxflags\" --ldflags=\"$ldflags\" $extra_args &>> ${desc}.configure.log || { report_and_log_test_result 1 ${desc} configure && return 0; } + local -i build_start_time=$(date +%s) + run_cmd make -j 48 build-test >& ${desc}.build.log || { report_and_log_test_result 1 ${desc} build && return 0; } + local -i build_end_time=$(date +%s) + comment="build_time=$(($build_end_time-$build_start_time))" + + if [[ "$BUILD_ONLY" == False ]]; then + run_cmd make test >& ${desc}.test.log || { report_and_log_test_result 1 ${desc} test && return 0; } + local -i run_end_time=$(date +%s) + comment="$comment run_time=$(($run_end_time-$build_end_time))" + fi + fi + + report_and_log_test_result 0 $desc "$comment" + + return 0 +} + +# wait_for_jobs <NUM-JOBS> +wait_for_jobs() { + local -i max_jobs=$1 + local -i num_active_jobs=$(jobs | wc -l) + while [ $num_active_jobs -ge $max_jobs ] + do + sleep 1 + num_active_jobs=$(jobs | wc -l) + jobs >& /dev/null + done +} + +# run_in_background <COMPILER> <BUILD> <BUILD_TYPE> +run_in_background() { + local compiler=$1 + + local -i num_jobs=$NUM_JOBS_TO_RUN_IN_PARALLEL + # Don't override command line input. + # if [[ "$BUILD_ONLY" == True ]]; then + # num_jobs=8 + # else + if [[ "$compiler" == cuda* ]]; then + num_jobs=1 + fi + if [[ "$compiler" == clang ]]; then + num_jobs=1 + fi + # fi + wait_for_jobs $num_jobs + + single_build_and_test $* & +} + +# build_and_test_all <COMPILER> +build_and_test_all() { + # Get compiler data. + local compiler=$1 + if [ -z "$CUSTOM_BUILD_LIST" ]; then + local compiler_build_list=$(get_compiler_build_list $compiler) + else + local compiler_build_list=$(echo "$CUSTOM_BUILD_LIST" | tr , ' ') + fi + + # Do builds. + local build + for build in $compiler_build_list + do + run_in_background $compiler $build $BUILD_TYPE + + # If not cuda, do a hwloc test too. + if [[ "$compiler" != cuda* && "$SKIP_HWLOC" == False ]]; then + run_in_background $compiler $build "hwloc-$BUILD_TYPE" + fi + done + + return 0 +} + +get_test_root_dir() { + local existing_results=$(find . -maxdepth 1 -name "$RESULT_ROOT_PREFIX*" | sort) + local -i num_existing_results=$(echo $existing_results | tr ' ' '\n' | wc -l) + local -i num_to_delete=${num_existing_results}-${NUM_RESULTS_TO_KEEP} + + if [ $num_to_delete -gt 0 ]; then + /bin/rm -rf $(echo $existing_results | tr ' ' '\n' | head -n $num_to_delete) + fi + + echo $(pwd)/${RESULT_ROOT_PREFIX}_$(date +"%Y-%m-%d_%H.%M.%S") +} + +wait_summarize_and_exit() { + wait_for_jobs 1 + + echo "#######################################################" + echo "PASSED TESTS" + echo "#######################################################" + + local passed_test + for passed_test in $(\ls -1 $PASSED_DIR | sort) + do + echo $passed_test $(cat $PASSED_DIR/$passed_test) + done + + local -i rv=0 + if [ "$(ls -A $FAILED_DIR)" ]; then + echo "#######################################################" + echo "FAILED TESTS" + echo "#######################################################" + + local failed_test + for failed_test in $(\ls -1 $FAILED_DIR | sort) + do + echo $failed_test "("$(cat $FAILED_DIR/$failed_test)" failed)" + rv=$rv+1 + done + fi + + exit $rv +} + +# +# Main. +# + +ROOT_DIR=$(get_test_root_dir) +mkdir -p $ROOT_DIR +cd $ROOT_DIR + +PASSED_DIR=$ROOT_DIR/results/passed +FAILED_DIR=$ROOT_DIR/results/failed +mkdir -p $PASSED_DIR +mkdir -p $FAILED_DIR + +echo "Going to test compilers: " $COMPILERS_TO_TEST +for COMPILER in $COMPILERS_TO_TEST; do + echo "Testing compiler $COMPILER" + build_and_test_all $COMPILER +done + +wait_summarize_and_exit diff --git a/packages/kokkos/scripts/trilinos-integration/shepard_jenkins_run_script_pthread_intel b/packages/kokkos/scripts/trilinos-integration/blake_jenkins_run_script_pthread_intel similarity index 82% rename from packages/kokkos/scripts/trilinos-integration/shepard_jenkins_run_script_pthread_intel rename to packages/kokkos/scripts/trilinos-integration/blake_jenkins_run_script_pthread_intel index 3b2c7255177c3b004b54cef3629a56aed46d9798..df370509a748193dca64213e0b22f416d7c0cbdd 100755 --- a/packages/kokkos/scripts/trilinos-integration/shepard_jenkins_run_script_pthread_intel +++ b/packages/kokkos/scripts/trilinos-integration/blake_jenkins_run_script_pthread_intel @@ -1,6 +1,8 @@ #!/bin/bash -el ulimit -c 0 -module load devpack/openmpi/2.1.1/intel/17.4.196/cuda/none +module load devpack/20171203/openmpi/2.1.2/intel/18.1.163 +# Trilinos now requires cmake version >= 3.10.0 +module swap cmake/3.9.0 cmake/3.10.2 KOKKOS_BRANCH=$1 TRILINOS_UPDATE_BRANCH=$2 @@ -28,8 +30,9 @@ export JENKINS_DO_PTHREAD=ON export JENKINS_DO_SERIAL=OFF export JENKINS_DO_COMPLEX=OFF -export JENKINS_ARCH_CXX_FLAG="-xCORE-AVX2 -mkl" -export JENKINS_ARCH_C_FLAG="-xCORE-AVX2 -mkl" +export JENKINS_ARCH=SKX +export JENKINS_ARCH_CXX_FLAG="-xCORE-AVX512 -mkl" +export JENKINS_ARCH_C_FLAG="-xCORE-AVX512 -mkl" export BLAS_LIBRARIES="-mkl;${MKLROOT}/lib/intel64/libmkl_intel_lp64.a;${MKLROOT}/lib/intel64/libmkl_intel_thread.a;${MKLROOT}/lib/intel64/libmkl_core.a" export LAPACK_LIBRARIES=${BLAS_LIBRARIES} @@ -37,7 +40,7 @@ export JENKINS_DO_TESTS=ON export JENKINS_DO_EXAMPLES=ON export JENKINS_DO_SHARED=ON -export QUEUE=haswell +export QUEUE=blake module load python diff --git a/packages/kokkos/scripts/trilinos-integration/shepard_jenkins_run_script_serial_intel b/packages/kokkos/scripts/trilinos-integration/blake_jenkins_run_script_serial_intel similarity index 82% rename from packages/kokkos/scripts/trilinos-integration/shepard_jenkins_run_script_serial_intel rename to packages/kokkos/scripts/trilinos-integration/blake_jenkins_run_script_serial_intel index 9ce936ae2634b1b8b7375f70d241c74189c3ae40..04f1378cec6726503541cf52838630f990267548 100755 --- a/packages/kokkos/scripts/trilinos-integration/shepard_jenkins_run_script_serial_intel +++ b/packages/kokkos/scripts/trilinos-integration/blake_jenkins_run_script_serial_intel @@ -1,6 +1,8 @@ #!/bin/bash -el ulimit -c 0 -module load devpack/openmpi/2.1.1/intel/17.4.196/cuda/none +module load devpack/20171203/openmpi/2.1.2/intel/18.1.163 +# Trilinos now requires cmake version >= 3.10.0 +module swap cmake/3.9.0 cmake/3.10.2 KOKKOS_BRANCH=$1 TRILINOS_UPDATE_BRANCH=$2 @@ -28,8 +30,9 @@ export JENKINS_DO_PTHREAD=OFF export JENKINS_DO_SERIAL=ON export JENKINS_DO_COMPLEX=ON -export JENKINS_ARCH_CXX_FLAG="-xCORE-AVX2 -mkl" -export JENKINS_ARCH_C_FLAG="-xCORE-AVX2 -mkl" +export JENKINS_ARCH=SKX +export JENKINS_ARCH_CXX_FLAG="-xCORE-AVX512 -mkl" +export JENKINS_ARCH_C_FLAG="-xCORE-AVX512 -mkl" export BLAS_LIBRARIES="-mkl;${MKLROOT}/lib/intel64/libmkl_intel_lp64.a;${MKLROOT}/lib/intel64/libmkl_intel_thread.a;${MKLROOT}/lib/intel64/libmkl_core.a" export LAPACK_LIBRARIES=${BLAS_LIBRARIES} @@ -37,7 +40,7 @@ export JENKINS_DO_TESTS=ON export JENKINS_DO_EXAMPLES=ON export JENKINS_DO_SHARED=ON -export QUEUE=haswell +export QUEUE=blake module load python diff --git a/packages/kokkos/scripts/trilinos-integration/white_run_jenkins_script_cuda b/packages/kokkos/scripts/trilinos-integration/white_run_jenkins_script_cuda index 2716767fe5dd7ed479843040a32e591fa4439bf3..98900c3c9b9edf87737570c91f2d7f0c4345cb08 100755 --- a/packages/kokkos/scripts/trilinos-integration/white_run_jenkins_script_cuda +++ b/packages/kokkos/scripts/trilinos-integration/white_run_jenkins_script_cuda @@ -20,7 +20,10 @@ then TRILINOS_PRISTINE_BRANCH=develop fi -module load devpack/openmpi/1.10.4/gcc/5.4.0/cuda/8.0.44 +module load devpack/20180521/openmpi/2.1.2/gcc/7.2.0/cuda/9.2.88 +module swap openblas/0.2.20/gcc/7.2.0 netlib/3.8.0/gcc/7.2.0 +# Trilinos now requires cmake version >= 3.10.0 +module swap cmake/3.9.6 cmake/3.12.3 export OMP_NUM_THREADS=8 export JENKINS_DO_CUDA=ON export JENKINS_DO_OPENMP=OFF @@ -28,6 +31,7 @@ export JENKINS_DO_PTHREAD=OFF export JENKINS_DO_SERIAL=ON export JENKINS_DO_COMPLEX=OFF +export JENKINS_ARCH="Power8,Kepler37" export JENKINS_ARCH_CXX_FLAG="-mcpu=power8 -arch=sm_37" export JENKINS_ARCH_C_FLAG="-mcpu=power8" export BLAS_LIBRARIES="${BLAS_ROOT}/lib/libblas.a;gfortran;gomp" diff --git a/packages/kokkos/scripts/trilinos-integration/white_run_jenkins_script_omp b/packages/kokkos/scripts/trilinos-integration/white_run_jenkins_script_omp index ff1086507ce50d21d17292f29cb462f24e24def1..9c5244cd353a35c95ffcaeab805b39eb1ed7788b 100755 --- a/packages/kokkos/scripts/trilinos-integration/white_run_jenkins_script_omp +++ b/packages/kokkos/scripts/trilinos-integration/white_run_jenkins_script_omp @@ -20,7 +20,10 @@ then TRILINOS_PRISTINE_BRANCH=develop fi -module load devpack/openmpi/1.10.4/gcc/5.4.0/cuda/8.0.44 +module load devpack/20180521/openmpi/2.1.2/gcc/7.2.0/cuda/9.2.88 +module swap openblas/0.2.20/gcc/7.2.0 netlib/3.8.0/gcc/7.2.0 +# Trilinos now requires cmake version >= 3.10.0 +module swap cmake/3.9.6 cmake/3.12.3 export OMP_NUM_THREADS=8 export JENKINS_DO_CUDA=OFF export JENKINS_DO_OPENMP=ON @@ -28,6 +31,7 @@ export JENKINS_DO_PTHREAD=OFF export JENKINS_DO_SERIAL=OFF export JENKINS_DO_COMPLEX=OFF +export JENKINS_ARCH="Power8" export JENKINS_ARCH_CXX_FLAG="-mcpu=power8" export JENKINS_ARCH_C_FLAG="-mcpu=power8" export BLAS_LIBRARIES="${BLAS_ROOT}/lib/libblas.a;gfortran;gomp" diff --git a/packages/rang/.gitrepo b/packages/rang/.gitrepo index 6733a19fc07f7d2c8a7d3eaa4d716256662b9d5c..063e422bea8d80263774104cf5de98b8bd77b5ad 100644 --- a/packages/rang/.gitrepo +++ b/packages/rang/.gitrepo @@ -6,6 +6,7 @@ [subrepo] remote = git@github.com:agauniyal/rang.git branch = master - commit = f09d567d5afe5230de0676ddecef93daf4a09667 - parent = fb68ce0527e9597488748018bf8b37cb651270b3 - cmdver = 0.3.1 + commit = cabe04d6d6b05356fa8f9741704924788f0dd762 + parent = 61d96553d759fb36c6592e9b2b41a4af8acc45f1 + cmdver = 0.4.0 + method = merge diff --git a/packages/rang/conanfile.py b/packages/rang/conanfile.py index 4ad8ee762d08e5c1a2eb00815fbf74c7de27681c..9ec7632d3f4197bf1ed854f6242ec5b435bb75f1 100644 --- a/packages/rang/conanfile.py +++ b/packages/rang/conanfile.py @@ -10,6 +10,7 @@ class RangConan(ConanFile): generators = "pkg_config" build_requires = "doctest/1.2.6@bincrafters/stable" exports_sources = "*" + settings = "build_type" def build(self): meson = Meson(self) diff --git a/src/algebra/TinyMatrix.hpp b/src/algebra/TinyMatrix.hpp index 888acb06889073c1a8ae8115486a6cc38e484ab5..e693a70f75771a59ddeed83fab2e4f3b7c5883b0 100644 --- a/src/algebra/TinyMatrix.hpp +++ b/src/algebra/TinyMatrix.hpp @@ -19,7 +19,7 @@ private: PASTIS_FORCEINLINE constexpr size_t _index(const size_t& i, const size_t& j) const noexcept { - return std::move(i*N+j); + return i*N+j; } template <typename... Args> @@ -28,7 +28,7 @@ private: { m_values[N*N-1-sizeof...(args)] = t; if constexpr (sizeof...(args) >0) { - this->_unpackVariadicInput(args...); + this->_unpackVariadicInput(std::forward<Args>(args)...); } } @@ -197,7 +197,7 @@ public: } PASTIS_INLINE - constexpr TinyMatrix& operator=(const ZeroType& z) noexcept + constexpr TinyMatrix& operator=(const ZeroType&) noexcept { static_assert(std::is_arithmetic<T>(),"Cannot assign 'zero' value for non-arithmetic types"); for (size_t i=0; i<N*N; ++i) { @@ -207,7 +207,7 @@ public: } PASTIS_INLINE - constexpr TinyMatrix& operator=(const IdentityType& I) noexcept + constexpr TinyMatrix& operator=(const IdentityType&) noexcept { static_assert(std::is_arithmetic<T>(),"Cannot assign 'identity' value for non-arithmetic types"); for (size_t i=0; i<N; ++i) { @@ -235,7 +235,7 @@ public: constexpr TinyMatrix(const T& t, Args&&... args) noexcept { static_assert(sizeof...(args)==N*N-1, "wrong number of parameters"); - this->_unpackVariadicInput(t, args...); + this->_unpackVariadicInput(t, std::forward<Args>(args)...); } PASTIS_INLINE @@ -245,7 +245,7 @@ public: } PASTIS_INLINE - constexpr TinyMatrix(const ZeroType& z) noexcept + constexpr TinyMatrix(const ZeroType&) noexcept { static_assert(std::is_arithmetic<T>(),"Cannot construct from 'zero' value for non-arithmetic types"); for (size_t i=0; i<N*N; ++i) { @@ -254,7 +254,7 @@ public: } PASTIS_INLINE - constexpr TinyMatrix(const IdentityType& I) noexcept + constexpr TinyMatrix(const IdentityType&) noexcept { static_assert(std::is_arithmetic<T>(),"Cannot construct from 'identity' value for non-arithmetic types"); for (size_t i=0; i<N; ++i) { diff --git a/src/algebra/TinyVector.hpp b/src/algebra/TinyVector.hpp index 988d5f0ea45e68c840199c03c626ffc61f119e90..7b7d407eefa5bd40a0a6cc96bc11d1438ad24093 100644 --- a/src/algebra/TinyVector.hpp +++ b/src/algebra/TinyVector.hpp @@ -23,7 +23,7 @@ class TinyVector { m_values[N-1-sizeof...(args)] = t; if constexpr (sizeof...(args) > 0) { - this->_unpackVariadicInput(args...); + this->_unpackVariadicInput(std::forward<Args>(args)...); } } @@ -174,7 +174,7 @@ class TinyVector } PASTIS_INLINE - constexpr TinyVector& operator=(const ZeroType& z) noexcept + constexpr TinyVector& operator=(const ZeroType&) noexcept { static_assert(std::is_arithmetic<T>(),"Cannot assign 'zero' value for non-arithmetic types"); for (size_t i=0; i<N; ++i) { @@ -200,7 +200,7 @@ class TinyVector constexpr TinyVector(const T& t, Args&&... args) noexcept { static_assert(sizeof...(args)==N-1, "wrong number of parameters"); - this->_unpackVariadicInput(t, args...); + this->_unpackVariadicInput(t, std::forward<Args>(args)...); } PASTIS_INLINE @@ -210,7 +210,7 @@ class TinyVector } PASTIS_INLINE - constexpr TinyVector(const ZeroType& z) noexcept + constexpr TinyVector(const ZeroType&) noexcept { static_assert(std::is_arithmetic<T>(),"Cannot construct from 'zero' value for non-arithmetic types"); for (size_t i=0; i<N; ++i) { diff --git a/src/main.cpp b/src/main.cpp index 3e0613e38a0bce9e14869b70b43e1677e056cd28..80bffbe4722c0751ff05696ea99fa1d0ceeb24c5 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -99,7 +99,7 @@ int main(int argc, char *argv[]) unknowns.initializeSod(); - AcousticSolver<MeshDataType> acoustic_solver(mesh_data, unknowns, bc_list); + AcousticSolver<MeshDataType> acoustic_solver(mesh_data, bc_list); using Rd = TinyVector<MeshType::dimension>; @@ -122,7 +122,9 @@ int main(int argc, char *argv[]) VTKWriter vtk_writer("mesh", 0.01); while((t<tmax) and (iteration<itermax)) { - vtk_writer.write(mesh, t); + vtk_writer.write(mesh, {NamedItemValue{"density", rhoj}, + NamedItemValue{"velocity", unknowns.uj()}, + NamedItemValue{"coords", mesh.xr()}}, t); double dt = 0.4*acoustic_solver.acoustic_dt(Vj, cj); if (t+dt>tmax) { dt=tmax-t; @@ -134,7 +136,9 @@ int main(int argc, char *argv[]) t += dt; ++iteration; } - vtk_writer.write(mesh, t, true); // forces last output + vtk_writer.write(mesh, {NamedItemValue{"density", rhoj}, + NamedItemValue{"velocity", unknowns.uj()}, + NamedItemValue{"coords", mesh.xr()}}, t, true); // forces last output pout() << "* " << rang::style::underline << "Final time" << rang::style::reset << ": " << rang::fgB::green << t << rang::fg::reset << " (" << iteration << " iterations)\n"; @@ -208,7 +212,7 @@ int main(int argc, char *argv[]) unknowns.initializeSod(); - AcousticSolver<MeshDataType> acoustic_solver(mesh_data, unknowns, bc_list); + AcousticSolver<MeshDataType> acoustic_solver(mesh_data, bc_list); const CellValue<const double>& Vj = mesh_data.Vj(); @@ -229,7 +233,9 @@ int main(int argc, char *argv[]) VTKWriter vtk_writer("mesh", 0.01); while((t<tmax) and (iteration<itermax)) { - vtk_writer.write(mesh, t); + vtk_writer.write(mesh, {NamedItemValue{"density", rhoj}, + NamedItemValue{"velocity", unknowns.uj()}, + NamedItemValue{"coords", mesh.xr()}}, t); double dt = 0.4*acoustic_solver.acoustic_dt(Vj, cj); if (t+dt>tmax) { dt=tmax-t; @@ -241,7 +247,9 @@ int main(int argc, char *argv[]) t += dt; ++iteration; } - vtk_writer.write(mesh, t, true); // forces last output + vtk_writer.write(mesh, {NamedItemValue{"density", rhoj}, + NamedItemValue{"velocity", unknowns.uj()}, + NamedItemValue{"coords", mesh.xr()}}, t, true); // forces last output pout() << "* " << rang::style::underline << "Final time" << rang::style::reset << ": " << rang::fgB::green << t << rang::fg::reset << " (" << iteration << " iterations)\n"; @@ -304,7 +312,7 @@ int main(int argc, char *argv[]) unknowns.initializeSod(); - AcousticSolver<MeshDataType> acoustic_solver(mesh_data, unknowns, bc_list); + AcousticSolver<MeshDataType> acoustic_solver(mesh_data, bc_list); const CellValue<const double>& Vj = mesh_data.Vj(); @@ -325,7 +333,9 @@ int main(int argc, char *argv[]) VTKWriter vtk_writer("mesh", 0.01); while((t<tmax) and (iteration<itermax)) { - vtk_writer.write(mesh, t); + vtk_writer.write(mesh, {NamedItemValue{"density", rhoj}, + NamedItemValue{"velocity", unknowns.uj()}, + NamedItemValue{"coords", mesh.xr()}}, t); double dt = 0.4*acoustic_solver.acoustic_dt(Vj, cj); if (t+dt>tmax) { dt=tmax-t; @@ -336,7 +346,9 @@ int main(int argc, char *argv[]) t += dt; ++iteration; } - vtk_writer.write(mesh, t, true); // forces last output + vtk_writer.write(mesh, {NamedItemValue{"density", rhoj}, + NamedItemValue{"velocity", unknowns.uj()}, + NamedItemValue{"coords", mesh.xr()}}, t, true); // forces last output pout() << "* " << rang::style::underline << "Final time" << rang::style::reset << ": " << rang::fgB::green << t << rang::fg::reset << " (" << iteration << " iterations)\n"; diff --git a/src/mesh/Connectivity.hpp b/src/mesh/Connectivity.hpp index f876f70e11727c20fb72050da96a41bde8fe2f75..01c2da0ffff27d15f65b8a841522b37ad9285d7d 100644 --- a/src/mesh/Connectivity.hpp +++ b/src/mesh/Connectivity.hpp @@ -319,7 +319,7 @@ class Connectivity final template <ItemType source_item_type, ItemType target_item_type> PASTIS_INLINE - const auto getItemToItemMatrix() const + auto getItemToItemMatrix() const { return ItemToItemMatrix<source_item_type, target_item_type>(_getMatrix(source_item_type, @@ -327,73 +327,73 @@ class Connectivity final } PASTIS_INLINE - const auto cellToFaceMatrix() const + auto cellToFaceMatrix() const { return this->template getItemToItemMatrix<ItemType::cell, ItemType::face>(); } PASTIS_INLINE - const auto cellToEdgeMatrix() const + auto cellToEdgeMatrix() const { return this->template getItemToItemMatrix<ItemType::cell, ItemType::edge>(); } PASTIS_INLINE - const auto cellToNodeMatrix() const + auto cellToNodeMatrix() const { return this->template getItemToItemMatrix<ItemType::cell, ItemType::node>(); } PASTIS_INLINE - const auto faceToCellMatrix() const + auto faceToCellMatrix() const { return this->template getItemToItemMatrix<ItemType::face, ItemType::cell>(); } PASTIS_INLINE - const auto faceToEdgeMatrix() const + auto faceToEdgeMatrix() const { return this->template getItemToItemMatrix<ItemType::face, ItemType::edge>(); } PASTIS_INLINE - const auto faceToNodeMatrix() const + auto faceToNodeMatrix() const { return this->template getItemToItemMatrix<ItemType::face, ItemType::node>(); } PASTIS_INLINE - const auto edgeToCellMatrix() const + auto edgeToCellMatrix() const { return this->template getItemToItemMatrix<ItemType::edge, ItemType::cell>(); } PASTIS_INLINE - const auto edgeToFaceMatrix() const + auto edgeToFaceMatrix() const { return this->template getItemToItemMatrix<ItemType::edge, ItemType::face>(); } PASTIS_INLINE - const auto edgeToNodeMatrix() const + auto edgeToNodeMatrix() const { return this->template getItemToItemMatrix<ItemType::edge, ItemType::node>(); } PASTIS_INLINE - const auto nodeToCellMatrix() const + auto nodeToCellMatrix() const { return this->template getItemToItemMatrix<ItemType::node, ItemType::cell>(); } PASTIS_INLINE - const auto nodeToFaceMatrix() const + auto nodeToFaceMatrix() const { return this->template getItemToItemMatrix<ItemType::node, ItemType::face>(); } PASTIS_INLINE - const auto nodeToEdgeMatrix() const + auto nodeToEdgeMatrix() const { return this->template getItemToItemMatrix<ItemType::node, ItemType::edge>(); } diff --git a/src/mesh/ConnectivityMatrix.hpp b/src/mesh/ConnectivityMatrix.hpp index 512c2cfdfda322f1b410543a75eea2af7dc19061..53feb3375a9de19370d03a002cf869fe4f039c0f 100644 --- a/src/mesh/ConnectivityMatrix.hpp +++ b/src/mesh/ConnectivityMatrix.hpp @@ -31,25 +31,25 @@ class ConnectivityMatrix } PASTIS_INLINE - const auto numEntries() const + auto numEntries() const { return m_host_matrix.entries.extent(0); } PASTIS_INLINE - const auto numRows() const + auto numRows() const { return m_host_matrix.numRows(); } PASTIS_INLINE - const auto rowConst(const size_t& j) const + auto rowConst(const size_t& j) const { return m_host_matrix.rowConst(j); } PASTIS_INLINE - const auto rowMap(const size_t& j) const + const auto& rowMap(const size_t& j) const { return m_host_matrix.row_map[j]; } diff --git a/src/mesh/GmshReader.cpp b/src/mesh/GmshReader.cpp index 3a2d5c6ecc290a6ae71c234dd0551c7b48a22dca..b49328d77129789bcbefbd32ed29b34d40ba37e3 100644 --- a/src/mesh/GmshReader.cpp +++ b/src/mesh/GmshReader.cpp @@ -97,6 +97,7 @@ void ErrorHandler::writeErrorMessage() const switch(__type) { case asked: { perr() << "\nremark: exit command explicitly called\n"; + [[fallthrough]]; } case normal: { perr() << '\n' << __filename << ':' << __lineNumber @@ -577,6 +578,7 @@ GmshReader::__proceedData() case 4: {// hexahedra __hexahedra = Array<Hexahedron>(elementNumber[i]); __hexahedra_ref.resize(elementNumber[i]); + break; } // Ignored entities case 14: {// point diff --git a/src/mesh/ItemId.hpp b/src/mesh/ItemId.hpp index 11b87f7082bddbbbef76826bdc32b6272bc87d27..8fc4161e4d0222bdc5c1eb57b8f3dde18d2f473c 100644 --- a/src/mesh/ItemId.hpp +++ b/src/mesh/ItemId.hpp @@ -1,6 +1,7 @@ #ifndef ITEM_ID_HPP #define ITEM_ID_HPP +#include <PastisMacros.hpp> #include <ItemType.hpp> template <ItemType item_type> @@ -13,39 +14,53 @@ class ItemIdT base_type m_id; public: - operator const base_type&() const + PASTIS_INLINE + constexpr operator const base_type&() const { return m_id; } - ItemIdT operator++(int) + PASTIS_INLINE + constexpr ItemIdT operator++(int) { ItemIdT item_id(m_id); ++m_id; return std::move(item_id); } - ItemIdT& operator++() + PASTIS_INLINE + constexpr ItemIdT& operator++() { ++m_id; return *this; } - ItemIdT& operator=(const base_type& id) + PASTIS_INLINE + constexpr ItemIdT& operator=(const base_type& id) { m_id = id; return *this; } - ItemIdT& operator=(const ItemIdT&) = default; - ItemIdT& operator=(ItemIdT&&) = default; + PASTIS_INLINE + constexpr ItemIdT& operator=(const ItemIdT&) = default; - ItemIdT(const base_type& id) : m_id{id}{} + PASTIS_INLINE + constexpr ItemIdT& operator=(ItemIdT&&) = default; - ItemIdT(const ItemIdT&) = default; + PASTIS_INLINE + constexpr ItemIdT(const base_type& id) : m_id{id}{} - ItemIdT(ItemIdT&&) = default; - ItemIdT() = default; + PASTIS_INLINE + constexpr ItemIdT(const ItemIdT&) = default; + + PASTIS_INLINE + constexpr ItemIdT(ItemIdT&&) = default; + + PASTIS_INLINE + constexpr ItemIdT() = default; + + PASTIS_INLINE ~ItemIdT() = default; // forbidden rules @@ -70,7 +85,6 @@ class ItemIdT static_assert(other_item_type == item_type, "wrong type of item"); } - }; using NodeId = ItemIdT<ItemType::node>; diff --git a/src/mesh/ItemToItemMatrix.hpp b/src/mesh/ItemToItemMatrix.hpp index 38f8234c7ab4a1a1801644655a0d933a568cfced..bf7e86ebca7d279a03586a6ad183b24887457b23 100644 --- a/src/mesh/ItemToItemMatrix.hpp +++ b/src/mesh/ItemToItemMatrix.hpp @@ -62,8 +62,18 @@ class ItemToItemMatrix const ConnectivityMatrix& m_connectivity_matrix; public: + auto numberOfEntries() const + { + return m_connectivity_matrix.numEntries(); + } + + const auto& entries() const + { + return m_connectivity_matrix.entries(); + } + PASTIS_INLINE - const auto operator[](const SourceItemId& source_id) const + auto operator[](const SourceItemId& source_id) const { using RowType = decltype(m_connectivity_matrix.rowConst(source_id)); return SubItemList<RowType>(m_connectivity_matrix.rowConst(source_id)); @@ -71,7 +81,7 @@ class ItemToItemMatrix template <typename IndexType> PASTIS_INLINE - const auto operator[](const IndexType& source_id) const + const auto& operator[](const IndexType& source_id) const { static_assert(std::is_same<IndexType, SourceItemId>(), "ItemToItemMatrix must be indexed using correct ItemId"); diff --git a/src/mesh/ItemValue.hpp b/src/mesh/ItemValue.hpp index 754f66ac7e450af35cf5d89e6c22b4f040c4a661..bfea6dd3dbc294a02bb3ca8d060100bf9098f8bc 100644 --- a/src/mesh/ItemValue.hpp +++ b/src/mesh/ItemValue.hpp @@ -47,14 +47,14 @@ class ItemValue // Following Kokkos logic, these classes are view and const view does allow // changes in data PASTIS_FORCEINLINE - DataType& operator[](const ItemId& i) const + DataType& operator[](const ItemId& i) const noexcept(NO_ASSERT) { Assert(m_is_built); return m_values[i]; } template <typename IndexType> - DataType& operator[](const IndexType& i) const + DataType& operator[](const IndexType& i) const noexcept(NO_ASSERT) { static_assert(std::is_same<IndexType,ItemId>(), "ItemValue must be indexed by ItemId"); diff --git a/src/mesh/Mesh.hpp b/src/mesh/Mesh.hpp index c21910e7a5bb24f08ec1106db08793912ee0bc7b..1c5924a12bdead13b68f773a16a8537a42234555 100644 --- a/src/mesh/Mesh.hpp +++ b/src/mesh/Mesh.hpp @@ -8,7 +8,7 @@ struct IMesh { - virtual const size_t meshDimension() const = 0; + virtual size_t meshDimension() const = 0; ~IMesh() = default; }; @@ -28,7 +28,7 @@ private: public: PASTIS_INLINE - const size_t meshDimension() const + size_t meshDimension() const { return dimension; } diff --git a/src/mesh/MeshData.hpp b/src/mesh/MeshData.hpp index 6bd7e892576d329a82de8e10519f5b29fabb6e57..f9a2aeb575ac5265073d47ce2c4025da39db7d51 100644 --- a/src/mesh/MeshData.hpp +++ b/src/mesh/MeshData.hpp @@ -179,7 +179,7 @@ class MeshData const auto& face_nodes = face_to_node_matrix[l]; #warning should this lambda be replaced by a precomputed correspondance? - std::function local_node_number_in_cell + auto local_node_number_in_cell = [&](const NodeId& node_number) { for (size_t i_node=0; i_node<cell_nodes.size(); ++i_node) { if (node_number == cell_nodes[i_node]) { diff --git a/src/mesh/MeshNodeBoundary.hpp b/src/mesh/MeshNodeBoundary.hpp index 0dab302789a506c9dfcaabd2e5ed3f4d8706cc2f..a52a91c99d61c028fdc9f634c896d0ce06aa15dd 100644 --- a/src/mesh/MeshNodeBoundary.hpp +++ b/src/mesh/MeshNodeBoundary.hpp @@ -71,8 +71,7 @@ class MeshNodeBoundary } template <typename MeshType> - MeshNodeBoundary(const MeshType& mesh, - const RefNodeList& ref_node_list) + MeshNodeBoundary(const MeshType&, const RefNodeList& ref_node_list) : m_node_list(ref_node_list.nodeList()) { static_assert(dimension == MeshType::dimension); @@ -172,7 +171,7 @@ template <typename MeshType> PASTIS_INLINE TinyVector<1,double> MeshFlatNodeBoundary<1>:: -_getNormal(const MeshType& mesh) +_getNormal(const MeshType&) { static_assert(MeshType::dimension == 1); using R = TinyVector<1,double>; diff --git a/src/mesh/SubItemValuePerItem.hpp b/src/mesh/SubItemValuePerItem.hpp index afe1ee4fa99277a199cafeee9aceac935dee4400..edb73dd5cb216c1b5bf9df339204447cd062cb17 100644 --- a/src/mesh/SubItemValuePerItem.hpp +++ b/src/mesh/SubItemValuePerItem.hpp @@ -58,14 +58,14 @@ class SubItemValuePerItem<DataType, public: PASTIS_INLINE - const DataType& operator[](const size_t& i) const + const DataType& operator[](const size_t& i) const noexcept(NO_ASSERT) { Assert(i<m_size); return m_sub_values[i]; } PASTIS_FORCEINLINE - DataType& operator[](const size_t& i) + DataType& operator[](const size_t& i) noexcept(NO_ASSERT) { Assert(i<m_size); return m_sub_values[i]; @@ -85,7 +85,7 @@ class SubItemValuePerItem<DataType, PASTIS_INLINE SubView(const Array<DataType>& values, const size_t& begin, - const size_t& end) + const size_t& end) noexcept(NO_ASSERT) : m_sub_values(&(values[begin])), m_size(end-begin) { @@ -103,7 +103,7 @@ class SubItemValuePerItem<DataType, // Following Kokkos logic, these classes are view and const view does allow // changes in data PASTIS_FORCEINLINE - DataType& operator()(const ItemId& j, const size_t& r) const + DataType& operator()(const ItemId& j, const size_t& r) const noexcept(NO_ASSERT) { Assert(m_is_built); return m_values[m_host_row_map(size_t{j})+r]; @@ -111,7 +111,7 @@ class SubItemValuePerItem<DataType, template <typename IndexType> PASTIS_FORCEINLINE - DataType& operator()(const IndexType& j, const size_t& r) const + DataType& operator()(const IndexType& j, const size_t& r) const noexcept(NO_ASSERT) { static_assert(std::is_same<IndexType, size_t>(), "SubItemValuePerItem indexed by ItemId"); @@ -119,7 +119,7 @@ class SubItemValuePerItem<DataType, } PASTIS_INLINE - size_t numberOfValues() const + size_t numberOfValues() const noexcept(NO_ASSERT) { Assert(m_is_built); return m_values.size(); @@ -128,14 +128,14 @@ class SubItemValuePerItem<DataType, // Following Kokkos logic, these classes are view and const view does allow // changes in data PASTIS_FORCEINLINE - DataType& operator[](const size_t& i) const + DataType& operator[](const size_t& i) const noexcept(NO_ASSERT) { Assert(m_is_built); return m_values[i]; } template <typename IndexType> - DataType& operator[](const IndexType& i) const + DataType& operator[](const IndexType& i) const noexcept(NO_ASSERT) { static_assert(std::is_same<IndexType, size_t>(), "Access to SubItemValuePerItem's array must be indexed by size_t"); @@ -143,7 +143,7 @@ class SubItemValuePerItem<DataType, } PASTIS_INLINE - size_t numberOfItems() const + size_t numberOfItems() const noexcept(NO_ASSERT) { Assert(m_is_built); Assert(m_host_row_map.extent(0) != 0); @@ -151,14 +151,14 @@ class SubItemValuePerItem<DataType, } PASTIS_INLINE - size_t numberOfSubValues(const size_t& i_cell) const + size_t numberOfSubValues(const size_t& i_cell) const noexcept(NO_ASSERT) { Assert(m_is_built); return m_host_row_map(i_cell+1)-m_host_row_map(i_cell); } PASTIS_INLINE - SubView itemValues(const size_t& i_cell) + SubView itemValues(const size_t& i_cell) noexcept(NO_ASSERT) { Assert(m_is_built); const auto& cell_begin = m_host_row_map(i_cell); @@ -169,7 +169,7 @@ class SubItemValuePerItem<DataType, // Following Kokkos logic, these classes are view and const view does allow // changes in data PASTIS_INLINE - SubView itemValues(const size_t& i_cell) const + SubView itemValues(const size_t& i_cell) const noexcept(NO_ASSERT) { Assert(m_is_built); const auto& cell_begin = m_host_row_map(i_cell); diff --git a/src/output/OutputNamedItemValueSet.hpp b/src/output/OutputNamedItemValueSet.hpp new file mode 100644 index 0000000000000000000000000000000000000000..4f056098840f338f6afd869acad83f2f567d7d2f --- /dev/null +++ b/src/output/OutputNamedItemValueSet.hpp @@ -0,0 +1,121 @@ +#ifndef OUTPUT_NAMED_ITEM_VALUE_SET_HPP +#define OUTPUT_NAMED_ITEM_VALUE_SET_HPP + +#include <ItemValue.hpp> +#include <TinyVector.hpp> +#include <TinyMatrix.hpp> + +#include <variant> +#include <map> +#include <string> + +template <typename DataType, + ItemType item_type> +class NamedItemValue +{ + private: + std::string m_name; + ItemValue<const DataType,item_type> m_item_value; + + public: + constexpr const std::string& name() const + { + return m_name; + } + + constexpr const ItemValue<const DataType,item_type>& itemValue() const + { + return m_item_value; + } + + NamedItemValue& operator=(const NamedItemValue&) = default; + NamedItemValue& operator=(NamedItemValue&&) = default; + + NamedItemValue(const std::string& name, const ItemValue<DataType,item_type>& item_value) + : m_name(name), + m_item_value(item_value) + { + ; + } + + NamedItemValue(const std::string& name, const ItemValue<const DataType,item_type>& item_value) + : m_name(name), + m_item_value(item_value) + { + ; + } + + NamedItemValue(const NamedItemValue&) = default; + NamedItemValue(NamedItemValue&&) = default; + ~NamedItemValue() = default; +}; + +class OutputNamedItemValueSet +{ + public: + using ItemValueVariant = std::variant<NodeValue<const int>, + NodeValue<const long int>, + NodeValue<const double>, + NodeValue<const TinyVector<1,double>>, + NodeValue<const TinyVector<2,double>>, + NodeValue<const TinyVector<3,double>>, + + CellValue<const int>, + CellValue<const long int>, + CellValue<const double>, + CellValue<const TinyVector<1,double>>, + CellValue<const TinyVector<2,double>>, + CellValue<const TinyVector<3,double>> + >; + + private: + std::map<std::string, ItemValueVariant> m_name_itemvariant_map; + + template <typename DataType, + ItemType item_type> + PASTIS_FORCEINLINE + constexpr void _doInsert(const NamedItemValue<DataType, item_type>& named_itemvalue) + { + if (m_name_itemvariant_map.find(named_itemvalue.name()) == m_name_itemvariant_map.end()) { + m_name_itemvariant_map[named_itemvalue.name()] = named_itemvalue.itemValue(); + } + } + + template <typename DataType, + ItemType item_type, + typename... Args> + PASTIS_FORCEINLINE + constexpr void _unpackVariadicInput(const NamedItemValue<DataType, item_type>& named_itemvalue, + Args&&... args) + { + _doInsert(named_itemvalue); + if constexpr (sizeof...(args) > 0) { + this->_unpackVariadicInput(std::forward<Args>(args)...); + } + } + + public: + auto begin() const + { + return m_name_itemvariant_map.begin(); + } + + auto end() const + { + return m_name_itemvariant_map.end(); + } + + template <typename ...DataType, + ItemType ...item_type> + OutputNamedItemValueSet(NamedItemValue<DataType, item_type>... named_itemvalue) + { + _unpackVariadicInput(named_itemvalue...); + } + + OutputNamedItemValueSet(const OutputNamedItemValueSet&) = default; + OutputNamedItemValueSet() = default; + ~OutputNamedItemValueSet() = default; +}; + + +#endif // OUTPUT_NAMED_ITEM_VALUE_SET_HPP diff --git a/src/output/VTKWriter.hpp b/src/output/VTKWriter.hpp index 276bad33d5624f018b9d512743f4f7695a6213e5..ffed42738c967dde7b799cd7607eece281ce1ed5 100644 --- a/src/output/VTKWriter.hpp +++ b/src/output/VTKWriter.hpp @@ -9,6 +9,7 @@ #include <IConnectivity.hpp> #include <ItemValue.hpp> +#include <OutputNamedItemValueSet.hpp> class VTKWriter { @@ -18,9 +19,117 @@ class VTKWriter double m_last_time; const double m_time_period; + template <typename DataType> struct VTKType {}; + + template <typename DataType> + void _write_array(std::ofstream& os, + const std::string& name, + const Array<DataType>& item_value) + { + os << "<DataArray type=\"" << VTKType<DataType>::name + << "\" Name=\"" << name << "\">\n"; + for (typename Array<DataType>::index_type i=0; + i<item_value.size(); ++i) { + // The following '+' enforces integer output for char types + os << +item_value[i] << ' '; + } + os << "\n</DataArray>\n"; + } + + template <size_t N, + typename DataType> + void _write_array(std::ofstream& os, + const std::string& name, + const Array<TinyVector<N, DataType>>& item_value) + { + os << "<DataArray type=\"" << VTKType<DataType>::name + << "\" Name=\"" << name << "\" NumberOfComponents=\"" << N << "\">\n"; + for (typename Array<DataType>::index_type i=0; + i<item_value.size(); ++i) { + for (size_t j=0; j<N; ++j) { + // The following '+' enforces integer output for char types + os << +item_value[i][j] << ' '; + } + } + os << "\n</DataArray>\n"; + } + + template <typename DataType> + void _write_node_value(std::ofstream& os, + const std::string& name, + const NodeValue<const DataType>& item_value) + { + os << "<DataArray type=\"" << VTKType<DataType>::name + << "\" Name=\"" << name << "\">\n"; + for (NodeId i=0; i<item_value.size(); ++i) { + // The following '+' enforces integer output for char types + os << +item_value[i] << ' '; + } + os << "\n</DataArray>\n"; + } + + template <size_t N, + typename DataType> + void _write_node_value(std::ofstream& os, + const std::string& name, + const NodeValue<const TinyVector<N, DataType>>& item_value) + { + os << "<DataArray type=\"" << VTKType<DataType>::name + << "\" Name=\"" << name << "\" NumberOfComponents=\"" << N << "\">\n"; + for (NodeId i=0; i<item_value.size(); ++i) { + for (size_t j=0; j<N; ++j) { + // The following '+' enforces integer output for char types + os << +item_value[i][j] << ' '; + } + } + os << "\n</DataArray>\n"; + } + + template <typename DataType> + void _write_node_value(std::ofstream&, + const std::string&, + const CellValue<const DataType>&) {} + + template <typename DataType> + void _write_cell_value(std::ofstream& os, + const std::string& name, + const CellValue<const DataType>& item_value) + { + os << "<DataArray type=\"" << VTKType<DataType>::name + << "\" Name=\"" << name << "\">\n"; + for (CellId i=0; i<item_value.size(); ++i) { + // The following '+' enforces integer output for char types + os << +item_value[i] << ' '; + } + os << "\n</DataArray>\n"; + } + + template <size_t N, + typename DataType> + void _write_cell_value(std::ofstream& os, + const std::string& name, + const CellValue<const TinyVector<N, DataType>>& item_value) + { + os << "<DataArray type=\"" << VTKType<DataType>::name + << "\" Name=\"" << name << "\" NumberOfComponents=\"" << N << "\">\n"; + for (CellId i=0; i<item_value.size(); ++i) { + for (size_t j=0; j<N; ++j) { + // The following '+' enforces integer output for char types + os << +item_value[i][j] << ' '; + } + } + os << "\n</DataArray>\n"; + } + + template <typename DataType> + void _write_cell_value(std::ofstream&, + const std::string&, + const NodeValue<const DataType>&) {} + public: template <typename MeshType> void write(const MeshType& mesh, + const OutputNamedItemValueSet& output_named_item_value_set, const double& time, const bool& forced_output = false) { @@ -38,96 +147,98 @@ class VTKWriter fout << "<UnstructuredGrid>\n"; fout << "<Piece NumberOfPoints=\""<< mesh.numberOfNodes() << "\" NumberOfCells=\"" << mesh.numberOfCells() << "\">\n"; - + fout << "<CellData>\n"; + for(const auto& [name, item_value_variant] : output_named_item_value_set) { + std::visit([&, name=name](auto&& item_value) { + return this->_write_cell_value(fout, name, item_value); + }, item_value_variant); + } + fout << "</CellData>\n"; + fout << "<PointData>\n"; + for(const auto& [name, item_value_variant] : output_named_item_value_set) { + std::visit([&, name=name](auto&& item_value) { + return this->_write_node_value(fout, name, item_value); + }, item_value_variant); + } + fout << "</PointData>\n"; fout << "<Points>\n"; - fout << "<DataArray Name=\"Positions\" NumberOfComponents=\"3\" type=\"Float64\" format=\"ascii\">\n"; - using Rd = TinyVector<MeshType::dimension>; - const NodeValue<const Rd>& xr = mesh.xr(); - if constexpr(MeshType::dimension == 1) { - for (NodeId r=0; r<mesh.numberOfNodes(); ++r) { - for (unsigned short i=0; i<1; ++i) { - fout << xr[r][i] << ' '; - } - fout << "0 0 "; // VTK requires 3 components - } - } else if constexpr (MeshType::dimension == 2) { + { + using Rd = TinyVector<MeshType::dimension>; + const NodeValue<const Rd>& xr = mesh.xr(); + Array<TinyVector<3>> positions(mesh.numberOfNodes()); for (NodeId r=0; r<mesh.numberOfNodes(); ++r) { - for (unsigned short i=0; i<2; ++i) { - fout << xr[r][i] << ' '; + for (unsigned short i=0; i<MeshType::dimension; ++i) { + positions[r][i] = xr[r][i]; } - fout << "0 "; // VTK requires 3 components - } - } else { - for (NodeId r=0; r<mesh.numberOfNodes(); ++r) { - for (unsigned short i=0; i<3; ++i) { - fout << xr[r][i] << ' '; + for (unsigned short i=MeshType::dimension; i<3; ++i) { + positions[r][i] = 0; } } + _write_array(fout, "Positions", positions); } - fout << '\n'; - fout << "</DataArray>\n"; fout << "</Points>\n"; fout << "<Cells>\n"; - fout << "<DataArray type=\"Int32\" Name=\"connectivity\" NumberOfComponents=\"1\" format=\"ascii\">\n"; - - const auto& cell_to_node_matrix - = mesh.connectivity().cellToNodeMatrix(); + { + const auto& cell_to_node_matrix + = mesh.connectivity().cellToNodeMatrix(); + Array<int> connectivity(cell_to_node_matrix.numberOfEntries()); - for (CellId j=0; j<mesh.numberOfCells(); ++j) { - const auto& cell_nodes = cell_to_node_matrix[j]; - for (unsigned short r=0; r<cell_nodes.size(); ++r) { - fout << cell_nodes[r] << ' '; + for (size_t i=0; i<cell_to_node_matrix.numberOfEntries(); ++i) { + connectivity[i] = cell_to_node_matrix.entries()[i]; } + _write_array(fout, "connectivity", connectivity); } - fout << '\n'; - fout << "</DataArray>\n"; - fout << "<DataArray type=\"UInt32\" Name=\"offsets\" NumberOfComponents=\"1\" format=\"ascii\">\n"; { + const auto& cell_to_node_matrix + = mesh.connectivity().cellToNodeMatrix(); + Array<unsigned int> offsets(mesh.numberOfCells()); unsigned int offset=0; for (CellId j=0; j<mesh.numberOfCells(); ++j) { const auto& cell_nodes = cell_to_node_matrix[j]; offset += cell_nodes.size(); - fout << offset << ' '; + offsets[j]=offset; } + _write_array(fout, "offsets", offsets); } - fout << '\n'; - fout << "</DataArray>\n"; - - fout << "<DataArray type=\"Int8\" Name=\"types\" NumberOfComponents=\"1\" format=\"ascii\">\n"; - for (CellId j=0; j<mesh.numberOfCells(); ++j) { - const auto& cell_nodes = cell_to_node_matrix[j]; - switch (cell_nodes.size()) { - case 2: { - fout << "3 "; - break; - } - case 3: { - fout << "5 "; - break; - } - case 4: { - if (mesh.meshDimension() == 3) { - fout << "10 "; - } else { - fout << "9 "; + + { + const auto& cell_to_node_matrix + = mesh.connectivity().cellToNodeMatrix(); + Array<int8_t> types(mesh.numberOfCells()); + for (CellId j=0; j<mesh.numberOfCells(); ++j) { + const auto& cell_nodes = cell_to_node_matrix[j]; + switch (cell_nodes.size()) { + case 2: { + types[j]=3; + break; + } + case 3: { + types[j]=5; + break; + } + case 4: { + if (mesh.meshDimension() == 3) { + types[j]=10; + } else { + types[j]=9; + } + break; + } + case 8: { + types[j]=12; + break; + } + default: { + types[j]=7; + break; } - break; - } - case 8: { - fout << "12 "; - break; - } - default: { - fout << "7 "; - break; } } + _write_array(fout, "types", types); } - fout << '\n'; - fout << "</DataArray>\n"; fout << "</Cells>\n"; fout << "</Piece>\n"; @@ -136,6 +247,7 @@ class VTKWriter m_file_number++; } + VTKWriter(const std::string& base_filename, const double time_period) : m_base_filename(base_filename), @@ -147,4 +259,55 @@ class VTKWriter ~VTKWriter() = default; }; +template <> +struct VTKWriter::VTKType<int8_t> +{ + inline const static std::string name{"Int8"}; +}; + +template <> struct VTKWriter::VTKType<uint8_t> +{ + inline const static std::string name{"UInt8"}; +}; + +template <> struct VTKWriter::VTKType<int16_t> +{ + inline const static std::string name{"Int16"}; +}; + +template <> struct VTKWriter::VTKType<uint16_t> +{ + inline const static std::string name{"UInt16"}; +}; + +template <> struct VTKWriter::VTKType<int32_t> +{ + inline const static std::string name{"Int32"}; +}; + +template <> struct VTKWriter::VTKType<uint32_t> +{ + inline const static std::string name{"UInt32"}; +}; + +template <> struct VTKWriter::VTKType<int64_t> +{ + inline const static std::string name{"Int64"}; +}; + +template <> struct VTKWriter::VTKType<uint64_t> +{ + inline const static std::string name{"UInt64"}; +}; + +template <> struct VTKWriter::VTKType<float> +{ + inline const static std::string name{"Float32"}; +}; + +template <> struct VTKWriter::VTKType<double> +{ + inline const static std::string name{"Float64"}; +}; + #endif // VTK_WRITER_HPP diff --git a/src/scheme/AcousticSolver.hpp b/src/scheme/AcousticSolver.hpp index 07ae8902dae5d00177e4f856e3fc5348db48bfc5..4d09a8ede6c6774d2cd0415f7b477730a9ff3507 100644 --- a/src/scheme/AcousticSolver.hpp +++ b/src/scheme/AcousticSolver.hpp @@ -48,7 +48,7 @@ class AcousticSolver PASTIS_INLINE void computeAjr(const CellValue<const double>& rhocj, const NodeValuePerCell<const Rd>& Cjr, - const NodeValuePerCell<const double>& ljr, + const NodeValuePerCell<const double>& /* ljr */, const NodeValuePerCell<const Rd>& njr) { parallel_for(m_mesh.numberOfCells(), PASTIS_LAMBDA(const CellId& j) { @@ -197,13 +197,10 @@ class AcousticSolver } PASTIS_INLINE - void computeExplicitFluxes(const NodeValue<const Rd>& xr, - const CellValue<const Rd>& xj, - const CellValue<const double>& rhoj, + void computeExplicitFluxes(const CellValue<const double>& rhoj, const CellValue<const Rd>& uj, const CellValue<const double>& pj, const CellValue<const double>& cj, - const CellValue<const double>& Vj, const NodeValuePerCell<const Rd>& Cjr, const NodeValuePerCell<const double>& ljr, const NodeValuePerCell<const Rd>& njr) { @@ -232,7 +229,6 @@ class AcousticSolver public: AcousticSolver(MeshData& mesh_data, - UnknownsType& unknowns, const std::vector<BoundaryConditionHandler>& bc_list) : m_mesh_data(mesh_data), m_mesh(mesh_data.mesh()), @@ -271,7 +267,7 @@ class AcousticSolver return ReduceMin(m_Vj_over_cj); } - void computeNextStep(const double& t, const double& dt, + void computeNextStep(const double&, const double& dt, UnknownsType& unknowns) { CellValue<double>& rhoj = unknowns.rhoj(); @@ -282,14 +278,12 @@ class AcousticSolver CellValue<double>& pj = unknowns.pj(); CellValue<double>& cj = unknowns.cj(); - const CellValue<const Rd>& xj = m_mesh_data.xj(); const CellValue<const double>& Vj = m_mesh_data.Vj(); const NodeValuePerCell<const Rd>& Cjr = m_mesh_data.Cjr(); const NodeValuePerCell<const double>& ljr = m_mesh_data.ljr(); const NodeValuePerCell<const Rd>& njr = m_mesh_data.njr(); - const NodeValue<const Rd>& xr = m_mesh.xr(); - computeExplicitFluxes(xr, xj, rhoj, uj, pj, cj, Vj, Cjr, ljr, njr); + computeExplicitFluxes(rhoj, uj, pj, cj, Cjr, ljr, njr); const NodeValuePerCell<Rd>& Fjr = m_Fjr; const NodeValue<const Rd> ur = m_ur; diff --git a/src/utils/Array.hpp b/src/utils/Array.hpp index e7273ecee82142014b378a55980d66c0305f016a..33d8ba7ac1b2546e26b91dafd6d969cb1870b784 100644 --- a/src/utils/Array.hpp +++ b/src/utils/Array.hpp @@ -21,13 +21,13 @@ class Array public: PASTIS_INLINE - size_t size() const + size_t size() const noexcept { return m_values.extent(0); } PASTIS_INLINE - DataType& operator[](const index_type& i) const + DataType& operator[](const index_type& i) const noexcept(NO_ASSERT) { Assert(i<m_values.extent(0)); return m_values[i]; @@ -43,7 +43,7 @@ class Array template <typename DataType2> PASTIS_INLINE - Array& operator=(const Array<DataType2>& array) + Array& operator=(const Array<DataType2>& array) noexcept { // ensures that DataType is the same as source DataType2 static_assert(std::is_same<std::remove_const_t<DataType>, std::remove_const_t<DataType2>>(), @@ -67,7 +67,7 @@ class Array template <typename DataType2> PASTIS_INLINE - Array(const Array<DataType2>& array) + Array(const Array<DataType2>& array) noexcept { this->operator=(array); } diff --git a/src/utils/CMakeLists.txt b/src/utils/CMakeLists.txt index 5152bf5285ece836b5e8137755ab4935b434913e..045c6d879715b130dedf6b8135e3fb4ed9421483 100644 --- a/src/utils/CMakeLists.txt +++ b/src/utils/CMakeLists.txt @@ -51,7 +51,7 @@ add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/pastis_git_revision.hpp add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/pastis_git_revision PRE_BUILD - COMMAND ${CMAKE_COMMAND} -DCMAKE_PASTIS_VERSION=${Pastis_VERSION} -DPASTIS_SOURCE_DIR=${PASTIS_SOURCE_DIR} -P ${PASTIS_SOURCE_DIR}/cmake/GetPastisGitRevision.cmake + COMMAND ${CMAKE_COMMAND} -DPASTIS_VERSION=${PASTIS_VERSION} -DPASTIS_SOURCE_DIR=${PASTIS_SOURCE_DIR} -P ${PASTIS_SOURCE_DIR}/cmake/GetPastisGitRevision.cmake COMMENT "Check pastis git status" VERBATIM ) diff --git a/src/utils/PastisAssert.hpp b/src/utils/PastisAssert.hpp index 9f5a171ac0b723ee553fb2a71b15e3d2743d6340..d260ce25f293e955c0bbfbaa66861345658f9995 100644 --- a/src/utils/PastisAssert.hpp +++ b/src/utils/PastisAssert.hpp @@ -45,19 +45,29 @@ class AssertError ~AssertError() = default; }; +#pragma GCC diagnostic ignored "-Wattributes" +inline bool +__attribute__((analyzer_noreturn)) +_pastis_assert(const bool& assert) +{ + return assert; +} +#pragma GCC diagnostic pop + #ifdef NDEBUG // Useless test is there to check syntax even in optimized mode. Costs nothing. -#define Assert(assertion) if (not (assertion)) {} +#define Assert(assertion) \ + if (not _pastis_assert(assertion)) {} #else // NDEBUG -#define Assert(assertion) \ - if (not (assertion)) { \ - throw AssertError(__FILE__, \ - __LINE__, \ - __PRETTY_FUNCTION__, \ - (#assertion)); \ +#define Assert(assertion) \ + if (not _pastis_assert(assertion)) { \ + throw AssertError(__FILE__, \ + __LINE__, \ + __PRETTY_FUNCTION__, \ + (#assertion)); \ } #endif // NDEBUG diff --git a/src/utils/pastis_version.hpp.in b/src/utils/pastis_version.hpp.in index 2d9bd821530f46102f493b795bbc9c2bbf2dc27a..f07da441fa893ebc7da844dfde6379c040c71af2 100644 --- a/src/utils/pastis_version.hpp.in +++ b/src/utils/pastis_version.hpp.in @@ -1,6 +1,6 @@ #ifndef PASTIS_VERSION_HPP #define PASTIS_VERSION_HPP -#define PASTIS_VERSION "@Pastis_VERSION@" +#define PASTIS_VERSION "@PASTIS_VERSION@" #endif // PASTIS_VERSION_HPP