Skip to content
Snippets Groups Projects
Commit 57dc814c authored by Jakub Klinkovský's avatar Jakub Klinkovský
Browse files

Fixed order of indices in the traverser benchmarks

parent 7a151198
No related branches found
No related tags found
1 merge request!20Traversers optimizations
......@@ -98,7 +98,7 @@ class GridTraversersBenchmark< 2, Device, Real, Index >
Index _size = this->size;
auto f = [=] __cuda_callable__ ( Index i, Index j, Real* data )
{
data[ i * _size + j ] += 1.0;
data[ j * _size + i ] += 1.0;
};
ParallelFor2D< Device >::exec( ( Index ) 0,
......@@ -114,8 +114,8 @@ class GridTraversersBenchmark< 2, Device, Real, Index >
auto f = [=] __cuda_callable__ ( Index i, Index j, Real* data )
{
Cell entity( *currentGrid );
entity.getCoordinates().y() = i;
entity.getCoordinates().x() = j;
entity.getCoordinates().x() = i;
entity.getCoordinates().y() = j;
entity.refresh();
data[ entity.getIndex() ] += 1.0;
};
......@@ -134,8 +134,8 @@ class GridTraversersBenchmark< 2, Device, Real, Index >
auto f = [=] __cuda_callable__ ( Index i, Index j, Real* data )
{
Cell entity( *currentGrid );
entity.getCoordinates().y() = i;
entity.getCoordinates().x() = j;
entity.getCoordinates().x() = i;
entity.getCoordinates().y() = j;
entity.refresh();
( *_u )( entity ) += 1.0;
};
......@@ -249,4 +249,4 @@ class GridTraversersBenchmark< 2, Device, Real, Index >
} // namespace Traversers
} // namespace Benchmarks
} // namespace TNL
\ No newline at end of file
} // namespace TNL
......@@ -104,7 +104,7 @@ class GridTraversersBenchmark< 3, Device, Real, Index >
Index _size = this->size;
auto f = [=] __cuda_callable__ ( Index i, Index j, Index k, Real* data )
{
data[ ( i * _size + j ) * _size + k ] += 1.0;
data[ ( k * _size + j ) * _size + i ] += 1.0;
};
ParallelFor3D< Device >::exec( ( Index ) 0,
......@@ -122,9 +122,9 @@ class GridTraversersBenchmark< 3, Device, Real, Index >
auto f = [=] __cuda_callable__ ( Index i, Index j, Index k, Real* data )
{
Cell entity( *currentGrid );
entity.getCoordinates().z() = i;
entity.getCoordinates().x() = i;
entity.getCoordinates().y() = j;
entity.getCoordinates().x() = k;
entity.getCoordinates().z() = k;
entity.refresh();
data[ entity.getIndex() ] += 1.0;
};
......@@ -145,9 +145,9 @@ class GridTraversersBenchmark< 3, Device, Real, Index >
auto f = [=] __cuda_callable__ ( Index i, Index j, Index k, Real* data )
{
Cell entity( *currentGrid );
entity.getCoordinates().z() = i;
entity.getCoordinates().x() = i;
entity.getCoordinates().y() = j;
entity.getCoordinates().x() = k;
entity.getCoordinates().z() = k;
entity.refresh();
( *_u )( entity ) += 1.0;
};
......@@ -257,4 +257,4 @@ class GridTraversersBenchmark< 3, Device, Real, Index >
} // namespace Traversers
} // namespace Benchmarks
} // namespace TNL
\ No newline at end of file
} // namespace TNL
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment