-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'bGridDisg' into DisgMultiResLBM
- Loading branch information
Showing
66 changed files
with
6,055 additions
and
60 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
#pragma once | ||
#include "Neon/domain/details/bGridDisgMgpu//bGrid.h" | ||
|
||
namespace Neon { | ||
using bGridMgpu = Neon::domain::details::bGridMgpu::bGridMgpuDefault; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
29 changes: 29 additions & 0 deletions
29
libNeonDomain/include/Neon/domain/details/bGridDisgMask/BlockView.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
#include "Neon/domain/details/bGridDisgMask/BlockViewGrid//BlockViewGrid.h" | ||
#include "Neon/domain/tools/GridTransformer.h" | ||
|
||
namespace Neon::domain::details::disaggregated::bGridMask { | ||
|
||
struct BlockView | ||
{ | ||
public: | ||
using Grid = Neon::domain::tool::GridTransformer<details::GridTransformation>::Grid; | ||
template <typename T, int C = 0> | ||
using Field = Grid::template Field<T, C>; | ||
using index_3d = Neon::index_3d; | ||
|
||
template <typename T, int C = 0> | ||
static auto helpGetReference(T* mem, const int idx, const int card) -> std::enable_if_t<C == 0, T&> | ||
{ | ||
return mem[idx * card]; | ||
} | ||
|
||
template <typename T, int C = 0> | ||
static auto helpGetReference(T* mem, const int idx, const int card) -> std::enable_if_t<C != 0, T&> | ||
{ | ||
return mem[idx * C]; | ||
} | ||
|
||
static constexpr Neon::MemoryLayout layout = Neon::MemoryLayout::arrayOfStructs; | ||
}; | ||
|
||
} // namespace Neon::domain::details::disaggregated::bGrid |
97 changes: 97 additions & 0 deletions
97
libNeonDomain/include/Neon/domain/details/bGridDisgMask/BlockViewGrid/BlockViewGrid.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,97 @@ | ||
#pragma once | ||
#include <assert.h> | ||
|
||
#include "Neon/core/core.h" | ||
#include "Neon/core/types/DataUse.h" | ||
#include "Neon/core/types/Macros.h" | ||
|
||
#include "Neon/set/BlockConfig.h" | ||
#include "Neon/set/Containter.h" | ||
#include "Neon/set/DevSet.h" | ||
#include "Neon/set/MemoryOptions.h" | ||
|
||
#include "Neon/sys/memory/MemDevice.h" | ||
|
||
#include "Neon/domain/aGrid.h" | ||
|
||
#include "Neon/domain/interface/GridBaseTemplate.h" | ||
#include "Neon/domain/interface/GridConcept.h" | ||
#include "Neon/domain/interface/KernelConfig.h" | ||
#include "Neon/domain/interface/LaunchConfig.h" | ||
#include "Neon/domain/interface/Stencil.h" | ||
#include "Neon/domain/interface/common.h" | ||
|
||
#include "Neon/domain/tools/GridTransformer.h" | ||
#include "Neon/domain/tools/SpanTable.h" | ||
|
||
#include "Neon/domain/details/eGrid/eGrid.h" | ||
#include "Neon/domain/patterns/PatternScalar.h" | ||
|
||
#include "BlockViewPartition.h" | ||
|
||
namespace Neon::domain::details::disaggregated::bGridMask { | ||
|
||
namespace details { | ||
struct GridTransformation | ||
{ | ||
template <typename T, int C> | ||
using Partition = BlockViewPartition<T, C>; | ||
using Span = Neon::domain::details::eGrid::eSpan; | ||
static constexpr Neon::set::internal::ContainerAPI::DataViewSupport dataViewSupport = Neon::set::internal::ContainerAPI::DataViewSupport::on; | ||
|
||
using FoundationGrid = Neon::domain::details::eGrid::eGrid; | ||
static constexpr Neon::set::details::ExecutionThreadSpan executionThreadSpan = FoundationGrid::executionThreadSpan; | ||
using ExecutionThreadSpanIndexType = int32_t; | ||
using Idx = FoundationGrid::Idx; | ||
|
||
static auto getDefaultBlock(FoundationGrid& foundationGrid) -> Neon::index_3d const& | ||
{ | ||
return foundationGrid.getDefaultBlock(); | ||
} | ||
|
||
static auto initSpan(FoundationGrid& foundationGrid, Neon::domain::tool::SpanTable<Span>& spanTable) -> void | ||
{ | ||
spanTable.forEachConfiguration([&](Neon::Execution execution, | ||
Neon::SetIdx setIdx, | ||
Neon::DataView dw, | ||
Span& span) { | ||
span = foundationGrid.getSpan(execution, setIdx, dw); | ||
}); | ||
} | ||
|
||
static auto initLaunchParameters(FoundationGrid& foundationGrid, | ||
Neon::DataView dataView, | ||
const Neon::index_3d& blockSize, | ||
const size_t& shareMem) -> Neon::set::LaunchParameters | ||
{ | ||
return foundationGrid.getLaunchParameters(dataView, blockSize, shareMem); | ||
} | ||
|
||
static auto helpGetGridIdx(FoundationGrid&, | ||
Neon::SetIdx const&, | ||
FoundationGrid::Idx const& fgIdx) | ||
-> GridTransformation::Idx | ||
{ | ||
GridTransformation::Idx tgIdx = fgIdx; | ||
return tgIdx; | ||
} | ||
|
||
template <typename T, int C> | ||
static auto initFieldPartition(FoundationGrid::Field<T, C>& foundationField, | ||
Neon::domain::tool::PartitionTable<Partition<T, C>>& partitionTable) -> void | ||
{ | ||
partitionTable.forEachConfiguration( | ||
[&](Neon::Execution execution, | ||
Neon::SetIdx setIdx, | ||
Neon::DataView dw, | ||
Partition<T, C>& partition) { | ||
auto& foundationPartition = foundationField.getPartition(execution, setIdx, dw); | ||
partition = Partition<T, C>(foundationPartition); | ||
}); | ||
} | ||
}; | ||
using BlockViewGrid = Neon::domain::tool::GridTransformer<details::GridTransformation>::Grid; | ||
|
||
} // namespace details | ||
|
||
} // namespace Neon::domain::details::bGrid |
Oops, something went wrong.