A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://kokkos.github.io/kokkos-core-wiki/API/core/initialize_finalize/initialize.html below:

initialize - Kokkos documentation

Toggle table of contents sidebar

initialize

Defined in header <Kokkos_Core.hpp>

Usage:

Kokkos::initialize(argc, argv);
Kokkos::initialize(Kokkos::InitializationSettings()  // (since 3.7)
                       .set_disable_warnings(true)
                       .set_num_threads(8)
                       .set_map_device_id_by("random"));

Initializes the Kokkos execution environment. This function must be called before any other Kokkos API functions or constructors. There are a small number of exceptions, such as Kokkos::is_initialized and Kokkos::is_finalized. Kokkos can be initialized at most once; subsequent calls are erroneous.

The function has two overloads. The first one takes the same two parameters as main() corresponding to the command line arguments passed to the program from the environment in which the program is run. Kokkos parses the arguments for the flags that it recognizes. Whenever a Kokkos flag is seen, it is removed from argv, and argc is decremented. The second one takes a Kokkos::InitializationSettings class object which allows for programmatic control of arguments. Kokkos::InitializationSettings is implicitly constructible from the Kokkos::InitArguments deprecated in version 3.7.

Interface
Kokkos::initialize(int& argc, char* argv[]);                 //             (1)
Kokkos::initialize(InitArguments const& arguments);          // (until 3.7) (2)
Kokkos::initialize(InitializationSettings const& settings);  // (since 3.7) (3)
Parameters Requirements Semantics Example
#include <Kokkos_Core.hpp>

int main(int argc, char* argv[]) {
    Kokkos::initialize(argc, argv);
    {  // scope to ensure that my_view destructor is called before Kokkos::finalize
        Kokkos::View<double*> my_view("my_view", 10);
    }  // scope of my_view ends here
    Kokkos::finalize();
}
See also

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4