Skip to content

Grid Parallel

Sam Reeve edited this page Sep 12, 2024 · 2 revisions

Overview

Cabana::Grid provides capabilities for parallel iteration over structured grids which directly use linear and multi-dimensional Kokkos::parallel_for for Cabana::Grid::grid_parallel_for.

Implementation

Cabana_Grid_Parallel.hpp

Examples

Usage

    auto array = Cabana::Grid::createArray<double, device_type>( "label", node_layout );
    auto array_view = array->view();

    Cabana::Grid::grid_parallel_for(
        "local_grid_for", exec_space(), *local_grid, Cabana::Grid::Own(),
        Cabana::Grid::Cell(), KOKKOS_LAMBDA( const int i, const int j, const int k ) {
            for ( int l = 0; l < 4; ++l )
                array_view( i, j, k, l ) = 1.0;
        } );

This is part of the Programming Guide series

Clone this wiki locally