├── .clang-format ├── .clang-tidy ├── .github └── workflows │ ├── Ubuntu.yml │ ├── Windows.yml │ ├── cla.yml │ └── mkdocs.yml ├── .gitignore ├── CMakeLists.txt ├── LICENSE.txt ├── README.md ├── VerifyNeonPRUnix.sh ├── VerifyNeonPRWindows.bat ├── apps ├── CMakeLists.txt ├── fractal │ ├── CMakeLists.txt │ ├── fractal.cu │ └── fractals.gif ├── gameOfLife │ ├── CMakeLists.txt │ ├── conways.gif │ └── gameOfLife.cu ├── lbm │ ├── CMakeLists.txt │ ├── lbm.cu │ ├── lbm2d-vel-mag.gif │ ├── lbm2d-vel-vor.gif │ └── lbm3d-vel-mag.gif ├── lbmMultiRes │ ├── CMakeLists.txt │ ├── README.md │ ├── coalescence.h │ ├── collide.h │ ├── explosion.h │ ├── flowOverShape.h │ ├── fusedFinest.h │ ├── init.h │ ├── lattice.h │ ├── lbmMultiRes.cu │ ├── lbmMultiRes.h │ ├── lid │ │ └── run.sh │ ├── lidDrivenCavity.h │ ├── postProcess.h │ ├── practice_v28.obj │ ├── run.sh │ ├── scripts │ │ ├── MultiResNeon_vs_ghia1982.png │ │ ├── NeonMultiResLBM_5000_X.dat │ │ ├── NeonMultiResLBM_5000_Y.dat │ │ ├── NeonUniformLBM_20000_Y.dat │ │ ├── UniformNeon_vs_ghia1982.png │ │ ├── ghia1982.dat │ │ └── plot.py │ ├── sphere │ │ └── run.sh │ ├── sphere3.obj │ ├── store.h │ ├── stream.h │ ├── util.h │ └── verify.h └── poisson │ ├── CMakeLists.txt │ ├── poisson.cu │ └── possion.png ├── benchmarks ├── CMakeLists.txt ├── lbm-flow-over-sphere │ ├── CMakeLists.txt │ ├── run.sh │ └── src │ │ ├── CellType.h │ │ ├── Config.cpp │ │ ├── Config.h │ │ ├── D3Q19.h │ │ ├── LbmContainers.h │ │ ├── LbmSkeleton.h │ │ ├── Metrics.h │ │ ├── Report.cpp │ │ ├── Report.h │ │ ├── RunTwoPop.cu │ │ ├── RunTwoPop.h │ │ └── app.cpp └── lbm-lid-driven-cavity-flow │ ├── CMakeLists.txt │ ├── lbm-lid-driven-cavity-flow.py │ ├── lbm-lid-driven-cavity-flow.sh │ └── src │ ├── CellType.h │ ├── Config.cpp │ ├── Config.h │ ├── D3Q19.h │ ├── LbmIteration.h │ ├── LbmTools.h │ ├── Metrics.h │ ├── Repoert.h │ ├── Report.cpp │ ├── RunCavityTwoPop.cu │ ├── RunCavityTwoPop.h │ └── app.cpp ├── cmake ├── AutoDetectCudaArch.cmake ├── ExportHeader.cmake ├── GetGitRevisionDescription.cmake ├── GetGitRevisionDescription.cmake.in ├── LoadingExternalGitRepositories.cmake ├── ManageCompilationFlags.cmake ├── ManageGitShaInformation.cmake ├── ManageLibraryType.cmake ├── ManageTargetCUDACompute.cmake ├── ManageUnitTests.cmake ├── Nvtx.cmake └── git_sha1.cpp.in ├── docs ├── .DS_Store ├── CODE_OF_CONDUCT.md ├── CONTRIBUTING.md ├── CONTRIBUTORS.md ├── CodeConvention.md ├── cla │ └── ADSK-Form-Corp-Contrib-Agmt-for-Open-Source.pdf ├── doxygen │ └── Doxyfile ├── gallery │ ├── apps.md │ └── img │ │ ├── fractals.gif │ │ ├── ghia1982-fig.png │ │ ├── gol.gif │ │ ├── karman-lbm2d-vel-mag.gif │ │ ├── karman-lbm2d-vel-vor.gif │ │ ├── lbm2d-vel-mag.gif │ │ ├── lbm2d-vel-vor.gif │ │ ├── lbm3d-vel-mag.gif │ │ └── possion.png ├── img │ ├── favicon.ico │ └── high-level-idea.png ├── index.md ├── javascripts │ └── mathjax.js ├── learn │ ├── advanced-mechanisms │ │ └── multi-resolution.md │ ├── examples │ │ └── mandelbrot.md │ ├── guided-tutorials-introduction.md │ ├── img │ │ ├── axpy-laplace-dot-app.png │ │ ├── axpy-laplace-dot-code.png │ │ ├── axpy-laplace-dot-e2occ.png │ │ ├── axpy-laplace-dot-eocc.png │ │ ├── axpy-laplace-dot-nocc.png │ │ ├── axpy-laplace-dot-socc.png │ │ └── neon-layers.png │ ├── multi-resolution │ │ └── multi-resolution.md │ ├── staggered-grids │ │ ├── img │ │ │ ├── staggered-grid.jpg │ │ │ ├── staggered-grid.png │ │ │ ├── staggeredGrid-0000.png │ │ │ ├── staggeredGrid-0001.png │ │ │ ├── staggeredGrid-0002.png │ │ │ ├── staggeredGrid-offsets.png │ │ │ ├── staggeredGrid-tutorial-0000.png │ │ │ ├── staggeredGrid-tutorial-0001.png │ │ │ └── staggeredGrid-tutorial-0002.png │ │ └── staggered-grid.md │ └── the-bases │ │ ├── 01-system-level.md │ │ ├── 02-the-set-level.md │ │ ├── 03-domain-level.md │ │ ├── 04-skeleton-level.md │ │ └── img │ │ ├── 01-layers-system.png │ │ ├── 02-layers-set.png │ │ ├── 03-domain.vtk.png │ │ ├── 03-expanded-levelSet.png │ │ ├── 03-grad.png │ │ ├── 03-initial-levelSet.png │ │ ├── 03-layers-domain.png │ │ └── 04-layers-skeleton.png ├── logo │ └── neonDarkLogo.jpg ├── maintainers.md └── references │ ├── api-documentation.md │ ├── bibtex │ └── Meneghin-2022-NAM.bib │ ├── papers-presentations.md │ └── performance-considerations.md ├── libNeonCore ├── CMakeLists.txt ├── include │ └── Neon │ │ └── core │ │ ├── core.h │ │ ├── tools │ │ ├── IO.h │ │ ├── Logger.h │ │ ├── Report.h │ │ ├── Report_imp.h │ │ ├── clipp.h │ │ ├── development │ │ │ └── workInProgress.h │ │ ├── git_sha1.h │ │ ├── io │ │ │ ├── IODense.h │ │ │ ├── IODenseVTK.h │ │ │ ├── IODenseVTK_imp.h │ │ │ ├── IODense_imp.h │ │ │ ├── exportVTI.h │ │ │ ├── ioToVTK.h │ │ │ └── ioToVti.h │ │ ├── metaprogramming.h │ │ └── metaprogramming │ │ │ ├── applyTuple.h │ │ │ ├── computeFunOnTuple.h │ │ │ ├── createTupleVecType.h │ │ │ ├── debugHelp.h │ │ │ ├── extractTupleVecType.h │ │ │ ├── hasNestedSubtype.h │ │ │ └── tupleVecTable.h │ │ └── types │ │ ├── Access.h │ │ ├── Allocator.h │ │ ├── BasicTypes.h │ │ ├── DataUse.h │ │ ├── DataView.h │ │ ├── DeviceType.h │ │ ├── Exceptions.h │ │ ├── Execution.h │ │ ├── Macros.h │ │ ├── MemoryLayout.h │ │ ├── SetIdx.h │ │ ├── chrono.h │ │ ├── digraph.h │ │ ├── memOptions.h │ │ ├── mode.h │ │ ├── vec.h │ │ └── vec │ │ ├── vec2d_generic.h │ │ ├── vec2d_integer.tdecl.h │ │ ├── vec2d_integer.timp.h │ │ ├── vec2d_real.tdecl.h │ │ ├── vec2d_real.timp.h │ │ ├── vec3d_generic.h │ │ ├── vec3d_integer.tdecl.h │ │ ├── vec3d_integer.timp.h │ │ ├── vec3d_real.tdecl.h │ │ ├── vec3d_real.timp.h │ │ ├── vec4d_generic.h │ │ ├── vec4d_integer.tdecl.h │ │ ├── vec4d_integer.timp.h │ │ ├── vec4d_real.tdecl.h │ │ ├── vec4d_real.timp.h │ │ └── vecAlias.h ├── python │ └── visualize_graph.py ├── src │ └── core │ │ ├── tools │ │ ├── Logger.cpp │ │ ├── Report.cpp │ │ └── Report.cu │ │ └── types │ │ ├── Access.cpp │ │ ├── Allocator.cpp │ │ ├── DataUse.cpp │ │ ├── DataView.cpp │ │ ├── DeviceType.cpp │ │ ├── Exceptions.cpp │ │ ├── Execution.cpp │ │ ├── MemoryLayout.cpp │ │ ├── MemoryOptions.cpp │ │ ├── SetIdx.cpp │ │ └── mode.cpp └── tests │ ├── CMakeLists.txt │ └── unit │ ├── CMakeLists.txt │ ├── coreUt_chrono │ ├── CMakeLists.txt │ └── src │ │ └── testChrono.cpp │ ├── coreUt_cli │ ├── CMakeLists.txt │ └── src │ │ └── coreUt_cli.cpp │ ├── coreUt_digraph │ ├── CMakeLists.txt │ └── src │ │ └── coreUt_digraph.cpp │ ├── coreUt_exceptions │ ├── CMakeLists.txt │ └── src │ │ └── testExceptions.cpp │ ├── coreUt_io │ ├── CMakeLists.txt │ └── src │ │ ├── coreUt.io.vti.cpp │ │ ├── coreUt_io.dense.cpp │ │ └── coreUt_io.main.cpp │ ├── coreUt_logging │ ├── CMakeLists.txt │ └── src │ │ └── testLogging.cpp │ ├── coreUt_tools │ ├── CMakeLists.txt │ └── src │ │ └── testTools.cpp │ └── coreUt_tuple3d │ ├── CMakeLists.txt │ └── src │ └── testPoint3d.cpp ├── libNeonDomain ├── CMakeLists.txt ├── include │ └── Neon │ │ └── domain │ │ ├── Grids.h │ │ ├── StaggeredGrid.h │ │ ├── aGrid.h │ │ ├── bGrid.h │ │ ├── dGrid.h │ │ ├── details │ │ ├── aGrid │ │ │ ├── aField.h │ │ │ ├── aFieldStorage.h │ │ │ ├── aFieldStorage_imp.h │ │ │ ├── aField_imp.h │ │ │ ├── aGrid.h │ │ │ ├── aGrid_imp.h │ │ │ ├── aIndex.h │ │ │ ├── aIndex_imp.h │ │ │ ├── aPartition.h │ │ │ ├── aPartitionIndexSpace.h │ │ │ ├── aPartitionIndexSpace_imp.h │ │ │ └── aPartition_imp.h │ │ ├── bGrid │ │ │ ├── BlockView.h │ │ │ ├── BlockView │ │ │ │ ├── BlockViewGrid.h │ │ │ │ ├── BlockViewPartition.h │ │ │ │ └── BlockViewPartition_imp.h │ │ │ ├── StaticBlock.h │ │ │ ├── bField.h │ │ │ ├── bField_imp.h │ │ │ ├── bGrid.h │ │ │ ├── bGrid_imp.h │ │ │ ├── bIndex.h │ │ │ ├── bIndex_imp.h │ │ │ ├── bPartition.h │ │ │ ├── bPartition_imp.h │ │ │ ├── bSpan.h │ │ │ └── bSpan_imp.h │ │ ├── dGrid │ │ │ ├── dField.h │ │ │ ├── dField_imp.h │ │ │ ├── dGrid.h │ │ │ ├── dGrid_imp.h │ │ │ ├── dIndex.h │ │ │ ├── dIndex_imp.h │ │ │ ├── dPartition.h │ │ │ ├── dSpan.h │ │ │ └── dSpan_imp.h │ │ ├── eGrid │ │ │ ├── eField.h │ │ │ ├── eField_imp.h │ │ │ ├── eGrid.h │ │ │ ├── eGrid_imp.h │ │ │ ├── eIndex.h │ │ │ ├── eIndex_imp.h │ │ │ ├── ePartition.h │ │ │ ├── ePartition_imp.h │ │ │ ├── eSpan.h │ │ │ └── eSpan_imp.h │ │ ├── haloUpdateType.h │ │ ├── mGrid │ │ │ ├── mField.h │ │ │ ├── mField_imp.h │ │ │ ├── mGrid.h │ │ │ ├── mGridDescriptor.h │ │ │ ├── mGrid_imp.h │ │ │ ├── mPartition.h │ │ │ ├── mPartition_imp.h │ │ │ ├── xField.h │ │ │ └── xField_imp.h │ │ ├── sGrid │ │ │ ├── sCell_imp.h │ │ │ ├── sField.h │ │ │ ├── sFieldStorage.h │ │ │ ├── sFieldStorage_imp.h │ │ │ ├── sField_imp.h │ │ │ ├── sGrid.h │ │ │ ├── sGrid_imp.h │ │ │ ├── sIndex.h │ │ │ ├── sPartition.h │ │ │ ├── sPartitionIndexSpace_imp.h │ │ │ ├── sPartition_imp.h │ │ │ └── sSpan.h │ │ └── staggeredGrid │ │ │ ├── StaggeredGrid.h │ │ │ ├── StaggeredGrid_imp.h │ │ │ ├── node │ │ │ ├── NodeField.h │ │ │ ├── NodeField_imp.h │ │ │ ├── NodeGeneric.h │ │ │ ├── NodeGeneric_imp.h │ │ │ ├── NodeGrid.h │ │ │ ├── NodeGrid_imp.h │ │ │ ├── NodePartition.h │ │ │ ├── NodePartitionIndexSpace.h │ │ │ ├── NodePartitionIndexSpace_imp.h │ │ │ ├── NodePartition_imp.h │ │ │ └── NodeToVoxelMask.h │ │ │ └── voxel │ │ │ ├── VoxelField.h │ │ │ ├── VoxelField_imp.h │ │ │ ├── VoxelGeneric.h │ │ │ ├── VoxelGeneric_imp.h │ │ │ ├── VoxelGrid.h │ │ │ ├── VoxelGrid_imp.h │ │ │ ├── VoxelPartition.h │ │ │ ├── VoxelPartitionIndexSpace_imp.h │ │ │ ├── VoxelPartition_imp.h │ │ │ └── VoxelSpan.h │ │ ├── eGrid.h │ │ ├── grid.md │ │ ├── interface │ │ ├── FieldBase.h │ │ ├── FieldBaseTemplate.h │ │ ├── FieldBaseTemplate_imp.h │ │ ├── FieldBase_imp.h │ │ ├── GridBase.h │ │ ├── GridBaseTemplate.h │ │ ├── GridBaseTemplate_imp.h │ │ ├── GridBase_imp.h │ │ ├── GridConcept.h │ │ ├── IndexProperties.h │ │ ├── KernelConfig.h │ │ ├── LaunchConfig.h │ │ ├── NghData.h │ │ ├── Stencil.h │ │ └── common.h │ │ ├── mGrid.h │ │ ├── patterns │ │ ├── PatternScalar.h │ │ ├── PatternScalar_imp.h │ │ └── ReduceKernels.cuh │ │ ├── sGrid.h │ │ └── tools │ │ ├── Geometries.h │ │ ├── GridTransformer.h │ │ ├── HaloUpdateTable1DPartitioning.h │ │ ├── IODomain.h │ │ ├── IOGridVTK.h │ │ ├── IOGridVTK_imp.h │ │ ├── PartitionTable.h │ │ ├── PartitionTable_imp.h │ │ ├── Partitioner1D.h │ │ ├── PointHashTable.h │ │ ├── PointHashTableSet.h │ │ ├── PointHashTableSet_imp.h │ │ ├── PointHashTable_imp.h │ │ ├── SpanTable.h │ │ ├── SpanTable_imp.h │ │ ├── TestData.h │ │ ├── gridTransformer │ │ ├── tField.h │ │ ├── tGrid.h │ │ └── tGrid_ti.h │ │ └── partitioning │ │ ├── Cassifications.h │ │ ├── Connectivity.h │ │ ├── SpanClassifier.h │ │ ├── SpanDecomposition.h │ │ ├── SpanLayout.h │ │ └── SpanSparseTopology.h ├── src │ └── domain │ │ ├── details │ │ ├── aGrid │ │ │ └── aGrid.cpp │ │ ├── bGrid │ │ │ ├── bFieldReduceKernels.cu │ │ │ └── bGrid.cpp │ │ ├── dGrid │ │ │ ├── dFieldReduceKernels.cu │ │ │ └── dGrid.cpp │ │ ├── eGrid │ │ │ └── eGrid.cpp │ │ ├── haloUpdateType.cpp │ │ ├── mGrid │ │ │ └── mGrid.cpp │ │ └── staggeredGrid │ │ │ └── node │ │ │ └── NodeToVoxelMask.cpp │ │ ├── interface │ │ ├── GridBase.cpp │ │ ├── Stencil.cpp │ │ ├── kernelConfig.cpp │ │ └── launchConfig.cpp │ │ ├── patterns │ │ └── PatternScalar.cpp │ │ └── tools │ │ ├── Geometries.cpp │ │ ├── Partitioner1D.cpp │ │ ├── TestData.cpp │ │ └── partitioning │ │ ├── SpanClassifier.cpp │ │ ├── SpanDecomposition.cpp │ │ └── SpanLayout.cpp └── tests │ ├── CMakeLists.txt │ ├── domain-bGrid-tray │ ├── CMakeLists.txt │ └── src │ │ └── gtests.cpp │ ├── domain-globalIdx │ ├── CMakeLists.txt │ └── src │ │ ├── TestInformation.h │ │ ├── globalIdx.cu │ │ ├── globalIdx.h │ │ ├── gtests.cpp │ │ └── runHelper.h │ ├── domain-halos │ ├── CMakeLists.txt │ └── src │ │ ├── TestInformation.h │ │ ├── gtests.cpp │ │ ├── halos.cu │ │ ├── halos.h │ │ └── runHelper.h │ ├── domain-host-containers │ ├── CMakeLists.txt │ └── src │ │ ├── TestInformation.h │ │ ├── gtests.cpp │ │ ├── hostContainer.cpp │ │ ├── hostContainer.h │ │ └── runHelper.h │ ├── domain-map │ ├── CMakeLists.txt │ └── src │ │ ├── TestInformation.h │ │ ├── gtests.cpp │ │ ├── map.cu │ │ ├── map.h │ │ └── runHelper.h │ ├── domain-neighbour-globalIdx │ ├── CMakeLists.txt │ └── src │ │ ├── TestInformation.h │ │ ├── gtests.cpp │ │ ├── runHelper.h │ │ ├── testsAndContainers.cu │ │ └── testsAndContainers.h │ ├── domain-stencil │ ├── CMakeLists.txt │ └── src │ │ ├── TestInformation.h │ │ ├── gtests.cpp │ │ ├── runHelper.h │ │ ├── stencil.cu │ │ └── stencil.h │ ├── domain-unit-test-cast │ ├── CMakeLists.txt │ └── src │ │ ├── TestInformation.h │ │ ├── gtests.cpp │ │ ├── map.cu │ │ ├── map.h │ │ └── runHelper.h │ ├── domain-unit-test-eGrid │ ├── CMakeLists.txt │ └── src │ │ ├── TestInformation.h │ │ ├── eGridTest.cu │ │ ├── eGridTest.h │ │ ├── gtests.cpp │ │ └── runHelper.h │ ├── domain-unit-test-gridInterface │ ├── CMakeLists.txt │ └── src │ │ ├── TestInformation.h │ │ ├── gridInterface.cu │ │ ├── gridInterface.h │ │ ├── gtests.cpp │ │ └── runHelper.h │ ├── domain-unit-test-patterns-containers │ ├── CMakeLists.txt │ └── src │ │ ├── TestInformation.h │ │ ├── containerRun.cpp │ │ ├── containerRun.h │ │ ├── gtests.cpp │ │ └── runHelper.h │ ├── domain-unit-test-staggered-grid │ ├── CMakeLists.txt │ └── src │ │ ├── RunHelper.h │ │ ├── TestInformation.h │ │ ├── containers.cu │ │ ├── containers.h │ │ └── staggeredGrid.cpp │ ├── domainUt_sGrid │ ├── CMakeLists.txt │ └── src │ │ ├── sGrid.cu │ │ └── sGridRunHelper.h │ ├── domainUt_swap │ ├── CMakeLists.txt │ └── src │ │ ├── RunHelper.h │ │ └── Swap.cu │ ├── gUt_dataView_patterns │ ├── CMakeLists.txt │ └── src │ │ ├── gUt_dataView_patterns.cpp │ │ └── gUt_storage.h │ ├── gUt_mGrid │ ├── CMakeLists.txt │ └── src │ │ └── gUt_mGrid.cpp │ ├── gUt_periodic │ ├── _CMakeLists.txt │ └── src │ │ ├── gUt_periodic.cu │ │ └── gUt_storage.h │ ├── gUt_tools │ ├── CMakeLists.txt │ └── src │ │ ├── gUt_IODomain.cpp │ │ ├── gUt_IODomain.main.cpp │ │ └── gUt_TestData.cpp │ └── gUt_vtk │ ├── CMakeLists.txt │ └── src │ ├── gUt_vtk.cpp │ └── gUt_vtk.main.cpp ├── libNeonSet ├── CMakeLists.txt ├── include │ └── Neon │ │ └── set │ │ ├── Backend.h │ │ ├── Backend_imp.h │ │ ├── BlockConfig.h │ │ ├── Containter.h │ │ ├── Containter_imp.h │ │ ├── DataSet.h │ │ ├── DevSet.h │ │ ├── ExecutionThreadSpan.h │ │ ├── GpuEventSet.h │ │ ├── GpuStreamSet.h │ │ ├── HuOptions.h │ │ ├── KernelConfig.h │ │ ├── LambdaExecutor.h │ │ ├── LaunchParameters.h │ │ ├── LaunchParametersTable.h │ │ ├── MemoryOptions.h │ │ ├── MemoryTransfer.h │ │ ├── MultiXpuDataInterface.h │ │ ├── MultiXpuDataUid.h │ │ ├── Replica.h │ │ ├── Replica_imp.h │ │ ├── Runtime.h │ │ ├── StencilSemantic.h │ │ ├── Transfer.h │ │ ├── TransferMode.h │ │ ├── container │ │ ├── AnchorContainer.h │ │ ├── ContainerAPI.h │ │ ├── DataTransferContainer.h │ │ ├── DeviceContainer.h │ │ ├── DeviceManagedContainer.h │ │ ├── DeviceThenHostManagedContainer.h │ │ ├── Graph.h │ │ ├── GraphContainer.h │ │ ├── HaloUpdateContainer.h │ │ ├── HaloUpdateContainer_imp.h │ │ ├── HostContainer.h │ │ ├── HostManagedContainer.h │ │ ├── Loader.h │ │ ├── Loader_imp.h │ │ ├── OldDeviceManagedContainer.h │ │ ├── SynchronizationContainer.h │ │ ├── graph │ │ │ ├── Bfs.h │ │ │ ├── Bfs_imp.h │ │ │ ├── GraphData.h │ │ │ ├── GraphDependency.h │ │ │ ├── GraphDependencyType.h │ │ │ ├── GraphInfo.h │ │ │ ├── GraphNode.h │ │ │ └── GraphNodeScheduling.h │ │ └── types │ │ │ ├── ContainerExecutionType.h │ │ │ ├── ContainerOperationType.h │ │ │ ├── ContainerPatternType.h │ │ │ ├── HostManagedSyncType.h │ │ │ └── SynchronizationContainerType.h │ │ ├── dependency │ │ ├── AccessType.h │ │ ├── DataDependencyType.h │ │ ├── Pattern.h │ │ └── Token.h │ │ ├── memory │ │ ├── memDevSet.h │ │ ├── memDevSet.ti.h │ │ ├── memSet.h │ │ ├── memory.h │ │ └── memory.ti.h │ │ ├── patterns │ │ ├── BlasSet.h │ │ └── BlasSet_imp.h │ │ └── syncrhonizations │ │ └── event_LR_barrier.h ├── src │ └── set │ │ ├── Backend.cpp │ │ ├── BlockConfig.cpp │ │ ├── Containter.cpp │ │ ├── DevSet.cpp │ │ ├── ExecutionThreadSpan.cpp │ │ ├── GpuEventSet.cpp │ │ ├── GpuStream.cpp │ │ ├── HuOptions.cpp │ │ ├── KernelConfig.cpp │ │ ├── LaunchInfoSet.cpp │ │ ├── LaunchParametersTable.cpp │ │ ├── MemoryOptions.cpp │ │ ├── Runtime.cpp │ │ ├── StencilSemantic.cpp │ │ ├── Transfer.cpp │ │ ├── TransferMode.cpp │ │ ├── container │ │ ├── AnchorContainer.cpp │ │ ├── ContainerAPI.cpp │ │ ├── Graph.cpp │ │ ├── GraphContainer.cpp │ │ ├── Loader.cpp │ │ ├── graph │ │ │ ├── Bfs.cpp │ │ │ ├── GraphDependency.cpp │ │ │ ├── GraphDependencyType.cpp │ │ │ ├── GraphNode.cpp │ │ │ ├── GraphNodeOrganization.cpp │ │ │ └── GraphNodeScheduling.cpp │ │ └── types │ │ │ ├── ContainerExecutionType.cpp │ │ │ ├── ContainerOperationType.cpp │ │ │ ├── ContainerPatternType.cpp │ │ │ └── SynchronizationContainerType.cpp │ │ ├── depencencyTools │ │ ├── AccessType.cpp │ │ ├── ComputeType.cpp │ │ ├── DataDependencyType.cpp │ │ └── Token.cpp │ │ ├── patterns │ │ └── BlasSet.cpp │ │ └── syncrhonizations │ │ └── Event_LR_barrier.cpp └── tests │ ├── CMakeLists.txt │ └── unit │ ├── CMakeLists.txt │ ├── setUt_Replica │ ├── CMakeLists.txt │ └── src │ │ └── Replica.cu │ ├── setUt_containerGraph │ ├── CMakeLists.txt │ └── src │ │ ├── setUt_containerGraph_NestedGraphs.cpp │ │ ├── setUt_containerGraph_ThreeIndependentMaps.cpp │ │ ├── setUt_containerGraph_ThreePipedMaps.cpp │ │ ├── setUt_containerGraph_kernels.cu │ │ ├── setUt_containerGraph_kernels.h │ │ ├── setUt_containerGraph_main.cpp │ │ └── setUt_containerGraph_runHelper.h │ ├── setUt_gpuSet │ ├── CMakeLists.txt │ └── src │ │ └── testGpuSet.cpp │ ├── setUt_gpuSetNvcc │ ├── CMakeLists.txt │ └── src │ │ └── setUt_gpuSetNvcc.cu │ ├── setUt_memMirrorSet │ ├── CMakeLists.txt │ └── src │ │ └── setUt_mirror.cpp │ └── setUt_patterns │ ├── CMakeLists.txt │ └── src │ └── testPatterns.cpp ├── libNeonSkeleton ├── CMakeLists.txt ├── include │ └── Neon │ │ └── skeleton │ │ ├── Executor.h │ │ ├── Occ.h │ │ ├── Options.h │ │ ├── Skeleton.h │ │ └── internal │ │ ├── MultiXpuGraph.h │ │ └── dependencyTools │ │ ├── DataDependency.h │ │ ├── DependencyAnalyser.h │ │ └── UserDataManager.h ├── src │ └── skeleton │ │ ├── Executor.cpp │ │ ├── Occ.cpp │ │ ├── Options.cpp │ │ ├── Skeleton.cpp │ │ ├── depencencyTools │ │ ├── Dependency.cpp │ │ ├── DependencyAnalyser.cpp │ │ └── UserDataManager.cpp │ │ └── internal │ │ └── multiGpuGraph.cpp └── tests │ ├── CMakeLists.txt │ ├── perf │ ├── CMakeLists.txt │ ├── SkeletonSyntheticBenchmarks │ │ ├── CMakeLists.txt │ │ └── src │ │ │ ├── CLiApps.h │ │ │ ├── CLiCardinality.h │ │ │ ├── CLiCorrectness.h │ │ │ ├── CLiType.h │ │ │ ├── CliApps.cpp │ │ │ ├── CliCardinality.cpp │ │ │ ├── CliCorrectness.cpp │ │ │ ├── CliType.cpp │ │ │ ├── GridType.cpp │ │ │ ├── GridType.h │ │ │ ├── MapSequence.h │ │ │ ├── RunTest.cu │ │ │ ├── RunTest.h │ │ │ ├── UserData.h │ │ │ ├── containers │ │ │ ├── Axpy.h │ │ │ └── Sum.h │ │ │ └── main.cpp │ └── sPt_AXPY_Laplacian │ │ ├── CMakeLists.txt │ │ └── src │ │ ├── sPt_common.h │ │ ├── sPt_geometry.cpp │ │ ├── sPt_geometry.h │ │ ├── sPt_laplacian.cu │ │ ├── sPt_laplacian.h │ │ ├── sPt_stencil.h │ │ └── sPt_stencil.main.cpp │ └── unit │ ├── CMakeLists.txt │ ├── sUt_multiRes │ ├── CMakeLists.txt │ └── src │ │ ├── MultiResChild.h │ │ ├── MultiResDemo.h │ │ ├── MultiResMap.h │ │ ├── MultiResParent.h │ │ ├── MultiResSkeleton.h │ │ ├── MultiResStencil.h │ │ └── sUt_multiRes.cu │ ├── sUt_skeletonOnStreams │ ├── CMakeLists.txt │ └── src │ │ ├── sUt.runHelper.h │ │ ├── sUt_skeleton.Stencil.cu │ │ ├── sUt_skeleton.main.cpp │ │ ├── sUt_skeleton.mapStencilDot.cu │ │ ├── sUt_skeleton.mapStencilMap.cu │ │ ├── sUt_skeleton.onStream.kernels.h │ │ └── sUt_skeleton.singleDot.cu │ ├── sUt_userInterface │ ├── CMakeLists.txt │ └── src │ │ ├── sUt.runHelper.h │ │ ├── sUt_add.h │ │ ├── sUt_common.h │ │ ├── sUt_main.cpp │ │ └── sUt_tests.cu │ ├── skeleton-maps │ ├── CMakeLists.txt │ └── src │ │ ├── containers.h │ │ ├── main.cpp │ │ ├── map.cu │ │ └── runHelper.h │ └── skeleton-stencil │ ├── CMakeLists.txt │ └── src │ ├── main.cpp │ ├── runHelper.h │ └── stencil.cu ├── libNeonSolver ├── CMakeLists.txt ├── include │ └── Neon │ │ └── solver │ │ └── linear │ │ ├── IterativeLinearSolver.h │ │ ├── MatVec.h │ │ ├── krylov │ │ ├── CG.h │ │ └── CGContainers.h │ │ └── matvecs │ │ └── LaplacianMatVec.h ├── src │ └── linear │ │ ├── krylov │ │ ├── CG.cpp │ │ └── CGContainers.cu │ │ └── matvecs │ │ └── LaplacianMatVec.cu └── tests │ ├── CMakeLists.txt │ ├── perf │ ├── CMakeLists.txt │ └── solverPt_Poisson │ │ ├── CMakeLists.txt │ │ └── src │ │ └── solverPt_Poisson.cpp │ ├── poisson │ ├── CMakeLists.txt │ ├── include │ │ └── Poisson.h │ └── src │ │ └── poisson.cpp │ └── unit │ ├── CMakeLists.txt │ └── solverUt_Poisson │ ├── CMakeLists.txt │ └── src │ └── solverUt_Poisson.cpp ├── libNeonSys ├── CMakeLists.txt ├── include │ └── Neon │ │ ├── Neon.h │ │ ├── Report.h │ │ └── sys │ │ ├── devices │ │ ├── DevInterface.h │ │ ├── cpu │ │ │ ├── CpuDevice.h │ │ │ └── CpuSys.h │ │ ├── gpu │ │ │ ├── ComputeID.h │ │ │ ├── GpuDevice.h │ │ │ ├── GpuEvent.h │ │ │ ├── GpuKernelInfo.h │ │ │ ├── GpuStream.h │ │ │ ├── GpuSys.h │ │ │ ├── GpuTools.h │ │ │ └── gpuDevice │ │ │ │ └── gpuDeviceMemory.h │ │ └── memType.h │ │ ├── global │ │ ├── CpuSysGlobal.h │ │ └── GpuSysGlobal.h │ │ ├── memory │ │ ├── CUDASharedMemoryUtil.h │ │ ├── CpuMem.h │ │ ├── CudaIntrinsics.h │ │ ├── GpuMem.h │ │ ├── MemDevice.h │ │ ├── MemMirror.h │ │ ├── memConf.h │ │ └── memDevice_imp.h │ │ └── patterns │ │ ├── Blas.h │ │ └── Blas_imp.h ├── src │ └── sys │ │ ├── Neon.cpp │ │ ├── Report.cpp │ │ ├── devices │ │ ├── cpu │ │ │ ├── cpuDevice.cpp │ │ │ ├── cpuDeviceMemory.cpp │ │ │ └── cpuSys.cpp │ │ ├── deviceInterface.cpp │ │ ├── gpu │ │ │ ├── gpuDevice.cpp │ │ │ ├── gpuDeviceMemory.cpp │ │ │ ├── gpuDeviceTools.cpp │ │ │ ├── gpuEvent.cpp │ │ │ ├── gpuKernelInfo.cpp │ │ │ ├── gpuStream.cpp │ │ │ ├── gpuSys.cpp │ │ │ └── gpuTools.cpp │ │ └── memType.cpp │ │ ├── global │ │ ├── cpuSysGlobal.cpp │ │ └── gpuSysGlobal.cpp │ │ ├── memory │ │ ├── CpuMem.cpp │ │ └── GpuMem.cpp │ │ └── patterns │ │ └── Blas.cu └── tests │ ├── CMakeLists.txt │ └── unit │ ├── CMakeLists.txt │ ├── sysUt_devCpu │ ├── CMakeLists.txt │ └── src │ │ └── testCount.cpp │ ├── sysUt_devGpu │ ├── CMakeLists.txt │ └── src │ │ └── testCount.cpp │ ├── sysUt_devGpuNvcc │ ├── CMakeLists.txt │ └── src │ │ └── sysUt_devGpuNvcc.cu │ ├── sysUt_mem │ ├── CMakeLists.txt │ └── src │ │ └── sysUt_mem.cpp │ ├── sysUt_patterns │ ├── CMakeLists.txt │ └── src │ │ └── testPatterns.cpp │ └── sysUt_report │ ├── CMakeLists.txt │ └── src │ └── testReport.cpp ├── mkdocs.yml ├── tutorials ├── CMakeLists.txt ├── introduction │ ├── CMakeLists.txt │ └── domainLevel │ │ ├── CMakeLists.txt │ │ ├── domainLevel.cpp │ │ ├── expandLevelSet.cu │ │ ├── expandLevelSet.h │ │ ├── grad.cu │ │ └── grad.h ├── staggered-grids │ ├── CMakeLists.txt │ └── src │ │ ├── containers.cu │ │ ├── containers.h │ │ └── staggeredGrid.cpp └── the-bases │ ├── CMakeLists.txt │ └── domainLevel │ ├── CMakeLists.txt │ ├── domainLevel.cpp │ ├── expandSphere.cu │ ├── expandSphere.h │ ├── grad.cu │ └── grad.h └── webDocumentation.sh /.clang-format: -------------------------------------------------------------------------------- 1 | --- 2 | Language: Cpp 3 | BasedOnStyle: Chromium 4 | TabWidth: 4 5 | UseTab: Never 6 | 7 | IndentCaseLabels: true 8 | IndentWidth: 4 9 | IndentWrappedFunctionNames: false 10 | JavaScriptQuotes: Leave 11 | JavaScriptWrapImports: true 12 | KeepEmptyLinesAtTheStartOfBlocks: true 13 | MacroBlockBegin: '' 14 | MacroBlockEnd: '' 15 | MaxEmptyLinesToKeep: 2 16 | NamespaceIndentation: None 17 | ObjCBlockIndentWidth: 2 18 | ColumnLimit: 0 19 | AlignConsecutiveDeclarations: true 20 | 21 | 22 | BreakBeforeBraces: Custom 23 | BraceWrapping: 24 | AfterClass: true 25 | AfterControlStatement: false 26 | AfterEnum: true 27 | AfterFunction: true 28 | AfterNamespace: false 29 | AfterStruct: true 30 | AfterUnion: true 31 | AfterExternBlock: true 32 | BeforeCatch: false 33 | BeforeElse: false 34 | ... 35 | -------------------------------------------------------------------------------- /.github/workflows/Ubuntu.yml: -------------------------------------------------------------------------------- 1 | name: Ubuntu 2 | on: 3 | push: 4 | branches: [main, develop] 5 | pull_request: 6 | branches: [main, develop] 7 | workflow_dispatch: 8 | jobs: 9 | UbuntuRun: 10 | runs-on: ubuntu-22.04 11 | steps: 12 | - uses: Jimver/cuda-toolkit@v0.2.7 13 | id: cuda-toolkit 14 | with: 15 | cuda: '11.7.0' 16 | linux-local-args: '["--toolkit"]' 17 | - run: sudo apt-get update 18 | - run: sudo apt-get install -y xorg-dev libglu1-mesa-dev freeglut3-dev mesa-common-dev 19 | - run: nvcc -V 20 | - name: Checkout 21 | uses: actions/checkout@v2 22 | - name: Create build directory 23 | run: mkdir ${{github.workspace}}/build 24 | - name: Configure CMake 25 | working-directory: ${{github.workspace}}/build 26 | run: cmake ../ 27 | - name: Run make 28 | working-directory: ${{github.workspace}}/build 29 | run: make -j 4 30 | - name: Run Test 31 | working-directory: ${{github.workspace}}/build 32 | run: ctest --no-compress-output --output-on-failure -T Test --build-config Release -------------------------------------------------------------------------------- /.github/workflows/Windows.yml: -------------------------------------------------------------------------------- 1 | name: Windows 2 | on: 3 | push: 4 | branches: [main, develop] 5 | pull_request: 6 | branches: [main, develop] 7 | workflow_dispatch: 8 | jobs: 9 | WindowsRun: 10 | runs-on: windows-2019 11 | steps: 12 | - uses: Jimver/cuda-toolkit@v0.2.7 13 | id: cuda-toolkit 14 | with: 15 | cuda: '11.7.0' 16 | linux-local-args: '["--toolkit"]' 17 | - run: nvcc -V 18 | - name: Checkout 19 | uses: actions/checkout@v2 20 | - name: Create build directory 21 | run: mkdir ${{github.workspace}}/build 22 | - name: Configure CMake 23 | working-directory: ${{github.workspace}}/build 24 | run: cmake ../ 25 | - name: Run VS 26 | run: cmake --build ${{github.workspace}}/build --clean-first --config Release -j 4 27 | - name: Run Test 28 | working-directory: ${{github.workspace}}/build 29 | run: ctest --no-compress-output --output-on-failure -T Test --build-config Release -------------------------------------------------------------------------------- /.github/workflows/mkdocs.yml: -------------------------------------------------------------------------------- 1 | name: mkdocs 2 | on: 3 | push: 4 | branches: 5 | - develop 6 | workflow_dispatch: 7 | jobs: 8 | deploy: 9 | runs-on: ubuntu-latest 10 | steps: 11 | - uses: actions/checkout@v2 12 | - uses: actions/setup-python@v2 13 | with: 14 | python-version: 3.x 15 | - run: pip install mkdocs 16 | - run: pip install mkdocs-material 17 | - run: pip install mkdocs-material-extensions 18 | - run: pip install mkdocs-autolinks-plugin 19 | - run: mkdocs gh-deploy --force 20 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Compiled Object files 2 | *.slo 3 | *.lo 4 | *.o 5 | *.obj 6 | 7 | # Precompiled Headers 8 | *.gch 9 | *.pch 10 | 11 | # Compiled Dynamic libraries 12 | *.so 13 | *.dylib 14 | *.dll 15 | 16 | # Fortran module files 17 | *.mod 18 | *.smod 19 | 20 | # Compiled Static libraries 21 | *.lai 22 | *.la 23 | *.a 24 | *.lib 25 | 26 | # Executables 27 | *.exe 28 | *.out 29 | *.app 30 | 31 | # Clion default build directory 32 | cmake-build-* 33 | 34 | # Cmake default build directory 35 | build/ 36 | 37 | # Clion config files 38 | .idea/* 39 | 40 | libNeonCore/libNeonCorePy/\.idea/ 41 | 42 | *.pyc 43 | 44 | script/* 45 | !script/run_test.cmd 46 | 47 | .vscode 48 | 49 | libNeonCore/src/core/git_sha1.cpp 50 | 51 | temp 52 | 53 | docs/doxygen/html/ 54 | 55 | docs/doxygen/latex/ 56 | 57 | !apps/lbmMultiRes/practice_v28.obj 58 | !apps/lbmMultiRes/sphere3.obj 59 | -------------------------------------------------------------------------------- /LICENSE.txt: -------------------------------------------------------------------------------- 1 | 2 | Copyright 2022 Autodesk, Inc. 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | 16 | 17 | 18 | 19 | ## Third Party Licenses ## 20 | 21 | ### RapidJSON 22 | https://github.com/Tencent/rapidjson 23 | https://github.com/Tencent/rapidjson/blob/master/license.txt 24 | 25 | ### SPLOG 26 | https://github.com/gabime/spdlog.git 27 | https://raw.githubusercontent.com/gabime/spdlog/v1.x/LICENSE 28 | 29 | ### Google Test 30 | https://github.com/google/googletest 31 | https://raw.githubusercontent.com/google/googletest/main/LICENSE 32 | 33 | ### clipp 34 | https://github.com/muellan/clipp 35 | https://raw.githubusercontent.com/muellan/clipp/master/LICENSE 36 | 37 | 38 | -------------------------------------------------------------------------------- /VerifyNeonPRUnix.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | #VerifyNeonPRUnix.sh ID 2>&1 | tee NeonUnix.log 3 | if [ "$#" -ne 1 ]; then 4 | echo "******************************" 5 | echo "Pull Request ID is missing. Usage: " 6 | echo ">> VerifyNeonPRUnix.sh ID" 7 | echo "******************************" 8 | exit 9 | fi 10 | starting_dir="$(cd "$(dirname "$0")" && pwd)" 11 | mkdir temp 12 | cd temp 13 | PR=$1 14 | git clone https://github.com/Autodesk/Neon.git 15 | cd Neon 16 | git fetch origin refs/pull/$PR/head:pull_$PR 17 | git checkout pull_$PR 18 | mkdir build 19 | cd build 20 | cmake .. 21 | cmake --build . --config Release -j 10 22 | ctest_filename=CTestNeonUnixReport.log 23 | ctest --no-compress-output --output-on-failure -T Test --build-config Release --output-log $ctest_filename 24 | echo "******************************" 25 | echo "Test final report location: $starting_dir/temp/Neon/build/$ctest_filename" 26 | echo "******************************" 27 | cd $starting_dir -------------------------------------------------------------------------------- /VerifyNeonPRWindows.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | IF %1.==. GOTO Usage 3 | 4 | set starting_dir=%CD% 5 | mkdir temp 6 | cd temp 7 | set PR=%1 8 | git clone https://github.com/Autodesk/Neon.git 9 | cd Neon 10 | git fetch origin refs/pull/%PR%/head:pull_%PR% 11 | git checkout pull_%PR% 12 | mkdir build 13 | cd build 14 | cmake -G "Visual Studio 16 2019" .. 15 | cmake --build . --config Release -j 10 16 | set ctest_filename=CTestNeonWindowsReport.log 17 | ctest --no-compress-output --output-on-failure -T Test --build-config Release --output-log %ctest_filename% 18 | echo "******************************" 19 | echo "Test final report location: %starting_dir%\temp\Neon\build\%ctest_filename%" 20 | echo "******************************" 21 | cd %starting_dir% 22 | GOTO end 23 | 24 | :Usage 25 | echo "******************************" 26 | echo "Pull Request ID is missing. Usage: " 27 | echo ">> VerifyNeonPRWindows.bat ID" 28 | echo "******************************" 29 | :end -------------------------------------------------------------------------------- /apps/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.19 FATAL_ERROR) 2 | 3 | #add_subdirectory("fractal") 4 | #add_subdirectory("lbm") 5 | #add_subdirectory("gameOfLife") 6 | #add_subdirectory("poisson") 7 | add_subdirectory("lbmMultiRes") 8 | -------------------------------------------------------------------------------- /apps/fractal/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.19 FATAL_ERROR) 2 | 3 | set (APP_NAME app-fractal) 4 | file(GLOB_RECURSE SrcFiles fractal.cu) 5 | 6 | add_executable(${APP_NAME} ${SrcFiles}) 7 | 8 | target_link_libraries(${APP_NAME} 9 | PUBLIC libNeonSkeleton) 10 | 11 | set_target_properties(${APP_NAME} PROPERTIES 12 | CUDA_SEPARABLE_COMPILATION ON 13 | CUDA_RESOLVE_DEVICE_SYMBOLS ON) 14 | set_target_properties(${APP_NAME} PROPERTIES FOLDER "apps") 15 | source_group(TREE ${CMAKE_CURRENT_LIST_DIR} PREFIX "${APP_NAME}" FILES ${SrcFiles}) 16 | 17 | add_test(NAME ${APP_NAME} COMMAND ${APP_NAME}) -------------------------------------------------------------------------------- /apps/fractal/fractals.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Autodesk/Neon/bf725483bd8b69b3c1c2a627547e8f3f382cd249/apps/fractal/fractals.gif -------------------------------------------------------------------------------- /apps/gameOfLife/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.19 FATAL_ERROR) 2 | 3 | set (APP_NAME app-gameOfLife) 4 | file(GLOB_RECURSE SrcFiles gameOfLife.cu) 5 | 6 | add_executable(${APP_NAME} ${SrcFiles}) 7 | 8 | target_link_libraries(${APP_NAME} 9 | PUBLIC libNeonSkeleton) 10 | 11 | set_target_properties(${APP_NAME} PROPERTIES 12 | CUDA_SEPARABLE_COMPILATION ON 13 | CUDA_RESOLVE_DEVICE_SYMBOLS ON) 14 | set_target_properties(${APP_NAME} PROPERTIES FOLDER "apps") 15 | source_group(TREE ${CMAKE_CURRENT_LIST_DIR} PREFIX "${APP_NAME}" FILES ${SrcFiles}) 16 | 17 | add_test(NAME ${APP_NAME} COMMAND ${APP_NAME}) -------------------------------------------------------------------------------- /apps/gameOfLife/conways.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Autodesk/Neon/bf725483bd8b69b3c1c2a627547e8f3f382cd249/apps/gameOfLife/conways.gif -------------------------------------------------------------------------------- /apps/lbm/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.19 FATAL_ERROR) 2 | 3 | set (APP_NAME app-lbm) 4 | file(GLOB_RECURSE SrcFiles lbm.cu) 5 | 6 | add_executable(${APP_NAME} ${SrcFiles}) 7 | 8 | target_link_libraries(${APP_NAME} 9 | PUBLIC libNeonSkeleton) 10 | 11 | set_target_properties(${APP_NAME} PROPERTIES 12 | CUDA_SEPARABLE_COMPILATION ON 13 | CUDA_RESOLVE_DEVICE_SYMBOLS ON) 14 | set_target_properties(${APP_NAME} PROPERTIES FOLDER "apps") 15 | source_group(TREE ${CMAKE_CURRENT_LIST_DIR} PREFIX "${APP_NAME}" FILES ${SrcFiles}) 16 | 17 | add_test(NAME ${APP_NAME} COMMAND ${APP_NAME}) -------------------------------------------------------------------------------- /apps/lbm/lbm2d-vel-mag.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Autodesk/Neon/bf725483bd8b69b3c1c2a627547e8f3f382cd249/apps/lbm/lbm2d-vel-mag.gif -------------------------------------------------------------------------------- /apps/lbm/lbm2d-vel-vor.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Autodesk/Neon/bf725483bd8b69b3c1c2a627547e8f3f382cd249/apps/lbm/lbm2d-vel-vor.gif -------------------------------------------------------------------------------- /apps/lbm/lbm3d-vel-mag.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Autodesk/Neon/bf725483bd8b69b3c1c2a627547e8f3f382cd249/apps/lbm/lbm3d-vel-mag.gif -------------------------------------------------------------------------------- /apps/lbmMultiRes/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.19 FATAL_ERROR) 2 | 3 | set (APP_NAME app-lbmMultiRes) 4 | file(GLOB_RECURSE SrcFiles lbmMultiRes.cu lbmMultiRes.h lattice.h init.h postProcess.h util.h coalescence.h collide.h explosion.h stream.h store.h verify.h flowOverShape.h lidDrivenCavity.h fusedFinest.h) 5 | 6 | add_executable(${APP_NAME} ${SrcFiles}) 7 | 8 | target_link_libraries(${APP_NAME} 9 | PUBLIC libNeonSkeleton glm::glm igl::core) 10 | 11 | if(${NEON_USE_POLYSCOPE}) 12 | target_link_libraries(${APP_NAME} 13 | PUBLIC libNeonSkeleton polyscope) 14 | endif() 15 | 16 | set_target_properties(${APP_NAME} PROPERTIES 17 | CUDA_SEPARABLE_COMPILATION ON 18 | CUDA_RESOLVE_DEVICE_SYMBOLS ON) 19 | set_target_properties(${APP_NAME} PROPERTIES FOLDER "apps") 20 | source_group(TREE ${CMAKE_CURRENT_LIST_DIR} PREFIX "${APP_NAME}" FILES ${SrcFiles}) 21 | 22 | #add_test(NAME ${APP_NAME} COMMAND ${APP_NAME}) -------------------------------------------------------------------------------- /apps/lbmMultiRes/lid/run.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | exe="../../../build/bin/app-lbmMultiRes" 3 | numIter=50 4 | deviceId=7 5 | 6 | for scale in 1 2 3 4 5 6 7 8 9; do 7 | for dataType in "float" "double"; do 8 | for collideOption in "--storeCoarse" "--storeFine" "--collisionFusedStore" "--fusedFinest --collisionFusedStore"; do 9 | for streamOption in " " "--streamFusedExpl" "--streamFusedCoal" "--streamFuseAll"; do 10 | echo ${exe} --numIter $numIter --deviceType gpu --deviceId $deviceId --problemType lid --benchmark --dataType $dataType --re 100 --scale $scale $collideOption $streamOption 11 | ${exe} --numIter $numIter --deviceType gpu --deviceId $deviceId --problemType lid --benchmark --dataType $dataType --re 100 --scale $scale $collideOption $streamOption 12 | done 13 | done 14 | done 15 | done -------------------------------------------------------------------------------- /apps/lbmMultiRes/run.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | exe="../../build/bin/app-lbmMultiRes" 3 | numIter=50 4 | deviceId=7 5 | 6 | for scale in 1 2 3 4 5 6 7 8 9; do 7 | for dataType in "float" "double"; do 8 | for collideOption in "--storeCoarse" "--storeFine" "--collisionFusedStore" "--fusedFinest --collisionFusedStore"; do 9 | for streamOption in " " "--streamFusedExpl" "--streamFusedCoal" "--streamFuseAll"; do 10 | echo ${exe} --numIter $numIter --deviceType gpu --deviceId $deviceId --problemType lid $problemId --benchmark --dataType $dataType --re 100 --scale $scale $collideOption $streamOption 11 | ${exe} --numIter $numIter --deviceType gpu --deviceId $deviceId --problemType lid $problemId --benchmark --dataType $dataType --re 100 --scale $scale $collideOption $streamOption 12 | done 13 | done 14 | done 15 | done -------------------------------------------------------------------------------- /apps/lbmMultiRes/scripts/MultiResNeon_vs_ghia1982.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Autodesk/Neon/bf725483bd8b69b3c1c2a627547e8f3f382cd249/apps/lbmMultiRes/scripts/MultiResNeon_vs_ghia1982.png -------------------------------------------------------------------------------- /apps/lbmMultiRes/scripts/UniformNeon_vs_ghia1982.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Autodesk/Neon/bf725483bd8b69b3c1c2a627547e8f3f382cd249/apps/lbmMultiRes/scripts/UniformNeon_vs_ghia1982.png -------------------------------------------------------------------------------- /apps/lbmMultiRes/sphere/run.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | exe="../../../build/bin/app-lbmMultiRes" 3 | numIter=50 4 | deviceId=7 5 | 6 | for scale in 2 4 6 8 10; do 7 | for dataType in "float" "double"; do 8 | for collideOption in "--storeCoarse" "--storeFine" "--collisionFusedStore" "--fusedFinest --collisionFusedStore"; do 9 | for streamOption in " " "--streamFusedExpl" "--streamFusedCoal" "--streamFuseAll"; do 10 | echo ${exe} --numIter $numIter --deviceType gpu --deviceId $deviceId --problemType sphere --benchmark --dataType $dataType --re 100 --scale $scale $collideOption $streamOption 11 | ${exe} --numIter $numIter --deviceType gpu --deviceId $deviceId --problemType sphere --benchmark --dataType $dataType --re 100 --scale $scale $collideOption $streamOption 12 | done 13 | done 14 | done 15 | done -------------------------------------------------------------------------------- /apps/poisson/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.19 FATAL_ERROR) 2 | 3 | set (APP_NAME app-poisson) 4 | file(GLOB_RECURSE SrcFiles poisson.cu) 5 | 6 | add_executable(${APP_NAME} ${SrcFiles}) 7 | 8 | target_link_libraries(${APP_NAME} 9 | PUBLIC libNeonSkeleton 10 | PUBLIC libNeonSolver) 11 | 12 | set_target_properties(${APP_NAME} PROPERTIES 13 | CUDA_SEPARABLE_COMPILATION ON 14 | CUDA_RESOLVE_DEVICE_SYMBOLS ON) 15 | set_target_properties(${APP_NAME} PROPERTIES FOLDER "apps") 16 | source_group(TREE ${CMAKE_CURRENT_LIST_DIR} PREFIX "${APP_NAME}" FILES ${SrcFiles}) 17 | 18 | add_test(NAME ${APP_NAME} COMMAND ${APP_NAME}) -------------------------------------------------------------------------------- /apps/poisson/possion.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Autodesk/Neon/bf725483bd8b69b3c1c2a627547e8f3f382cd249/apps/poisson/possion.png -------------------------------------------------------------------------------- /benchmarks/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.19 FATAL_ERROR) 2 | 3 | add_subdirectory("lbm-lid-driven-cavity-flow") 4 | # add_subdirectory("lbm-flow-over-sphere") 5 | -------------------------------------------------------------------------------- /benchmarks/lbm-flow-over-sphere/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.19 FATAL_ERROR) 2 | 3 | SET(APP "lbm-flow-over-sphere") 4 | 5 | file(GLOB_RECURSE SrcFiles src/*.*) 6 | 7 | add_executable(${APP} ${SrcFiles}) 8 | 9 | target_link_libraries(${APP} 10 | PUBLIC libNeonDomain 11 | PUBLIC libNeonSkeleton) 12 | 13 | set_target_properties(${APP} PROPERTIES 14 | CUDA_SEPARABLE_COMPILATION ON 15 | CUDA_RESOLVE_DEVICE_SYMBOLS ON) 16 | 17 | target_compile_options(${APP} INTERFACE 18 | $<$:${NeonCXXFlags}> 19 | $<$:${NeonCUDAFlags}> 20 | ) 21 | -------------------------------------------------------------------------------- /benchmarks/lbm-flow-over-sphere/run.sh: -------------------------------------------------------------------------------- 1 | set -x 2 | 3 | DOMAIN_SIZE_LIST="128 192 256 320 384 448 512" 4 | GRID="dGrid" 5 | STORAGE_FP_LIST="double float" 6 | COMPUTE_FP_LIST="double float" 7 | OCC="nOCC" 8 | 9 | for DOMAIN_SIZE in ${DOMAIN_SIZE_LIST}; do 10 | for STORAGE_FP in ${STORAGE_FP_LIST}; do 11 | for COMPUTE_FP in ${COMPUTE_FP_LIST}; do 12 | 13 | if [ "${STORAGE_FP}_${COMPUTE_FP}" = "double_float" ]; then 14 | continue 15 | fi 16 | 17 | echo ./lbm-flow-over-cylinder \ 18 | --deviceType gpu --deviceIds 0 \ 19 | --grid "${GRID}" \ 20 | --domain-size "${DOMAIN_SIZE}" \ 21 | --warmup-iter 10 --max-iter 100 --repetitions 5 \ 22 | --report-filename "lbm-flow-over-cylinder_${DOMAIN_SIZE}_${GRID}_STORAGE_${STORAGE_FP}_COMPUTE_${COMPUTE_FP}" \ 23 | --computeFP "${COMPUTE_FP}" \ 24 | --storageFP "${STORAGE_FP}" \ 25 | --${OCC} --benchmark 26 | done 27 | done 28 | done 29 | -------------------------------------------------------------------------------- /benchmarks/lbm-flow-over-sphere/src/Report.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | #include "Config.h" 6 | 7 | struct Report 8 | { 9 | Neon::Report mReport; 10 | std::string mFname; 11 | 12 | std::vector mMLUPS; 13 | std::vector mLoopTime; 14 | std::vector mNeonGridInitTime; 15 | std::vector mProblemSetupTime; 16 | 17 | std::string mtimeUnit = ""; 18 | 19 | explicit Report(const Config& c); 20 | 21 | auto recordMLUPS(double mlups) 22 | -> void; 23 | 24 | auto recordLoopTime(double time, 25 | const std::string& unit) 26 | -> void; 27 | 28 | auto recordNeonGridInitTime(double time, 29 | const std::string& unit) 30 | -> void; 31 | 32 | auto recordProblemSetupTime(double time, 33 | const std::string& unit) 34 | -> void; 35 | 36 | auto save() 37 | -> void; 38 | void recordBk(Neon::Backend& backend); 39 | }; 40 | -------------------------------------------------------------------------------- /benchmarks/lbm-flow-over-sphere/src/RunTwoPop.h: -------------------------------------------------------------------------------- 1 | #include "Config.h" 2 | #include "D3Q19.h" 3 | #include "Neon/domain/dGrid.h" 4 | 5 | #include "Metrics.h" 6 | #include "Repoert.h" 7 | 8 | namespace CavityTwoPop { 9 | 10 | auto runTwoPop(Config& config, 11 | Report& report) -> void; 12 | } // namespace CavityTwoPop -------------------------------------------------------------------------------- /benchmarks/lbm-lid-driven-cavity-flow/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.19 FATAL_ERROR) 2 | 3 | SET(APP "lbm-lid-driven-cavity-flow") 4 | 5 | file(GLOB_RECURSE SrcFiles src/*.*) 6 | 7 | add_executable(${APP} ${SrcFiles}) 8 | 9 | target_link_libraries(${APP} 10 | PUBLIC libNeonDomain 11 | PUBLIC libNeonSkeleton) 12 | 13 | set_target_properties(${APP} PROPERTIES 14 | CUDA_SEPARABLE_COMPILATION ON 15 | CUDA_RESOLVE_DEVICE_SYMBOLS ON) 16 | 17 | target_compile_options(${APP} INTERFACE 18 | $<$:${NeonCXXFlags}> 19 | $<$:${NeonCUDAFlags}> 20 | ) 21 | 22 | add_custom_command( 23 | TARGET ${APP} POST_BUILD 24 | COMMAND ${CMAKE_COMMAND} -E copy 25 | ${CMAKE_CURRENT_SOURCE_DIR}/${APP}.sh 26 | ${CMAKE_BINARY_DIR}/bin/${APP}.sh) 27 | 28 | add_custom_command( 29 | TARGET ${APP} POST_BUILD 30 | COMMAND ${CMAKE_COMMAND} -E copy 31 | ${CMAKE_CURRENT_SOURCE_DIR}/${APP}.py 32 | ${CMAKE_BINARY_DIR}/bin/${APP}.py 33 | ) -------------------------------------------------------------------------------- /benchmarks/lbm-lid-driven-cavity-flow/lbm-lid-driven-cavity-flow.sh: -------------------------------------------------------------------------------- 1 | set -x 2 | 3 | DOMAIN_SIZE_LIST="64 128 192 256 320 384 448 512" 4 | GRID_LIST="dGrid bGrid eGrid" 5 | STORAGE_FP_LIST="double float" 6 | COMPUTE_FP_LIST="double float" 7 | OCC="nOCC" 8 | 9 | for DOMAIN_SIZE in ${DOMAIN_SIZE_LIST}; do 10 | for STORAGE_FP in ${STORAGE_FP_LIST}; do 11 | for COMPUTE_FP in ${COMPUTE_FP_LIST}; do 12 | for GRID in ${GRID_LIST}; do 13 | 14 | if [ "${STORAGE_FP}_${COMPUTE_FP}" = "double_float" ]; then 15 | continue 16 | fi 17 | 18 | echo ./lbm-lid-driven-cavity-flow \ 19 | --deviceType gpu --deviceIds 0 \ 20 | --grid "${GRID}" \ 21 | --domain-size "${DOMAIN_SIZE}" \ 22 | --warmup-iter 10 --max-iter 100 --repetitions 5 \ 23 | --report-filename "lbm-lid-driven-cavity-flow_${DOMAIN_SIZE}_${GRID}_STORAGE_${STORAGE_FP}_COMPUTE_${COMPUTE_FP}" \ 24 | --computeFP "${COMPUTE_FP}" \ 25 | --storageFP "${STORAGE_FP}" \ 26 | --${OCC} --benchmark 27 | done 28 | done 29 | done 30 | done 31 | -------------------------------------------------------------------------------- /benchmarks/lbm-lid-driven-cavity-flow/src/CellType.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | struct CellType 4 | { 5 | enum Classification : int 6 | { 7 | bounceBack, 8 | movingWall, 9 | bulk, 10 | undefined 11 | }; 12 | 13 | NEON_CUDA_HOST_DEVICE CellType(int dummy = 0) 14 | { 15 | (void)dummy; 16 | classification = bulk; 17 | wallNghBitflag = 0; 18 | } 19 | 20 | NEON_CUDA_HOST_DEVICE explicit CellType(Classification c, uint32_t n) 21 | { 22 | classification = c; 23 | wallNghBitflag = n; 24 | } 25 | NEON_CUDA_HOST_DEVICE explicit CellType(Classification c) 26 | { 27 | classification = c; 28 | wallNghBitflag = 0; 29 | } 30 | 31 | 32 | 33 | uint32_t wallNghBitflag; 34 | Classification classification; 35 | }; 36 | 37 | std::ostream& operator<<(std::ostream& os, const CellType& dt) 38 | { 39 | os << static_cast(dt.classification); 40 | return os; 41 | } -------------------------------------------------------------------------------- /benchmarks/lbm-lid-driven-cavity-flow/src/Repoert.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | #include "Config.h" 6 | 7 | struct Report 8 | { 9 | Neon::Report mReport; 10 | std::string mFname; 11 | 12 | std::vector mMLUPS; 13 | std::vector mLoopTime; 14 | std::vector mNeonGridInitTime; 15 | std::vector mProblemSetupTime; 16 | 17 | std::string mtimeUnit = ""; 18 | 19 | explicit Report(const Config& c); 20 | 21 | auto recordMLUPS(double mlups) 22 | -> void; 23 | 24 | auto recordLoopTime(double time, 25 | const std::string& unit) 26 | -> void; 27 | 28 | auto recordNeonGridInitTime(double time, 29 | const std::string& unit) 30 | -> void; 31 | 32 | auto recordProblemSetupTime(double time, 33 | const std::string& unit) 34 | -> void; 35 | 36 | auto save() 37 | -> void; 38 | void recordBk(Neon::Backend& backend); 39 | }; 40 | -------------------------------------------------------------------------------- /benchmarks/lbm-lid-driven-cavity-flow/src/RunCavityTwoPop.h: -------------------------------------------------------------------------------- 1 | #include "Config.h" 2 | #include "D3Q19.h" 3 | #include "Neon/domain/dGrid.h" 4 | 5 | #include "Metrics.h" 6 | #include "Repoert.h" 7 | 8 | namespace CavityTwoPop { 9 | 10 | auto run(Config& config, 11 | Report& report) -> void; 12 | } // namespace CavityTwoPop -------------------------------------------------------------------------------- /cmake/ExportHeader.cmake: -------------------------------------------------------------------------------- 1 | function(ExportHeader libName) 2 | include(GenerateExportHeader) 3 | generate_export_header(${libName}) 4 | string(TOLOWER ${libName} EXPORT_FILE_NAME) 5 | target_include_directories(${libName} PUBLIC "${CMAKE_CURRENT_BINARY_DIR}") 6 | endfunction() 7 | -------------------------------------------------------------------------------- /cmake/ManageGitShaInformation.cmake: -------------------------------------------------------------------------------- 1 | # Get and store git sha1 https://stackoverflow.com/a/4318642/1608232 2 | list(APPEND CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_CURRENT_SOURCE_DIR}/cmakeTools) 3 | include("${PROJECT_SOURCE_DIR}/cmake/GetGitRevisionDescription.cmake") 4 | get_git_head_revision(GIT_REFSPEC GIT_SHA1) 5 | git_local_changes(GIT_LOCAL_CHANGES_STATUS) 6 | configure_file("${CMAKE_CURRENT_SOURCE_DIR}/cmake/git_sha1.cpp.in" "${CMAKE_CURRENT_SOURCE_DIR}/libNeonCore/src/core/git_sha1.cpp" @ONLY) 7 | -------------------------------------------------------------------------------- /cmake/ManageLibraryType.cmake: -------------------------------------------------------------------------------- 1 | set(BUILD_NEON_SHARED_LIBS "OFF" CACHE BOOL "Build Neon as shared library") 2 | if (${BUILD_NEON_SHARED_LIBS}) 3 | message(STATUS "Building Neon as a shared library") 4 | else () 5 | message(STATUS "Building Neon as a static library") 6 | endif () -------------------------------------------------------------------------------- /cmake/ManageTargetCUDACompute.cmake: -------------------------------------------------------------------------------- 1 | # Toggle between building for the installed GPU's CC or all CC 2 | set(NEON_BUILD_ONLY_FOR_INSTALLED_GPU "ON" CACHE BOOL "Build only for the current/installed compute capabilities") 3 | 4 | if (NOT DEFINED ${CMAKE_CUDA_ARCHITECTURES}) 5 | if (${NEON_BUILD_ONLY_FOR_INSTALLED_GPU}) 6 | message(STATUS "Building only for installed GPU's compute capabilities") 7 | include("${PROJECT_SOURCE_DIR}/cmake/AutoDetectCudaArch.cmake") 8 | else () 9 | message(STATUS "Building for all compute capabilities") 10 | if (NOT DEFINED CMAKE_CUDA_ARCHITECTURES) 11 | message(STATUS "GPU architectures was not define (or not detected). Will build for sm_86 only.") 12 | set(CMAKE_CUDA_ARCHITECTURES 86) 13 | endif () 14 | endif () 15 | else () 16 | message(STATUS "Building for user defined compute capabilities: ${CMAKE_CUDA_ARCHITECTURES}") 17 | endif () 18 | 19 | # Auto-detect GPU architecture, sets ${CUDA_ARCHS} 20 | message(STATUS "CUDA architectures set to ${CMAKE_CUDA_ARCHITECTURES}") 21 | -------------------------------------------------------------------------------- /cmake/ManageUnitTests.cmake: -------------------------------------------------------------------------------- 1 | # Build Neon unit and benchmarks test 2 | set(BUILD_NEON_TESTING "ON" CACHE BOOL "Build Neon tests") 3 | if (${BUILD_NEON_TESTING}) 4 | message(STATUS "Building Neon unit and performance tests") 5 | else () 6 | message(STATUS "Building Neon without unit and performance tests") 7 | endif () -------------------------------------------------------------------------------- /cmake/Nvtx.cmake: -------------------------------------------------------------------------------- 1 | #Toggle NVTX ranges. To enable use "-DNEON_USE_NVTX=ON" 2 | 3 | set(NEON_USE_NVTX "ON" CACHE BOOL "Use NVTX Ranges") 4 | 5 | if (${NEON_USE_NVTX}) 6 | message(STATUS "NVTX Ranges is enabled") 7 | else () 8 | message(STATUS "NVTX Ranges is disabled") 9 | endif () 10 | -------------------------------------------------------------------------------- /cmake/git_sha1.cpp.in: -------------------------------------------------------------------------------- 1 | //https://stackoverflow.com/a/4318642/1608232 2 | #define GIT_SHA1 "@GIT_SHA1@" 3 | #define GIT_LOCAL_CHANGES_STATUS "@GIT_LOCAL_CHANGES_STATUS@" 4 | #define GIT_REFSPEC "@GIT_REFSPEC@" 5 | extern const char g_GIT_SHA1[] = GIT_SHA1; 6 | extern const char g_GIT_LOCAL_CHANGES_STATUS[] = GIT_LOCAL_CHANGES_STATUS; 7 | extern const char g_GIT_REFSPEC[] = GIT_REFSPEC; -------------------------------------------------------------------------------- /docs/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Autodesk/Neon/bf725483bd8b69b3c1c2a627547e8f3f382cd249/docs/.DS_Store -------------------------------------------------------------------------------- /docs/CONTRIBUTORS.md: -------------------------------------------------------------------------------- 1 | # Contributors 2 | 3 | We are extremely thankful to all the contributors to the project. 4 | A complete list can be found at [GitHub Contributors Page](https://github.com/Autodesk/Neon/graphs/contributors). 5 | 6 | We also want to thank everyone who contributed to Neon before it was made open source. 7 | Since the history of the Neon internal version was not migrated to GitHub, their names may not appear on the GitHub Contributors Page. 8 | 9 | ``` 10 | Ahmed Mahmoud 11 | Ali Hashemi 12 | Brooke Dolny 13 | Massimiliano Meneghin 14 | Nigel Morris 15 | Pradeep Kumar Jayaraman 16 | ``` 17 | 18 | Finally, we also want to thank everyone from Autodesk who supported the project and made an open-source Neon a reality. -------------------------------------------------------------------------------- /docs/cla/ADSK-Form-Corp-Contrib-Agmt-for-Open-Source.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Autodesk/Neon/bf725483bd8b69b3c1c2a627547e8f3f382cd249/docs/cla/ADSK-Form-Corp-Contrib-Agmt-for-Open-Source.pdf -------------------------------------------------------------------------------- /docs/gallery/img/fractals.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Autodesk/Neon/bf725483bd8b69b3c1c2a627547e8f3f382cd249/docs/gallery/img/fractals.gif -------------------------------------------------------------------------------- /docs/gallery/img/ghia1982-fig.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Autodesk/Neon/bf725483bd8b69b3c1c2a627547e8f3f382cd249/docs/gallery/img/ghia1982-fig.png -------------------------------------------------------------------------------- /docs/gallery/img/gol.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Autodesk/Neon/bf725483bd8b69b3c1c2a627547e8f3f382cd249/docs/gallery/img/gol.gif -------------------------------------------------------------------------------- /docs/gallery/img/karman-lbm2d-vel-mag.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Autodesk/Neon/bf725483bd8b69b3c1c2a627547e8f3f382cd249/docs/gallery/img/karman-lbm2d-vel-mag.gif -------------------------------------------------------------------------------- /docs/gallery/img/karman-lbm2d-vel-vor.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Autodesk/Neon/bf725483bd8b69b3c1c2a627547e8f3f382cd249/docs/gallery/img/karman-lbm2d-vel-vor.gif -------------------------------------------------------------------------------- /docs/gallery/img/lbm2d-vel-mag.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Autodesk/Neon/bf725483bd8b69b3c1c2a627547e8f3f382cd249/docs/gallery/img/lbm2d-vel-mag.gif -------------------------------------------------------------------------------- /docs/gallery/img/lbm2d-vel-vor.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Autodesk/Neon/bf725483bd8b69b3c1c2a627547e8f3f382cd249/docs/gallery/img/lbm2d-vel-vor.gif -------------------------------------------------------------------------------- /docs/gallery/img/lbm3d-vel-mag.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Autodesk/Neon/bf725483bd8b69b3c1c2a627547e8f3f382cd249/docs/gallery/img/lbm3d-vel-mag.gif -------------------------------------------------------------------------------- /docs/gallery/img/possion.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Autodesk/Neon/bf725483bd8b69b3c1c2a627547e8f3f382cd249/docs/gallery/img/possion.png -------------------------------------------------------------------------------- /docs/img/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Autodesk/Neon/bf725483bd8b69b3c1c2a627547e8f3f382cd249/docs/img/favicon.ico -------------------------------------------------------------------------------- /docs/img/high-level-idea.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Autodesk/Neon/bf725483bd8b69b3c1c2a627547e8f3f382cd249/docs/img/high-level-idea.png -------------------------------------------------------------------------------- /docs/javascripts/mathjax.js: -------------------------------------------------------------------------------- 1 | window.MathJax = { 2 | tex: { 3 | inlineMath: [["\\(", "\\)"]], 4 | displayMath: [["\\[", "\\]"]], 5 | processEscapes: true, 6 | processEnvironments: true 7 | }, 8 | options: { 9 | ignoreHtmlClass: ".*|", 10 | processHtmlClass: "arithmatex" 11 | } 12 | }; 13 | 14 | document$.subscribe(() => { 15 | 16 | 17 | MathJax.typesetPromise() 18 | }) -------------------------------------------------------------------------------- /docs/learn/advanced-mechanisms/multi-resolution.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Autodesk/Neon/bf725483bd8b69b3c1c2a627547e8f3f382cd249/docs/learn/advanced-mechanisms/multi-resolution.md -------------------------------------------------------------------------------- /docs/learn/examples/mandelbrot.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Autodesk/Neon/bf725483bd8b69b3c1c2a627547e8f3f382cd249/docs/learn/examples/mandelbrot.md -------------------------------------------------------------------------------- /docs/learn/img/axpy-laplace-dot-app.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Autodesk/Neon/bf725483bd8b69b3c1c2a627547e8f3f382cd249/docs/learn/img/axpy-laplace-dot-app.png -------------------------------------------------------------------------------- /docs/learn/img/axpy-laplace-dot-code.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Autodesk/Neon/bf725483bd8b69b3c1c2a627547e8f3f382cd249/docs/learn/img/axpy-laplace-dot-code.png -------------------------------------------------------------------------------- /docs/learn/img/axpy-laplace-dot-e2occ.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Autodesk/Neon/bf725483bd8b69b3c1c2a627547e8f3f382cd249/docs/learn/img/axpy-laplace-dot-e2occ.png -------------------------------------------------------------------------------- /docs/learn/img/axpy-laplace-dot-eocc.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Autodesk/Neon/bf725483bd8b69b3c1c2a627547e8f3f382cd249/docs/learn/img/axpy-laplace-dot-eocc.png -------------------------------------------------------------------------------- /docs/learn/img/axpy-laplace-dot-nocc.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Autodesk/Neon/bf725483bd8b69b3c1c2a627547e8f3f382cd249/docs/learn/img/axpy-laplace-dot-nocc.png -------------------------------------------------------------------------------- /docs/learn/img/axpy-laplace-dot-socc.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Autodesk/Neon/bf725483bd8b69b3c1c2a627547e8f3f382cd249/docs/learn/img/axpy-laplace-dot-socc.png -------------------------------------------------------------------------------- /docs/learn/img/neon-layers.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Autodesk/Neon/bf725483bd8b69b3c1c2a627547e8f3f382cd249/docs/learn/img/neon-layers.png -------------------------------------------------------------------------------- /docs/learn/multi-resolution/multi-resolution.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Autodesk/Neon/bf725483bd8b69b3c1c2a627547e8f3f382cd249/docs/learn/multi-resolution/multi-resolution.md -------------------------------------------------------------------------------- /docs/learn/staggered-grids/img/staggered-grid.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Autodesk/Neon/bf725483bd8b69b3c1c2a627547e8f3f382cd249/docs/learn/staggered-grids/img/staggered-grid.jpg -------------------------------------------------------------------------------- /docs/learn/staggered-grids/img/staggered-grid.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Autodesk/Neon/bf725483bd8b69b3c1c2a627547e8f3f382cd249/docs/learn/staggered-grids/img/staggered-grid.png -------------------------------------------------------------------------------- /docs/learn/staggered-grids/img/staggeredGrid-0000.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Autodesk/Neon/bf725483bd8b69b3c1c2a627547e8f3f382cd249/docs/learn/staggered-grids/img/staggeredGrid-0000.png -------------------------------------------------------------------------------- /docs/learn/staggered-grids/img/staggeredGrid-0001.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Autodesk/Neon/bf725483bd8b69b3c1c2a627547e8f3f382cd249/docs/learn/staggered-grids/img/staggeredGrid-0001.png -------------------------------------------------------------------------------- /docs/learn/staggered-grids/img/staggeredGrid-0002.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Autodesk/Neon/bf725483bd8b69b3c1c2a627547e8f3f382cd249/docs/learn/staggered-grids/img/staggeredGrid-0002.png -------------------------------------------------------------------------------- /docs/learn/staggered-grids/img/staggeredGrid-offsets.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Autodesk/Neon/bf725483bd8b69b3c1c2a627547e8f3f382cd249/docs/learn/staggered-grids/img/staggeredGrid-offsets.png -------------------------------------------------------------------------------- /docs/learn/staggered-grids/img/staggeredGrid-tutorial-0000.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Autodesk/Neon/bf725483bd8b69b3c1c2a627547e8f3f382cd249/docs/learn/staggered-grids/img/staggeredGrid-tutorial-0000.png -------------------------------------------------------------------------------- /docs/learn/staggered-grids/img/staggeredGrid-tutorial-0001.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Autodesk/Neon/bf725483bd8b69b3c1c2a627547e8f3f382cd249/docs/learn/staggered-grids/img/staggeredGrid-tutorial-0001.png -------------------------------------------------------------------------------- /docs/learn/staggered-grids/img/staggeredGrid-tutorial-0002.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Autodesk/Neon/bf725483bd8b69b3c1c2a627547e8f3f382cd249/docs/learn/staggered-grids/img/staggeredGrid-tutorial-0002.png -------------------------------------------------------------------------------- /docs/learn/the-bases/01-system-level.md: -------------------------------------------------------------------------------- 1 | ![](img/01-layers-system.png){align=right style="width:200px"} 2 | 3 | # The System Level 4 | 5 | The **System** abstraction shields the rest of Neon from architecture and hardware-specific mechanisms. Therefore, this abstraction level should be invisible to the final Neon users. 6 | 7 | The System defines an object-oriented interface to manage resources and requires the following backend capabilities: 8 | 9 | **Memory Management**: 10 | This allows Neon to create device buffers and move data between devices or host. 11 | 12 | **Queue-based Run-time Model**: 13 | Neon uses a queue-based model to abstract asynchronous kernels running on the same device. It is a generic model widely used at the hardware level and other programming models. For example, in CUDA, Streams represent command queues, while Events are the mechanism to inject dependencies between different queues. 14 | 15 | **Lambda Functions**: 16 | Neon leverages the expressiveness of lambda functions to lessen the complexity of authoring multi-GPU applications. 17 | 18 | Therefore, to port Neon to a new accelerator, only the Neon System abstraction has to be implemented; higher levels in Neon can remain unchanged. -------------------------------------------------------------------------------- /docs/learn/the-bases/02-the-set-level.md: -------------------------------------------------------------------------------- 1 | ![](img/02-layers-set.png){ align=right style="width:200px"} 2 | # The Set Level 3 | 4 | -------------------------------------------------------------------------------- /docs/learn/the-bases/img/01-layers-system.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Autodesk/Neon/bf725483bd8b69b3c1c2a627547e8f3f382cd249/docs/learn/the-bases/img/01-layers-system.png -------------------------------------------------------------------------------- /docs/learn/the-bases/img/02-layers-set.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Autodesk/Neon/bf725483bd8b69b3c1c2a627547e8f3f382cd249/docs/learn/the-bases/img/02-layers-set.png -------------------------------------------------------------------------------- /docs/learn/the-bases/img/03-domain.vtk.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Autodesk/Neon/bf725483bd8b69b3c1c2a627547e8f3f382cd249/docs/learn/the-bases/img/03-domain.vtk.png -------------------------------------------------------------------------------- /docs/learn/the-bases/img/03-expanded-levelSet.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Autodesk/Neon/bf725483bd8b69b3c1c2a627547e8f3f382cd249/docs/learn/the-bases/img/03-expanded-levelSet.png -------------------------------------------------------------------------------- /docs/learn/the-bases/img/03-grad.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Autodesk/Neon/bf725483bd8b69b3c1c2a627547e8f3f382cd249/docs/learn/the-bases/img/03-grad.png -------------------------------------------------------------------------------- /docs/learn/the-bases/img/03-initial-levelSet.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Autodesk/Neon/bf725483bd8b69b3c1c2a627547e8f3f382cd249/docs/learn/the-bases/img/03-initial-levelSet.png -------------------------------------------------------------------------------- /docs/learn/the-bases/img/03-layers-domain.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Autodesk/Neon/bf725483bd8b69b3c1c2a627547e8f3f382cd249/docs/learn/the-bases/img/03-layers-domain.png -------------------------------------------------------------------------------- /docs/learn/the-bases/img/04-layers-skeleton.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Autodesk/Neon/bf725483bd8b69b3c1c2a627547e8f3f382cd249/docs/learn/the-bases/img/04-layers-skeleton.png -------------------------------------------------------------------------------- /docs/logo/neonDarkLogo.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Autodesk/Neon/bf725483bd8b69b3c1c2a627547e8f3f382cd249/docs/logo/neonDarkLogo.jpg -------------------------------------------------------------------------------- /docs/maintainers.md: -------------------------------------------------------------------------------- 1 | # Current Maintainers 2 | 3 | The current maintainers of project Neon are: 4 | 5 | | ![avatar](https://images.weserv.nl/?url=avatars.githubusercontent.com/u/57805133?v=4&h=150&w=150&fit=cover&mask=circle&maxage=7d) | ![avatar](https://images.weserv.nl/?url=https://avatars.githubusercontent.com/u/3890167?v=4&h=150&w=150&fit=cover&mask=circle&maxage=7d) | 6 | |:----------------------------------------------------------------------------------------------------------------------------------:|:-----------------------------------------------------------------------------------------------------------------------------------------:| 7 | | [Massimiliano Meneghin](https://github.com/massimim) | [Ahmed Mahmoud](https://github.com/Ahdhn) | 8 | |
Autodesk Research
|
Autodesk Research
| 9 | -------------------------------------------------------------------------------- /docs/references/api-documentation.md: -------------------------------------------------------------------------------- 1 | # API Documentation - Doxygen 2 | 3 | Doxyten documentation for Neon users is located here: [CodeConvention.md](../..//doxygen/html/index.html) -------------------------------------------------------------------------------- /docs/references/bibtex/Meneghin-2022-NAM.bib: -------------------------------------------------------------------------------- 1 | @INPROCEEDINGS{Meneghin:2022:NAM, 2 | author = {Meneghin, Massimiliano and Mahmoud, Ahmed H. and Jayaraman, Pradeep Kumar and Morris, Nigel J. W.}, 3 | booktitle = {Proceedings of the 36th IEEE International Parallel and Distributed Processing Symposium}, 4 | title = {Neon: A Multi-GPU Programming Model for Grid-based Computations}, 5 | year = {2022}, 6 | month = {june}, 7 | pages = {817--827}, 8 | doi = {10.1109/IPDPS53621.2022.00084}, 9 | url = {https://escholarship.org/uc/item/9fz7k633} 10 | } -------------------------------------------------------------------------------- /docs/references/performance-considerations.md: -------------------------------------------------------------------------------- 1 | # Performance Considerations 2 | 3 | TODO - add some reference benchmarks -------------------------------------------------------------------------------- /libNeonCore/include/Neon/core/tools/IO.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "Neon/core/tools/io/IODense.h" 4 | #include "Neon/core/tools/io/IODenseVTK.h" -------------------------------------------------------------------------------- /libNeonCore/include/Neon/core/tools/development/workInProgress.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "Neon/core/types/Exceptions.h" 3 | 4 | 5 | /** 6 | * Macro to be used as place holder for features whose development is incomplete. 7 | */ 8 | #define NEON_DEV_UNDER_CONSTRUCTION(componentName) \ 9 | { \ 10 | Neon::NeonException exp(componentName); \ 11 | exp << "The requested feature is still under construction, sorry!!!"; \ 12 | (exp).setEnvironmentInfo(__FILE__, __LINE__, NEON_FUNCTION_NAME()); \ 13 | exp.logThrow(); \ 14 | throw exp; \ 15 | } 16 | -------------------------------------------------------------------------------- /libNeonCore/include/Neon/core/tools/git_sha1.h: -------------------------------------------------------------------------------- 1 | //https://stackoverflow.com/a/4318642/1608232 2 | extern const char g_GIT_SHA1[]; 3 | extern const char g_GIT_LOCAL_CHANGES_STATUS[]; 4 | extern const char g_GIT_REFSPEC[]; 5 | -------------------------------------------------------------------------------- /libNeonCore/include/Neon/core/tools/metaprogramming.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "Neon/core/tools/metaprogramming/computeFunOnTuple.h" 4 | #include "Neon/core/tools/metaprogramming/debugHelp.h" 5 | #include "Neon/core/tools/metaprogramming/extractTupleVecType.h" 6 | #include "Neon/core/tools/metaprogramming/tupleVecTable.h" 7 | -------------------------------------------------------------------------------- /libNeonCore/include/Neon/core/tools/metaprogramming/hasNestedSubtype.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include "Neon/core/types/macros.h" 5 | 6 | namespace Neon { 7 | namespace meta { 8 | 9 | namespace internal { 10 | namespace hasNestedType { 11 | template 12 | struct Void 13 | { 14 | typedef void type; 15 | }; 16 | } // namespace hasNestedType 17 | } // namespace internal 18 | // namespace internal 19 | template 20 | struct HasNestedType_t 21 | { 22 | enum 23 | { 24 | value = 0 25 | }; 26 | }; 27 | 28 | template 29 | struct HasNestedType_t::type> 30 | { 31 | enum 32 | { 33 | value = 1 34 | }; 35 | }; 36 | 37 | } // namespace meta 38 | } // namespace Neon 39 | -------------------------------------------------------------------------------- /libNeonCore/include/Neon/core/types/BasicTypes.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | namespace Neon { 6 | 7 | using index_t = int32_t; 8 | using index64_t = int64_t; 9 | 10 | } // End of namespace Neon -------------------------------------------------------------------------------- /libNeonCore/include/Neon/core/types/DataUse.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | 6 | namespace Neon { 7 | 8 | /** 9 | * Type of use for a Neon data container. 10 | * HOST: used for pre and post processing. 11 | * For example to load data into a field or to do some computation on a field before 12 | * IO_POSTPROCESSING operations are always computed on the CPU 13 | * 14 | * DEVICE: used for computation on the device.. 15 | * When deploying on an accelerator, compute is always run on the accelerator. 16 | * 17 | * HOST_DEVICE: both for IO_POSTPROCESSING and COMPUTE 18 | * 19 | */ 20 | enum struct DataUse 21 | { 22 | HOST_DEVICE = 0, 23 | DEVICE = 1, 24 | HOST = 2, 25 | }; 26 | 27 | struct DataUseUtils 28 | { 29 | constexpr static int numConfigurations = 3; 30 | 31 | /** 32 | * Convert a DataUse to string 33 | * 34 | * @param option 35 | * @return 36 | */ 37 | static auto toString(Neon::DataUse option) -> const char*; 38 | }; 39 | 40 | /** 41 | * operator<< 42 | * 43 | * @param os 44 | * @param m 45 | * @return 46 | */ 47 | std::ostream& operator<<(std::ostream& os, Neon::DataUse const& m); 48 | 49 | } // namespace Neon 50 | 51 | 52 | -------------------------------------------------------------------------------- /libNeonCore/include/Neon/core/types/DataView.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | #include 4 | 5 | namespace Neon { 6 | 7 | enum struct DataView 8 | { 9 | STANDARD = 0, 10 | INTERNAL = 1, 11 | BOUNDARY = 2, 12 | }; 13 | 14 | /** 15 | * Set of utilities for DataView options. 16 | */ 17 | struct DataViewUtil 18 | { 19 | /** 20 | * Number of configurations for the enum 21 | */ 22 | static const int nConfig{static_cast(3)}; 23 | 24 | /** 25 | * Convert enum value to string 26 | * 27 | * @param dataView 28 | * @return 29 | */ 30 | static auto toString(DataView dataView) -> std::string; 31 | 32 | /** 33 | * Returns all valid configuration for DataView 34 | * @return 35 | */ 36 | static auto validOptions() -> std::array; 37 | 38 | static auto fromInt(int val) -> DataView; 39 | 40 | static auto toInt(DataView dataView) -> int; 41 | 42 | }; 43 | 44 | 45 | /** 46 | * operator<< 47 | * 48 | * @param os 49 | * @param m 50 | * @return 51 | */ 52 | std::ostream& operator<<(std::ostream& os, Neon::DataView const& m); 53 | } // namespace Neon 54 | -------------------------------------------------------------------------------- /libNeonCore/include/Neon/core/types/MemoryLayout.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | namespace Neon { 6 | 7 | enum class MemoryLayout 8 | { 9 | structOfArrays = 0, 10 | arrayOfStructs = 1 11 | }; 12 | 13 | class MemoryLayoutUtils 14 | { 15 | public: 16 | static auto toString(const MemoryLayout& config) -> const char*; 17 | static auto toInt(const MemoryLayout& config) -> int; 18 | static auto fromInt(const int& config) -> MemoryLayout; 19 | }; 20 | 21 | } // namespace Neon 22 | -------------------------------------------------------------------------------- /libNeonCore/include/Neon/core/types/memOptions.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "MemoryLayout.h" 3 | #include 4 | 5 | namespace Neon { 6 | 7 | struct memPadding_e 8 | { 9 | enum e 10 | { 11 | OFF = 0, 12 | ON = 1 13 | }; 14 | static auto toString(int config) -> const char*; 15 | }; 16 | 17 | struct memAlignment_e 18 | { 19 | enum e 20 | { 21 | SYSTEM = 0, /** Basic alignment provided by the allocator */ 22 | L1 = 1, /** Alignment based on L1 cache size */ 23 | L2 = 2, /** Alignment based on L2 cache size */ 24 | PAGE = 3, /** Alignment based on memory page size */ 25 | }; 26 | static auto toString(int config) -> const char*; 27 | }; 28 | 29 | 30 | } // namespace Neon 31 | -------------------------------------------------------------------------------- /libNeonCore/include/Neon/core/types/vec.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | 4 | #include "Neon/core/types/Macros.h" 5 | 6 | #if defined(NEON_COMPILER_VS) 7 | #pragma warning(push) 8 | #pragma warning(disable : 4201) 9 | #endif 10 | 11 | #include "Neon/core/types/vec/vec2d_generic.h" 12 | #include "Neon/core/types/vec/vec3d_generic.h" 13 | #include "Neon/core/types/vec/vec4d_generic.h" 14 | 15 | #include "Neon/core/types/vec/vecAlias.h" 16 | 17 | #include "Neon/core/types/vec/vec2d_integer.tdecl.h" 18 | #include "Neon/core/types/vec/vec2d_real.tdecl.h" 19 | #include "Neon/core/types/vec/vec3d_integer.tdecl.h" 20 | #include "Neon/core/types/vec/vec3d_real.tdecl.h" 21 | #include "Neon/core/types/vec/vec4d_integer.tdecl.h" 22 | #include "Neon/core/types/vec/vec4d_real.tdecl.h" 23 | 24 | #include "Neon/core/types/vec/vec2d_integer.timp.h" 25 | #include "Neon/core/types/vec/vec2d_real.timp.h" 26 | #include "Neon/core/types/vec/vec3d_integer.timp.h" 27 | #include "Neon/core/types/vec/vec3d_real.timp.h" 28 | #include "Neon/core/types/vec/vec4d_integer.timp.h" 29 | #include "Neon/core/types/vec/vec4d_real.timp.h" 30 | 31 | #if defined(NEON_COMPILER_VS) 32 | #pragma warning(pop) 33 | #endif -------------------------------------------------------------------------------- /libNeonCore/src/core/tools/Logger.cpp: -------------------------------------------------------------------------------- 1 | #include "Neon/core/tools/Logger.h" 2 | #include "libneoncore_export.h" 3 | 4 | namespace Neon { 5 | 6 | namespace globalSpace { 7 | LIBNEONCORE_EXPORT Logger LoggerObj; 8 | 9 | } // namespace globalSpace 10 | } // namespace Neon 11 | -------------------------------------------------------------------------------- /libNeonCore/src/core/tools/Report.cu: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Autodesk/Neon/bf725483bd8b69b3c1c2a627547e8f3f382cd249/libNeonCore/src/core/tools/Report.cu -------------------------------------------------------------------------------- /libNeonCore/src/core/types/Access.cpp: -------------------------------------------------------------------------------- 1 | #include "Neon/core/types/Access.h" 2 | 3 | namespace Neon { 4 | 5 | auto AccessUtils::toString(Access mode) -> const char* 6 | { 7 | switch (mode) { 8 | case Access::read: { 9 | return "read"; 10 | } 11 | case Access::readWrite: { 12 | return "readWrite"; 13 | } 14 | default: 15 | return nullptr; 16 | } 17 | } 18 | } // END of namespace Neon 19 | 20 | std::ostream& operator<<(std::ostream& os, Neon::Access const& m) 21 | { 22 | return os << std::string(Neon::AccessUtils::toString(m)); 23 | } 24 | -------------------------------------------------------------------------------- /libNeonCore/src/core/types/DataUse.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // Created by max on 2020-11-02. 3 | // 4 | #include "Neon/core/types/DataUse.h" 5 | #include "Neon/core/core.h" 6 | namespace Neon { 7 | 8 | class DevSet; 9 | 10 | 11 | auto DataUseUtils::toString(Neon::DataUse option) -> const char* 12 | { 13 | switch (option) { 14 | case Neon::DataUse::HOST_DEVICE: { 15 | return "HOST_DEVICE"; 16 | } 17 | case Neon::DataUse::DEVICE: { 18 | return "DEVICE"; 19 | } 20 | case Neon::DataUse::HOST: { 21 | return "HOST"; 22 | } 23 | default: { 24 | NEON_THROW_UNSUPPORTED_OPERATION("DataUse_e: Option not recognized.") 25 | } 26 | } 27 | } 28 | 29 | std::ostream& operator<<(std::ostream& os, Neon::DataUse const& m) 30 | { 31 | return os << std::string(Neon::DataUseUtils::toString(m)); 32 | } 33 | 34 | } // namespace Neon 35 | -------------------------------------------------------------------------------- /libNeonCore/src/core/types/MemoryLayout.cpp: -------------------------------------------------------------------------------- 1 | #include "Neon/core/types/MemoryLayout.h" 2 | #include 3 | #include "Neon/core//core.h" 4 | 5 | 6 | namespace Neon { 7 | 8 | auto MemoryLayoutUtils::toString(const MemoryLayout& config) -> const char* 9 | { 10 | switch (config) { 11 | case MemoryLayout::structOfArrays: { 12 | return "structOfArrays"; 13 | } 14 | case MemoryLayout::arrayOfStructs: { 15 | return "arrayOfStructs"; 16 | } 17 | default: { 18 | NEON_THROW_UNSUPPORTED_OPTION(""); 19 | } 20 | } 21 | } 22 | 23 | auto MemoryLayoutUtils::toInt(const MemoryLayout& config) -> int 24 | { 25 | return static_cast(config); 26 | } 27 | 28 | auto MemoryLayoutUtils::fromInt(const int& config) -> MemoryLayout 29 | { 30 | if (config == toInt(MemoryLayout::structOfArrays)) { 31 | return MemoryLayout::structOfArrays; 32 | } 33 | 34 | if (config == toInt(MemoryLayout::arrayOfStructs)) { 35 | return MemoryLayout::arrayOfStructs; 36 | } 37 | NEON_THROW_UNSUPPORTED_OPTION(""); 38 | } 39 | 40 | } // namespace Neon 41 | -------------------------------------------------------------------------------- /libNeonCore/tests/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.19 FATAL_ERROR) 2 | 3 | add_subdirectory("unit") 4 | -------------------------------------------------------------------------------- /libNeonCore/tests/unit/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.19 FATAL_ERROR) 2 | 3 | add_subdirectory("coreUt_chrono") 4 | add_subdirectory("coreUt_cli") 5 | add_subdirectory("coreUt_digraph") 6 | add_subdirectory("coreUt_exceptions") 7 | add_subdirectory("coreUt_io") 8 | add_subdirectory("coreUt_logging") 9 | add_subdirectory("coreUt_tools") 10 | add_subdirectory("coreUt_tuple3d") -------------------------------------------------------------------------------- /libNeonCore/tests/unit/coreUt_chrono/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.19 FATAL_ERROR) 2 | 3 | file(GLOB_RECURSE SrcFiles src/*.*) 4 | 5 | add_executable(coreUt_chrono ${SrcFiles}) 6 | 7 | target_link_libraries(coreUt_chrono 8 | PUBLIC libNeonCore 9 | PUBLIC gtest_main) 10 | 11 | set_target_properties(coreUt_chrono PROPERTIES FOLDER "libNeonCore") 12 | source_group(TREE ${CMAKE_CURRENT_LIST_DIR} PREFIX "coreUt_chrono" FILES ${SrcFiles}) 13 | 14 | add_test(NAME coreUt_chrono COMMAND coreUt_chrono) 15 | -------------------------------------------------------------------------------- /libNeonCore/tests/unit/coreUt_cli/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.19 FATAL_ERROR) 2 | 3 | file(GLOB_RECURSE SrcFiles src/*.*) 4 | 5 | add_executable(coreUt_cli ${SrcFiles}) 6 | 7 | target_link_libraries(coreUt_cli 8 | PUBLIC libNeonCore 9 | PUBLIC gtest_main) 10 | 11 | set_target_properties(coreUt_cli PROPERTIES FOLDER "libNeonCore") 12 | source_group(TREE ${CMAKE_CURRENT_LIST_DIR} PREFIX "coreUt_cli" FILES ${SrcFiles}) 13 | 14 | add_test(NAME coreUt_cli COMMAND coreUt_cli) -------------------------------------------------------------------------------- /libNeonCore/tests/unit/coreUt_digraph/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.19 FATAL_ERROR) 2 | 3 | file(GLOB_RECURSE SrcFiles src/*.*) 4 | 5 | add_executable(coreUt_digraph ${SrcFiles}) 6 | 7 | target_link_libraries(coreUt_digraph 8 | PUBLIC libNeonCore 9 | PUBLIC gtest_main) 10 | 11 | set_target_properties(coreUt_digraph PROPERTIES FOLDER "libNeonCore") 12 | source_group(TREE ${CMAKE_CURRENT_LIST_DIR} PREFIX "coreUt_digraph" FILES ${SrcFiles}) 13 | 14 | add_test(NAME coreUt_digraph COMMAND coreUt_digraph) -------------------------------------------------------------------------------- /libNeonCore/tests/unit/coreUt_exceptions/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.19 FATAL_ERROR) 2 | 3 | file(GLOB_RECURSE SrcFiles src/*.*) 4 | 5 | add_executable(coreUt_exceptions ${SrcFiles}) 6 | 7 | target_link_libraries(coreUt_exceptions 8 | PUBLIC libNeonCore 9 | PUBLIC gtest_main) 10 | 11 | set_target_properties(coreUt_exceptions PROPERTIES FOLDER "libNeonCore") 12 | source_group(TREE ${CMAKE_CURRENT_LIST_DIR} PREFIX "coreUt_exceptions" FILES ${SrcFiles}) 13 | 14 | add_test(NAME coreUt_exceptions COMMAND coreUt_exceptions) -------------------------------------------------------------------------------- /libNeonCore/tests/unit/coreUt_exceptions/src/testExceptions.cpp: -------------------------------------------------------------------------------- 1 | #include "gtest/gtest.h" 2 | 3 | #include "Neon/core/types/Exceptions.h" 4 | 5 | #include 6 | #include 7 | 8 | TEST(exceptions, noMessageNoComponet) 9 | { 10 | 11 | auto runThrow = []() { 12 | Neon::NeonException exp; 13 | NEON_THROW(exp); 14 | }; 15 | 16 | ASSERT_ANY_THROW(runThrow()); 17 | } 18 | 19 | TEST(exceptions, noMessage) 20 | { 21 | 22 | auto runThrow = []() { 23 | Neon::NeonException exp("component Name"); 24 | NEON_THROW(exp); 25 | }; 26 | 27 | ASSERT_ANY_THROW(runThrow()); 28 | } 29 | 30 | TEST(exceptions, all) 31 | { 32 | 33 | auto runThrow = []() { 34 | Neon::NeonException exp("component Name"); 35 | exp << "This is the user message..."; 36 | NEON_THROW(exp); 37 | }; 38 | 39 | ASSERT_ANY_THROW(runThrow()); 40 | } 41 | 42 | 43 | int main(int argc, char** argv) 44 | { 45 | ::testing::InitGoogleTest(&argc, argv); 46 | return RUN_ALL_TESTS(); 47 | } 48 | -------------------------------------------------------------------------------- /libNeonCore/tests/unit/coreUt_io/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.19 FATAL_ERROR) 2 | 3 | file(GLOB_RECURSE SrcFiles src/*.*) 4 | 5 | add_executable(coreUt_io ${SrcFiles}) 6 | 7 | target_link_libraries(coreUt_io 8 | PUBLIC libNeonCore 9 | PUBLIC gtest_main) 10 | 11 | set_target_properties(coreUt_io PROPERTIES FOLDER "libNeonCore") 12 | source_group(TREE ${CMAKE_CURRENT_LIST_DIR} PREFIX "coreUt_io" FILES ${SrcFiles}) 13 | 14 | add_test(NAME coreUt_io COMMAND coreUt_io) -------------------------------------------------------------------------------- /libNeonCore/tests/unit/coreUt_io/src/coreUt_io.main.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include "gtest/gtest.h" 3 | 4 | int main(int argc, char** argv) 5 | { 6 | ::testing::InitGoogleTest(&argc, argv); 7 | return RUN_ALL_TESTS(); 8 | } 9 | -------------------------------------------------------------------------------- /libNeonCore/tests/unit/coreUt_logging/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.19 FATAL_ERROR) 2 | 3 | file(GLOB_RECURSE SrcFiles src/*.*) 4 | 5 | add_executable(coreUt_logging ${SrcFiles}) 6 | 7 | target_link_libraries(coreUt_logging 8 | PUBLIC libNeonCore 9 | PUBLIC gtest_main) 10 | 11 | set_target_properties(coreUt_logging PROPERTIES FOLDER "libNeonCore") 12 | source_group(TREE ${CMAKE_CURRENT_LIST_DIR} PREFIX "coreUt_logging" FILES ${SrcFiles}) 13 | 14 | add_test(NAME coreUt_logging COMMAND coreUt_logging) -------------------------------------------------------------------------------- /libNeonCore/tests/unit/coreUt_logging/src/testLogging.cpp: -------------------------------------------------------------------------------- 1 | #include "gtest/gtest.h" 2 | 3 | #include "Neon/core/tools/Logger.h" 4 | 5 | 6 | TEST(logging, trace) 7 | { 8 | NEON_TRACE("test trace message ..."); 9 | } 10 | 11 | TEST(logging, info) 12 | { 13 | NEON_INFO("test info message ..."); 14 | } 15 | 16 | TEST(logging, warning) 17 | { 18 | NEON_WARNING("test warning message ..."); 19 | } 20 | 21 | TEST(logging, error) 22 | { 23 | NEON_ERROR("test error message ..."); 24 | } 25 | 26 | TEST(logging, critical) 27 | { 28 | NEON_CRITICAL("test critical message ..."); 29 | } 30 | 31 | 32 | int main(int argc, char** argv) 33 | { 34 | ::testing::InitGoogleTest(&argc, argv); 35 | return RUN_ALL_TESTS(); 36 | } -------------------------------------------------------------------------------- /libNeonCore/tests/unit/coreUt_tools/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.19 FATAL_ERROR) 2 | 3 | file(GLOB_RECURSE SrcFiles src/*.*) 4 | 5 | add_executable(coreUt_tools ${SrcFiles}) 6 | 7 | target_link_libraries(coreUt_tools 8 | PUBLIC libNeonCore 9 | PUBLIC gtest_main) 10 | 11 | set_target_properties(coreUt_tools PROPERTIES FOLDER "libNeonCore") 12 | source_group(TREE ${CMAKE_CURRENT_LIST_DIR} PREFIX "coreUt_tools" FILES ${SrcFiles}) 13 | 14 | add_test(NAME coreUt_tools COMMAND coreUt_tools) -------------------------------------------------------------------------------- /libNeonCore/tests/unit/coreUt_tools/src/testTools.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include "gtest/gtest.h" 3 | 4 | #include "Neon/core/core.h" 5 | #include "Neon/core/tools/metaprogramming.h" 6 | 7 | #include 8 | #include 9 | #include 10 | 11 | namespace applyTupleTest { 12 | int fun(int a, std::vector b, float c) 13 | { 14 | for (auto&& el : b) { 15 | el = a - int(c); 16 | } 17 | return 33; 18 | } 19 | } // namespace applyTupleTest 20 | 21 | TEST(tools, applyTuple) 22 | { 23 | std::vector vals = {1, 2, 3, 4}; 24 | auto input = make_tuple(55, vals, float(3.0)); 25 | auto retval = Neon::meta::computeFunOnTuple(applyTupleTest::fun, input); 26 | 27 | ASSERT_TRUE(retval == 33); 28 | } 29 | 30 | 31 | int main(int argc, char** argv) 32 | { 33 | ::testing::InitGoogleTest(&argc, argv); 34 | return RUN_ALL_TESTS(); 35 | } 36 | -------------------------------------------------------------------------------- /libNeonCore/tests/unit/coreUt_tuple3d/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.19 FATAL_ERROR) 2 | 3 | file(GLOB_RECURSE SrcFiles src/*.*) 4 | 5 | add_executable(coreUt_tuple3d ${SrcFiles}) 6 | 7 | target_link_libraries(coreUt_tuple3d 8 | PUBLIC libNeonCore 9 | PUBLIC gtest_main) 10 | 11 | set_target_properties(coreUt_tuple3d PROPERTIES FOLDER "libNeonCore") 12 | source_group(TREE ${CMAKE_CURRENT_LIST_DIR} PREFIX "coreUt_tuple3d" FILES ${SrcFiles}) 13 | 14 | add_test(NAME coreUt_tuple3d COMMAND coreUt_tuple3d) -------------------------------------------------------------------------------- /libNeonDomain/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.19 FATAL_ERROR) 2 | 3 | file(GLOB_RECURSE libNeonDomainFiles include/*.* src/*.*) 4 | 5 | if (${BUILD_NEON_SHARED_LIBS}) 6 | add_library(libNeonDomain SHARED ${libNeonDomainFiles}) 7 | message( STATUS "Configuring libNeonDomain as a shared library...") 8 | set_target_properties(libNeonDomain PROPERTIES WINDOWS_EXPORT_ALL_SYMBOLS ON) 9 | else () 10 | add_library(libNeonDomain STATIC ${libNeonDomainFiles}) 11 | message( STATUS "Configuring libNeonDomain as a static library...") 12 | endif() 13 | 14 | target_link_libraries(libNeonDomain 15 | PUBLIC NeonDeveloperLib 16 | PUBLIC libNeonCore 17 | PUBLIC libNeonSys 18 | PUBLIC libNeonSet) 19 | 20 | include("${PROJECT_SOURCE_DIR}/cmake/ExportHeader.cmake") 21 | ExportHeader(libNeonSet) 22 | 23 | set_target_properties(libNeonDomain PROPERTIES 24 | CUDA_SEPARABLE_COMPILATION ON 25 | CUDA_RESOLVE_DEVICE_SYMBOLS ON) 26 | 27 | target_include_directories(libNeonDomain PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/include/") 28 | 29 | source_group(TREE ${CMAKE_CURRENT_LIST_DIR} PREFIX "libNeonDomain" FILES ${libNeonDomainFiles}) 30 | 31 | if (${BUILD_NEON_TESTING}) 32 | add_subdirectory("tests") 33 | endif() -------------------------------------------------------------------------------- /libNeonDomain/include/Neon/domain/Grids.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "Neon/domain/dGrid.h" 3 | #include "Neon/domain/aGrid.h" 4 | #include "Neon/domain/eGrid.h" 5 | #include "Neon/domain/bGrid.h" 6 | -------------------------------------------------------------------------------- /libNeonDomain/include/Neon/domain/StaggeredGrid.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "Neon/core/core.h" 3 | #include "Neon/domain/details/staggeredGrid/StaggeredGrid.h" 4 | 5 | namespace Neon::domain::experimental { 6 | template 7 | using StaggeredGrid = Neon::domain::details::experimental::staggeredGrid::StaggeredGrid; 8 | } -------------------------------------------------------------------------------- /libNeonDomain/include/Neon/domain/aGrid.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "Neon/domain/details/aGrid/aGrid.h" 3 | 4 | namespace Neon { 5 | using aGrid = Neon::domain::details::aGrid::aGrid; 6 | } -------------------------------------------------------------------------------- /libNeonDomain/include/Neon/domain/bGrid.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "Neon/domain/details/bGrid/bGrid.h" 3 | 4 | namespace Neon { 5 | using bGrid = Neon::domain::details::bGrid::bGrid>; 6 | } -------------------------------------------------------------------------------- /libNeonDomain/include/Neon/domain/dGrid.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "Neon/domain/details/dGrid/dGrid.h" 3 | 4 | 5 | namespace Neon { 6 | using dGrid = Neon::domain::details::dGrid::dGrid; 7 | } -------------------------------------------------------------------------------- /libNeonDomain/include/Neon/domain/details/aGrid/aFieldStorage_imp.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "aFieldStorage.h" 3 | 4 | namespace Neon::domain::details::aGrid { 5 | 6 | template 7 | Storage::Storage() 8 | { 9 | } 10 | 11 | template 12 | auto Storage::getPartition(Neon::Execution execution, 13 | Neon::DataView dataView, 14 | Neon::SetIdx setIdx) -> Partition& 15 | { 16 | return partitions[Neon::ExecutionUtils::toInt(execution)][Neon::DataViewUtil::toInt(dataView)][setIdx]; 17 | } 18 | 19 | template 20 | auto Storage::getPartition(Neon::Execution execution, 21 | Neon::DataView dataView, 22 | Neon::SetIdx setIdx) const -> const Partition& 23 | { 24 | return partitions[Neon::ExecutionUtils::toInt(execution)][Neon::DataViewUtil::toInt(dataView)][setIdx]; 25 | } 26 | 27 | 28 | template 29 | auto Storage::getPartitionSet(Neon::Execution execution, Neon::DataView dataView) -> Neon::set::DataSet& 30 | { 31 | return partitions[Neon::ExecutionUtils::toInt(execution)][Neon::DataViewUtil::toInt(dataView)]; 32 | } 33 | 34 | } // namespace Neon::domain::arrayNew::internal 35 | -------------------------------------------------------------------------------- /libNeonDomain/include/Neon/domain/details/aGrid/aIndex.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "Neon/core/core.h" 4 | 5 | namespace Neon::domain::details::aGrid { 6 | 7 | class aIndex 8 | { 9 | public: 10 | using OuterIdx = aIndex; 11 | 12 | template 14 | friend class aPartition; 15 | 16 | friend class aPartitionIndexSpace; 17 | friend class aGrid; 18 | 19 | // aGrid specific types 20 | using Location = int32_t; 21 | 22 | inline aIndex() = default; 23 | 24 | NEON_CUDA_HOST_DEVICE inline explicit aIndex(Location location); 25 | 26 | private: 27 | Location mLocation = 0; 28 | 29 | 30 | NEON_CUDA_HOST_DEVICE inline auto set() -> Location&; 31 | 32 | NEON_CUDA_HOST_DEVICE inline auto get() const -> const Location&; 33 | }; 34 | } // namespace Neon::domain::details::aGrid 35 | 36 | #include "Neon/domain/details/aGrid/aIndex_imp.h" 37 | -------------------------------------------------------------------------------- /libNeonDomain/include/Neon/domain/details/aGrid/aIndex_imp.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "Neon/core/core.h" 3 | 4 | namespace Neon::domain::details::aGrid { 5 | 6 | NEON_CUDA_HOST_DEVICE inline aIndex::aIndex(Location location) 7 | { 8 | mLocation = location; 9 | } 10 | 11 | NEON_CUDA_HOST_DEVICE inline auto aIndex::set() -> Location& 12 | { 13 | return mLocation; 14 | } 15 | 16 | NEON_CUDA_HOST_DEVICE inline auto aIndex::get() const -> const Location& 17 | { 18 | return mLocation; 19 | } 20 | 21 | } // namespace Neon::domain::details::aGrid -------------------------------------------------------------------------------- /libNeonDomain/include/Neon/domain/details/aGrid/aPartitionIndexSpace.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "Neon/set/DevSet.h" 3 | 4 | namespace Neon::domain::details::aGrid { 5 | 6 | /** 7 | * Abstraction that represents the Index space of a partition 8 | * This abstraction is used by the neon lambda executor to 9 | * run a containers on aGrid 10 | */ 11 | class aPartitionIndexSpace 12 | { 13 | public: 14 | 15 | using Cell = aIndex; 16 | static constexpr int SpaceDim = 1; 17 | 18 | inline aPartitionIndexSpace(); 19 | inline aPartitionIndexSpace(int nElements, 20 | Neon::DataView dataView); 21 | 22 | 23 | NEON_CUDA_HOST_DEVICE 24 | inline auto setAndValidate(Cell& e, 25 | const size_t& x, 26 | [[maybe_unused]] const size_t& y, 27 | [[maybe_unused]] const size_t& z) const -> bool; 28 | 29 | 30 | private: 31 | /** 32 | * Returns number of element in this partition 33 | * @return 34 | */ 35 | NEON_CUDA_HOST_DEVICE 36 | inline auto numElements() const -> int; 37 | 38 | int mNElements; 39 | Neon::DataView mDataView; 40 | }; 41 | 42 | } // namespace Neon::domain::array 43 | -------------------------------------------------------------------------------- /libNeonDomain/include/Neon/domain/details/bGrid/BlockView.h: -------------------------------------------------------------------------------- 1 | #include "Neon/domain/details/bGrid/BlockView/BlockViewGrid.h" 2 | #include "Neon/domain/tools/GridTransformer.h" 3 | 4 | namespace Neon::domain::details::bGrid { 5 | 6 | struct BlockView 7 | { 8 | public: 9 | using Grid = Neon::domain::tool::GridTransformer::Grid; 10 | template 11 | using Field = Grid::template Field; 12 | using index_3d = Neon::index_3d; 13 | 14 | template 15 | static auto helpGetReference(T* mem, const int idx, const int card) -> std::enable_if_t 16 | { 17 | return mem[idx * card]; 18 | } 19 | 20 | template 21 | static auto helpGetReference(T* mem, const int idx, const int card) -> std::enable_if_t 22 | { 23 | return mem[idx * C]; 24 | } 25 | 26 | static constexpr Neon::MemoryLayout layout = Neon::MemoryLayout::arrayOfStructs; 27 | }; 28 | 29 | } // namespace Neon::domain::details::bGrid -------------------------------------------------------------------------------- /libNeonDomain/include/Neon/domain/details/dGrid/dIndex_imp.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "Neon/core/core.h" 3 | 4 | namespace Neon::domain::details::dGrid { 5 | 6 | NEON_CUDA_HOST_DEVICE inline dIndex::dIndex(const Location& location) 7 | { 8 | mLocation = location; 9 | } 10 | 11 | NEON_CUDA_HOST_DEVICE inline dIndex::dIndex(const Location::Integer &x, 12 | const Location::Integer &y, 13 | const Location::Integer &z){ 14 | mLocation.x = x; 15 | mLocation.y = y; 16 | mLocation.z = z; 17 | } 18 | 19 | NEON_CUDA_HOST_DEVICE inline auto dIndex::set() -> Location& 20 | { 21 | return mLocation; 22 | } 23 | NEON_CUDA_HOST_DEVICE inline auto dIndex::get() const -> const Location& 24 | { 25 | return mLocation; 26 | } 27 | 28 | } // namespace Neon::domain::dense -------------------------------------------------------------------------------- /libNeonDomain/include/Neon/domain/details/eGrid/eIndex_imp.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "Neon/core/core.h" 3 | #include "Neon/domain/details/eGrid/eIndex.h" 4 | 5 | namespace Neon::domain::details::eGrid { 6 | 7 | NEON_CUDA_HOST_DEVICE eIndex::eIndex(const eIndex::InternalIdx& idx) 8 | { 9 | mIdx = idx; 10 | } 11 | 12 | NEON_CUDA_HOST_DEVICE inline auto eIndex::helpSet() -> InternalIdx& 13 | { 14 | return mIdx; 15 | } 16 | NEON_CUDA_HOST_DEVICE inline auto eIndex::helpGet() const -> const InternalIdx& 17 | { 18 | return mIdx; 19 | } 20 | NEON_CUDA_HOST_DEVICE inline auto eIndex::manualSet(eIndex::InternalIdx idx) -> void 21 | { 22 | mIdx = idx; 23 | } 24 | 25 | 26 | } // namespace Neon::domain::dense -------------------------------------------------------------------------------- /libNeonDomain/include/Neon/domain/details/eGrid/eSpan.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "Neon/set/DevSet.h" 3 | #include "eIndex.h" 4 | namespace Neon::domain::details::eGrid { 5 | /** 6 | * Abstraction that represents the Cell space of a partition 7 | * This abstraction is used by the neon lambda executor to 8 | * run a containers on aGrid 9 | */ 10 | class eSpan 11 | { 12 | friend class eGrid; 13 | 14 | public: 15 | using Idx = eIndex; 16 | static constexpr Neon::set::details::ExecutionThreadSpan executionThreadSpan = Neon::set::details::ExecutionThreadSpan::d1; 17 | using ExecutionThreadSpanIndexType = int32_t; 18 | 19 | NEON_CUDA_HOST_DEVICE 20 | inline auto setAndValidate(Idx& idx, 21 | const uint32_t& x) 22 | const 23 | -> bool; 24 | 25 | private: 26 | Idx::Offset mCount; 27 | Idx::Offset mFirstIndexOffset; 28 | Neon::DataView mDataView; 29 | }; 30 | 31 | } // namespace Neon::domain::details::eGrid 32 | 33 | #include "eSpan_imp.h" -------------------------------------------------------------------------------- /libNeonDomain/include/Neon/domain/details/eGrid/eSpan_imp.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "eSpan.h" 3 | 4 | namespace Neon::domain::details::eGrid { 5 | 6 | NEON_CUDA_HOST_DEVICE 7 | inline auto eSpan::setAndValidate( 8 | Idx& Idx, 9 | const uint32_t& x) 10 | const 11 | -> bool 12 | { 13 | Idx.helpSet() = Idx::InternalIdx(x); 14 | 15 | 16 | bool isValid = false; 17 | 18 | if (Idx.helpGet() < mCount) { 19 | isValid = true; 20 | Idx.mIdx += mFirstIndexOffset; 21 | } 22 | 23 | return isValid; 24 | } 25 | 26 | 27 | } // namespace Neon::domain::details::eGrid -------------------------------------------------------------------------------- /libNeonDomain/include/Neon/domain/details/haloUpdateType.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | namespace Neon { 3 | namespace domain { 4 | struct HaloUpdateMode_e 5 | { 6 | enum e 7 | { 8 | STANDARD, /** Typical update used by finite difference and finite element methods. A 3 component element is moved moved from one partition to another */ 9 | LATTICE, /** Typical update used by lattice type of computation (LBM for example). Only certen components of an elements are moved to a neighbour */ 10 | HALOUPDATEMODE_LEN /** Number of option in this enum */ 11 | }; 12 | 13 | HaloUpdateMode_e() = delete; 14 | HaloUpdateMode_e(const HaloUpdateMode_e&) = delete; 15 | HaloUpdateMode_e(HaloUpdateMode_e&&) = delete; 16 | static auto toString(e val); 17 | }; 18 | } // namespace grids 19 | } // namespace Neon -------------------------------------------------------------------------------- /libNeonDomain/include/Neon/domain/details/sGrid/sCell_imp.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "Neon/core/core.h" 3 | #include "Neon/domain/details/sGrid/sIndex.h" 4 | 5 | namespace Neon::domain::details::sGrid { 6 | 7 | NEON_CUDA_HOST_DEVICE inline sIndex::sIndex(Location location) 8 | { 9 | mLocation = location; 10 | } 11 | 12 | NEON_CUDA_HOST_DEVICE inline auto sIndex::get() -> Location& 13 | { 14 | return mLocation; 15 | } 16 | 17 | NEON_CUDA_HOST_DEVICE inline auto sIndex::get() const -> const Location& 18 | { 19 | return mLocation; 20 | } 21 | } // namespace Neon::domain::details::sGrid -------------------------------------------------------------------------------- /libNeonDomain/include/Neon/domain/details/staggeredGrid/node/NodeGeneric_imp.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "NodeGeneric.h" 4 | 5 | namespace Neon::domain::details::experimental::staggeredGrid::details { 6 | 7 | template 8 | NodeGeneric::NodeGeneric(const typename BuildingBlocks::Cell::Location& location) 9 | { 10 | mBuildingBlockCell = BuildingBlocks::Cell(location); 11 | } 12 | 13 | template 14 | inline auto 15 | NodeGeneric:: 16 | getBuildingBlockCell() 17 | -> typename BuildingBlocks::Cell& 18 | { 19 | return mBuildingBlockCell; 20 | } 21 | 22 | 23 | template 24 | NEON_CUDA_HOST_DEVICE 25 | inline auto 26 | NodeGeneric:: 27 | getBuildingBlockCell() 28 | const-> const typename BuildingBlocks::Cell& 29 | { 30 | return mBuildingBlockCell; 31 | } 32 | 33 | } // namespace Neon::domain::details::experimental::staggeredGrid::details 34 | -------------------------------------------------------------------------------- /libNeonDomain/include/Neon/domain/details/staggeredGrid/node/NodePartitionIndexSpace_imp.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "Neon/core/core.h" 4 | #include "NodeGeneric.h" 5 | #include "NodePartitionIndexSpace.h" 6 | 7 | namespace Neon::domain::details::experimental::staggeredGrid::details { 8 | 9 | 10 | template 11 | inline auto NodePartitionIndexSpace:: 12 | setAndValidate(Cell& cell, 13 | const size_t& x, 14 | [[maybe_unused]] const size_t& y, 15 | [[maybe_unused]] const size_t& z) 16 | const -> bool 17 | { 18 | return mBuildingBlocksPIdxSpace.setAndValidate(cell.getBuildingBlockCell(), x, y, z); 19 | } 20 | 21 | template 22 | NodePartitionIndexSpace:: 23 | NodePartitionIndexSpace(const typename BuildingBlocks::PartitionIndexSpace& pixs) 24 | { 25 | mBuildingBlocksPIdxSpace = pixs; 26 | } 27 | 28 | } // namespace Neon::domain::details::experimental::staggeredGrid::details 29 | -------------------------------------------------------------------------------- /libNeonDomain/include/Neon/domain/details/staggeredGrid/voxel/VoxelGeneric_imp.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "VoxelGeneric.h" 4 | 5 | namespace Neon::domain::details::experimental::staggeredGrid::details { 6 | 7 | template 8 | VoxelGeneric:: 9 | VoxelGeneric(const typename BuildingBlocks::Cell::Location& location) 10 | { 11 | mBuildingBlockCell = BuildingBlocks::Cell(location); 12 | } 13 | 14 | template 15 | inline auto 16 | VoxelGeneric:: 17 | getBuildingBlockCell() 18 | -> typename BuildingBlocks::Cell& 19 | { 20 | return mBuildingBlockCell; 21 | } 22 | 23 | template 24 | NEON_CUDA_HOST_DEVICE inline auto 25 | VoxelGeneric:: 26 | getBuildingBlockCell() 27 | const -> const typename BuildingBlocks::Cell& 28 | { 29 | return mBuildingBlockCell; 30 | } 31 | 32 | } // namespace Neon::domain::details::experimental::staggeredGrid::details 33 | -------------------------------------------------------------------------------- /libNeonDomain/include/Neon/domain/eGrid.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "Neon/domain/details/eGrid/eGrid.h" 3 | 4 | 5 | namespace Neon { 6 | using eGrid = Neon::domain::details::eGrid::eGrid; 7 | } -------------------------------------------------------------------------------- /libNeonDomain/include/Neon/domain/interface/GridBase_imp.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "Neon/set/DevSet.h" 3 | 4 | namespace Neon::domain::interface { 5 | 6 | template 7 | auto GridBase::newDataSet() const -> const Neon::set::DataSet 8 | { 9 | auto dataSet = getBackend().devSet().template newDataSet(); 10 | return dataSet; 11 | } 12 | 13 | } // namespace Neon::domain::interface 14 | -------------------------------------------------------------------------------- /libNeonDomain/include/Neon/domain/interface/GridConcept.h: -------------------------------------------------------------------------------- 1 | #if 0 2 | 3 | #pragma once 4 | 5 | #include "Neon/core/core.h" 6 | 7 | namespace Neon::domain { 8 | 9 | template 10 | concept SparsityPattern = requires(SP sparsityPattern) { 11 | { 12 | sparsityPattern(Neon::index_3d(0, 0, 0)) 13 | } -> std::same_as; 14 | }; 15 | 16 | template 17 | concept Grid = requires(G grid) { 18 | { 19 | grid.template newField("fieldName", 20 | int(0), 21 | int(0), 22 | Neon::DataUse::HOST_DEVICE, 23 | Neon::MemoryOptions()) 24 | } -> std::same_as>; 25 | }; 26 | 27 | 28 | } // namespace Neon::domain 29 | 30 | namespace Neon { 31 | 32 | 33 | template 34 | concept Field = requires(F grid) { 35 | typename F::NghData; 36 | typename F::NghIdx; 37 | typename F::Idx; 38 | typename F::Type; 39 | }; 40 | } 41 | 42 | #endif 43 | -------------------------------------------------------------------------------- /libNeonDomain/include/Neon/domain/interface/NghData.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "Neon/core/core.h" 4 | 5 | namespace Neon { 6 | namespace domain { 7 | 8 | template 9 | struct NghData 10 | { 11 | Type mData; 12 | bool mIsValid; 13 | NEON_CUDA_HOST_DEVICE NghData(bool status = false) 14 | { 15 | this->mIsValid = false; 16 | } 17 | 18 | NEON_CUDA_HOST_DEVICE NghData(const Type& val, bool status) 19 | { 20 | this->mData = val; 21 | this->mIsValid = status; 22 | } 23 | 24 | NEON_CUDA_HOST_DEVICE void set(const Type& val_, bool status_) 25 | { 26 | this->mData = val_; 27 | this->mIsValid = status_; 28 | } 29 | 30 | NEON_CUDA_HOST_DEVICE void invalidate() 31 | { 32 | this->mIsValid = false; 33 | } 34 | 35 | NEON_CUDA_HOST_DEVICE auto isValid() const -> bool 36 | { 37 | return mIsValid; 38 | } 39 | 40 | NEON_CUDA_HOST_DEVICE auto getData() const -> const Type& 41 | { 42 | return mData; 43 | } 44 | 45 | NEON_CUDA_HOST_DEVICE auto operator()() const -> const Type& 46 | { 47 | return mData; 48 | } 49 | }; 50 | } // namespace domain 51 | } // namespace Neon -------------------------------------------------------------------------------- /libNeonDomain/include/Neon/domain/interface/common.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "Neon/core/core.h" 4 | 5 | namespace Neon { 6 | namespace domain { 7 | 8 | struct haloStatus_et 9 | { 10 | enum e 11 | { 12 | ON, 13 | OFF 14 | }; 15 | }; 16 | 17 | 18 | } // namespace grids 19 | } // namespace Neon 20 | -------------------------------------------------------------------------------- /libNeonDomain/include/Neon/domain/mGrid.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "Neon/domain/details/mGrid/mGrid.h" 4 | 5 | namespace Neon::domain { 6 | using mGrid = Neon::domain::details::mGrid::mGrid; 7 | } -------------------------------------------------------------------------------- /libNeonDomain/include/Neon/domain/sGrid.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "Neon/domain/details/sGrid/sGrid.h" 3 | 4 | namespace Neon::domain { 5 | template 6 | using sGrid = Neon::domain::details::sGrid::sGrid; 7 | } -------------------------------------------------------------------------------- /libNeonDomain/src/domain/details/bGrid/bGrid.cpp: -------------------------------------------------------------------------------- 1 | #include "Neon/domain/details/bGrid/bGrid.h" 2 | 3 | namespace Neon::domain::details::bGrid { 4 | 5 | 6 | template class bGrid>; 7 | 8 | } // namespace Neon::domain::details::bGrid -------------------------------------------------------------------------------- /libNeonDomain/src/domain/details/haloUpdateType.cpp: -------------------------------------------------------------------------------- 1 | #include "Neon/domain/details/haloUpdateType.h" 2 | #include "Neon/core/core.h" 3 | 4 | namespace Neon { 5 | namespace domain { 6 | auto HaloUpdateMode_e::toString(e val) 7 | { 8 | switch (val) { 9 | case STANDARD: 10 | return "STANDARD"; 11 | case LATTICE: 12 | return "LATTICE"; 13 | case HALOUPDATEMODE_LEN: 14 | return "HALOUPDATEMODE_LEN"; 15 | default: 16 | NEON_THROW_UNSUPPORTED_OPTION(""); 17 | } 18 | } 19 | 20 | 21 | } // namespace grids 22 | } // namespace Neon -------------------------------------------------------------------------------- /libNeonDomain/src/domain/patterns/PatternScalar.cpp: -------------------------------------------------------------------------------- 1 | #include "Neon/domain/patterns/PatternScalar.h" 2 | 3 | namespace Neon { 4 | template class PatternScalar; 5 | template class PatternScalar; 6 | } // namespace Neon -------------------------------------------------------------------------------- /libNeonDomain/src/domain/tools/Partitioner1D.cpp: -------------------------------------------------------------------------------- 1 | #include "Neon/domain/tools/Partitioner1D.h" 2 | 3 | namespace Neon::domain::tool { 4 | 5 | 6 | auto Partitioner1D::getSpanClassifier() 7 | const -> partitioning::SpanClassifier const& 8 | { 9 | return *(mData->mSpanClassifier); 10 | } 11 | 12 | auto Partitioner1D::getSpanLayout() 13 | const -> partitioning::SpanLayout const& 14 | { 15 | return *(mData->mSpanLayout); 16 | } 17 | 18 | auto Partitioner1D::getDecomposition() const -> partitioning::SpanDecomposition const& 19 | { 20 | return *(mData->spanDecomposition.get()); 21 | } 22 | 23 | } // namespace Neon::domain::tools -------------------------------------------------------------------------------- /libNeonDomain/src/domain/tools/TestData.cpp: -------------------------------------------------------------------------------- 1 | #include "Neon/domain/tools/TestData.h" 2 | 3 | namespace Neon::domain::tool::testing { 4 | 5 | auto FieldNamesUtils::toString(FieldNames name) -> std::string 6 | { 7 | switch (name) { 8 | case FieldNames::X: 9 | return "X"; 10 | case FieldNames::Y: 11 | return "Y"; 12 | case FieldNames::Z: 13 | return "Z"; 14 | case FieldNames::W: 15 | return "W"; 16 | } 17 | NEON_THROW_UNSUPPORTED_OPTION(""); 18 | } 19 | 20 | auto FieldNamesUtils::toInt(FieldNames name) -> int 21 | { 22 | return static_cast(name); 23 | } 24 | 25 | auto FieldNamesUtils::fromInt(int id) -> FieldNames 26 | { 27 | if (toInt(FieldNames::X) == id) 28 | return FieldNames::X; 29 | if (toInt(FieldNames::Y) == id) 30 | return FieldNames::Y; 31 | if (toInt(FieldNames::Z) == id) 32 | return FieldNames::Z; 33 | if (toInt(FieldNames::W) == id) 34 | return FieldNames::W; 35 | 36 | NEON_THROW_UNSUPPORTED_OPTION(""); 37 | } 38 | 39 | } // namespace Neon::grid::tool::testing 40 | -------------------------------------------------------------------------------- /libNeonDomain/src/domain/tools/partitioning/SpanDecomposition.cpp: -------------------------------------------------------------------------------- 1 | #include "Neon/domain/tools/partitioning/SpanDecomposition.h" 2 | 3 | namespace Neon::domain::tool::partitioning { 4 | 5 | auto SpanDecomposition::getNumBlockPerPartition() const -> const Neon::set::DataSet& 6 | { 7 | return mNumBlocks; 8 | } 9 | 10 | auto SpanDecomposition::getFirstZSliceIdx() const -> const Neon::set::DataSet& 11 | { 12 | return mZFirstIdx; 13 | } 14 | 15 | auto SpanDecomposition::getLastZSliceIdx() const -> const Neon::set::DataSet& 16 | { 17 | return mZLastIdx; 18 | } 19 | auto SpanDecomposition::toString(Neon::Backend const& bk) const -> std::string 20 | { 21 | std::stringstream s; 22 | bk.forEachDeviceSeq([&](Neon::SetIdx const& setIdx) { 23 | s << "\t" << setIdx << " blocks: " << this->getNumBlockPerPartition()[setIdx] 24 | << " first z " << this->getFirstZSliceIdx()[setIdx] 25 | << " last z " << this->getLastZSliceIdx()[setIdx] 26 | << " count " << this->getLastZSliceIdx()[setIdx] - this->getFirstZSliceIdx()[setIdx] + 1 << "\n"; 27 | }); 28 | return s.str(); 29 | } 30 | 31 | } // namespace Neon::domain::tool::partitioning -------------------------------------------------------------------------------- /libNeonDomain/tests/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.19 FATAL_ERROR) 2 | 3 | add_subdirectory("domain-globalIdx") 4 | add_subdirectory("domain-host-containers") 5 | add_subdirectory("domain-map") 6 | add_subdirectory("domain-neighbour-globalIdx") 7 | add_subdirectory("domain-halos") 8 | add_subdirectory("domain-stencil") 9 | add_subdirectory("domain-bGrid-tray") 10 | 11 | add_subdirectory("domainUt_sGrid") 12 | add_subdirectory("domain-unit-test-eGrid") 13 | add_subdirectory("domain-unit-test-gridInterface") 14 | # add_subdirectory("domain-unit-test-cast") 15 | add_subdirectory("domain-unit-test-patterns-containers") 16 | 17 | # add_subdirectory("gUt_dataView_patterns") 18 | add_subdirectory("domainUt_swap") 19 | # add_subdirectory("domain-unit-test-staggered-grid") 20 | add_subdirectory("gUt_tools") 21 | add_subdirectory("gUt_vtk") 22 | add_subdirectory("gUt_mGrid") 23 | 24 | -------------------------------------------------------------------------------- /libNeonDomain/tests/domain-bGrid-tray/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.19 FATAL_ERROR) 2 | 3 | set(APP_NAME domain-bGrid-tray) 4 | file(GLOB_RECURSE SrcFiles src/*.*) 5 | 6 | add_executable(${APP_NAME} ${SrcFiles}) 7 | 8 | target_link_libraries(${APP_NAME} 9 | PUBLIC libNeonDomain 10 | PUBLIC gtest_main) 11 | 12 | set_target_properties(${APP_NAME} PROPERTIES 13 | CUDA_SEPARABLE_COMPILATION ON 14 | CUDA_RESOLVE_DEVICE_SYMBOLS ON) 15 | 16 | set_target_properties(${APP_NAME} PROPERTIES FOLDER "libNeonDomain") 17 | source_group(TREE ${CMAKE_CURRENT_LIST_DIR} PREFIX "${APP_NAME}" FILES ${SrcFiles}) 18 | 19 | add_test(NAME ${APP_NAME} COMMAND ${APP_NAME}) -------------------------------------------------------------------------------- /libNeonDomain/tests/domain-globalIdx/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.19 FATAL_ERROR) 2 | 3 | set(APP_NAME domain-globalIdx) 4 | file(GLOB_RECURSE SrcFiles src/*.*) 5 | 6 | add_executable(${APP_NAME} ${SrcFiles}) 7 | 8 | target_link_libraries(${APP_NAME} 9 | PUBLIC libNeonDomain 10 | PUBLIC gtest_main) 11 | 12 | set_target_properties(${APP_NAME} PROPERTIES 13 | CUDA_SEPARABLE_COMPILATION ON 14 | CUDA_RESOLVE_DEVICE_SYMBOLS ON) 15 | 16 | set_target_properties(${APP_NAME} PROPERTIES FOLDER "libNeonDomain") 17 | source_group(TREE ${CMAKE_CURRENT_LIST_DIR} PREFIX "${APP_NAME}" FILES ${SrcFiles}) 18 | 19 | add_test(NAME ${APP_NAME} COMMAND ${APP_NAME}) -------------------------------------------------------------------------------- /libNeonDomain/tests/domain-globalIdx/src/TestInformation.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | namespace { 3 | struct TestInformation 4 | { 5 | static auto prefix() 6 | -> std::string 7 | { 8 | return "domain-unit-test-map"; 9 | } 10 | 11 | static auto fullName(const std::string& gridName) 12 | -> std::string 13 | { 14 | return prefix() + "-" + gridName; 15 | } 16 | }; 17 | } // namespace -------------------------------------------------------------------------------- /libNeonDomain/tests/domain-globalIdx/src/globalIdx.h: -------------------------------------------------------------------------------- 1 | 2 | #pragma once 3 | #include 4 | 5 | #include "Neon/domain/Grids.h" 6 | #include "Neon/domain/tools/TestData.h" 7 | 8 | 9 | namespace globalIdx { 10 | using namespace Neon::domain::tool::testing; 11 | 12 | template 13 | auto run(TestData& data) -> void; 14 | 15 | extern template auto run(TestData&) -> void; 16 | extern template auto run(TestData&) -> void; 17 | extern template auto run(TestData&) -> void; 18 | 19 | 20 | } // namespace map 21 | -------------------------------------------------------------------------------- /libNeonDomain/tests/domain-globalIdx/src/gtests.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include "Neon/Neon.h" 3 | #include "gtest/gtest.h" 4 | #include "globalIdx.h" 5 | #include "runHelper.h" 6 | 7 | TEST(domain_unit_test_globalIdx, dGrid) 8 | { 9 | int nGpus = 3; 10 | using Type = int64_t; 11 | runAllTestConfiguration(std::function(globalIdx::run), 12 | nGpus, 13 | 1); 14 | } 15 | 16 | TEST(domain_unit_test_globalIdx, eGrid) 17 | { 18 | int nGpus = 3; 19 | using Type = int64_t; 20 | runAllTestConfiguration(std::function(globalIdx::run), 21 | nGpus, 22 | 1); 23 | } 24 | 25 | TEST(domain_unit_test_globalIdx, bGrid) 26 | { 27 | int nGpus = 3; 28 | using Type = int64_t; 29 | runAllTestConfiguration(std::function(globalIdx::run), 30 | nGpus, 31 | 1); 32 | } 33 | 34 | int main(int argc, char** argv) 35 | { 36 | ::testing::InitGoogleTest(&argc, argv); 37 | Neon::init(); 38 | return RUN_ALL_TESTS(); 39 | } 40 | -------------------------------------------------------------------------------- /libNeonDomain/tests/domain-halos/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.19 FATAL_ERROR) 2 | 3 | set(APP_NAME domain-halos) 4 | 5 | file(GLOB_RECURSE SrcFiles src/*.*) 6 | add_executable(${APP_NAME} ${SrcFiles}) 7 | 8 | set_target_properties(${APP_NAME} PROPERTIES 9 | CUDA_SEPARABLE_COMPILATION ON 10 | CUDA_RESOLVE_DEVICE_SYMBOLS ON) 11 | 12 | target_link_libraries(${APP_NAME} 13 | PUBLIC libNeonDomain 14 | PUBLIC gtest_main) 15 | 16 | set_target_properties(${APP_NAME} PROPERTIES FOLDER "libNeonDomain") 17 | source_group(TREE ${CMAKE_CURRENT_LIST_DIR} PREFIX ${APP_NAME} FILES ${SrcFiles}) 18 | 19 | 20 | add_test(NAME ${APP_NAME} COMMAND ${APP_NAME}) 21 | 22 | -------------------------------------------------------------------------------- /libNeonDomain/tests/domain-halos/src/TestInformation.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | namespace { 3 | struct TestInformation 4 | { 5 | static auto prefix() 6 | -> std::string 7 | { 8 | return "domain-unit-test-map"; 9 | } 10 | 11 | static auto fullName(const std::string& gridName) 12 | -> std::string 13 | { 14 | return prefix() + "-" + gridName; 15 | } 16 | }; 17 | } // namespace -------------------------------------------------------------------------------- /libNeonDomain/tests/domain-halos/src/gtests.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include "Neon/Neon.h" 3 | #include "gtest/gtest.h" 4 | #include "halos.h" 5 | #include "runHelper.h" 6 | 7 | TEST(domain_unit_test_halos, dGrid) 8 | { 9 | int nGpus = 3; 10 | using Type = int64_t; 11 | runAllTestConfiguration(std::function(map::run), 12 | nGpus, 13 | 1); 14 | } 15 | 16 | TEST(domain_unit_test_halos, eGrid) 17 | { 18 | int nGpus = 3; 19 | using Type = int64_t; 20 | runAllTestConfiguration(std::function(map::run), 21 | nGpus, 22 | 1); 23 | } 24 | 25 | int main(int argc, char** argv) 26 | { 27 | ::testing::InitGoogleTest(&argc, argv); 28 | Neon::init(); 29 | return RUN_ALL_TESTS(); 30 | } 31 | -------------------------------------------------------------------------------- /libNeonDomain/tests/domain-halos/src/halos.h: -------------------------------------------------------------------------------- 1 | 2 | #pragma once 3 | #include 4 | #include "Neon/domain/Grids.h" 5 | 6 | #include "Neon/domain/tools/TestData.h" 7 | 8 | 9 | 10 | namespace map { 11 | using namespace Neon::domain::tool::testing; 12 | 13 | template 14 | auto run(TestData& data) -> void; 15 | 16 | extern template auto run(TestData&) -> void; 17 | extern template auto run(TestData&) -> void; 18 | 19 | } // namespace map 20 | -------------------------------------------------------------------------------- /libNeonDomain/tests/domain-host-containers/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.19 FATAL_ERROR) 2 | 3 | file(GLOB_RECURSE SrcFiles src/*.*) 4 | 5 | add_executable(domain-host-containers ${SrcFiles}) 6 | 7 | target_link_libraries(domain-host-containers 8 | PUBLIC libNeonDomain 9 | PUBLIC gtest_main) 10 | 11 | set_target_properties(domain-host-containers PROPERTIES 12 | CUDA_SEPARABLE_COMPILATION ON 13 | CUDA_RESOLVE_DEVICE_SYMBOLS ON) 14 | set_target_properties(domain-host-containers PROPERTIES FOLDER "libNeonDomain") 15 | source_group(TREE ${CMAKE_CURRENT_LIST_DIR} PREFIX "domain-host-containers" FILES ${SrcFiles}) 16 | 17 | add_test(NAME domain-host-containers COMMAND domain-host-containers) -------------------------------------------------------------------------------- /libNeonDomain/tests/domain-host-containers/src/TestInformation.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | namespace { 3 | struct TestInformation 4 | { 5 | static auto prefix() 6 | -> std::string 7 | { 8 | return "domain-unit-test-map"; 9 | } 10 | 11 | static auto fullName(const std::string& gridName) 12 | -> std::string 13 | { 14 | return prefix() + "-" + gridName; 15 | } 16 | }; 17 | } // namespace -------------------------------------------------------------------------------- /libNeonDomain/tests/domain-host-containers/src/gtests.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include "Neon/Neon.h" 3 | #include "gtest/gtest.h" 4 | #include "hostContainer.h" 5 | #include "runHelper.h" 6 | 7 | TEST(domain_hostContainter, dGrid) 8 | { 9 | int nGpus = 3; 10 | using Type = int64_t; 11 | runAllTestConfiguration(std::function(hostContainer::run), 12 | nGpus, 13 | 1); 14 | } 15 | 16 | TEST(domain_hostContainter, eGrid) 17 | { 18 | int nGpus = 3; 19 | using Type = int64_t; 20 | runAllTestConfiguration(std::function(hostContainer::run), 21 | nGpus, 22 | 1); 23 | } 24 | 25 | TEST(domain_hostContainter, bGrid) 26 | { 27 | int nGpus = 3; 28 | using Type = int64_t; 29 | runAllTestConfiguration(std::function(hostContainer::run), 30 | nGpus, 31 | 1); 32 | } 33 | 34 | int main(int argc, char** argv) 35 | { 36 | ::testing::InitGoogleTest(&argc, argv); 37 | Neon::init(); 38 | return RUN_ALL_TESTS(); 39 | } 40 | -------------------------------------------------------------------------------- /libNeonDomain/tests/domain-host-containers/src/hostContainer.h: -------------------------------------------------------------------------------- 1 | 2 | #pragma once 3 | #include 4 | 5 | #include "Neon/domain/Grids.h" 6 | #include "Neon/domain/tools/TestData.h" 7 | 8 | 9 | namespace hostContainer { 10 | using namespace Neon::domain::tool::testing; 11 | 12 | template 13 | auto run(TestData& data) -> void; 14 | 15 | extern template auto run(TestData&) -> void; 16 | extern template auto run(TestData&) -> void; 17 | extern template auto run(TestData&) -> void; 18 | 19 | 20 | } // namespace map 21 | -------------------------------------------------------------------------------- /libNeonDomain/tests/domain-map/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.19 FATAL_ERROR) 2 | 3 | file(GLOB_RECURSE SrcFiles src/*.*) 4 | 5 | add_executable(domain-map ${SrcFiles}) 6 | 7 | target_link_libraries(domain-map 8 | PUBLIC libNeonDomain 9 | PUBLIC gtest_main) 10 | 11 | set_target_properties(domain-map PROPERTIES 12 | CUDA_SEPARABLE_COMPILATION ON 13 | CUDA_RESOLVE_DEVICE_SYMBOLS ON) 14 | set_target_properties(domain-map PROPERTIES FOLDER "libNeonDomain") 15 | source_group(TREE ${CMAKE_CURRENT_LIST_DIR} PREFIX "domain-map" FILES ${SrcFiles}) 16 | 17 | add_test(NAME domain-map COMMAND domain-map) -------------------------------------------------------------------------------- /libNeonDomain/tests/domain-map/src/TestInformation.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | namespace { 3 | struct TestInformation 4 | { 5 | static auto prefix() 6 | -> std::string 7 | { 8 | return "domain-unit-test-map"; 9 | } 10 | 11 | static auto fullName(const std::string& gridName) 12 | -> std::string 13 | { 14 | return prefix() + "-" + gridName; 15 | } 16 | }; 17 | } // namespace -------------------------------------------------------------------------------- /libNeonDomain/tests/domain-map/src/gtests.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include "Neon/Neon.h" 3 | #include "gtest/gtest.h" 4 | #include "map.h" 5 | #include "runHelper.h" 6 | 7 | TEST(domain_map, dGrid) 8 | { 9 | int nGpus = 3; 10 | using Type = int64_t; 11 | runAllTestConfiguration(std::function(map::run), 12 | nGpus, 13 | 1); 14 | } 15 | 16 | TEST(domain_map, eGrid) 17 | { 18 | int nGpus = 3; 19 | using Type = int64_t; 20 | runAllTestConfiguration(std::function(map::run), 21 | nGpus, 22 | 1); 23 | } 24 | 25 | TEST(domain_map, bGrid) 26 | { 27 | int nGpus = 1; 28 | using Type = int64_t; 29 | runAllTestConfiguration(std::function(map::run), 30 | nGpus, 31 | 1); 32 | } 33 | 34 | int main(int argc, char** argv) 35 | { 36 | ::testing::InitGoogleTest(&argc, argv); 37 | Neon::init(); 38 | return RUN_ALL_TESTS(); 39 | } 40 | -------------------------------------------------------------------------------- /libNeonDomain/tests/domain-map/src/map.h: -------------------------------------------------------------------------------- 1 | 2 | #pragma once 3 | #include 4 | 5 | #include "Neon/domain/Grids.h" 6 | #include "Neon/domain/tools/TestData.h" 7 | 8 | 9 | namespace map { 10 | using namespace Neon::domain::tool::testing; 11 | 12 | template 13 | auto run(TestData& data) -> void; 14 | 15 | extern template auto run(TestData&) -> void; 16 | extern template auto run(TestData&) -> void; 17 | 18 | 19 | } // namespace map 20 | -------------------------------------------------------------------------------- /libNeonDomain/tests/domain-neighbour-globalIdx/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.19 FATAL_ERROR) 2 | 3 | set(APP_NAME domain-neighbour-globalIdx) 4 | file(GLOB_RECURSE SrcFiles src/*.*) 5 | 6 | add_executable(${APP_NAME} ${SrcFiles}) 7 | 8 | target_link_libraries(${APP_NAME} 9 | PUBLIC libNeonDomain 10 | PUBLIC gtest_main) 11 | 12 | set_target_properties(${APP_NAME} PROPERTIES 13 | CUDA_SEPARABLE_COMPILATION ON 14 | CUDA_RESOLVE_DEVICE_SYMBOLS ON) 15 | 16 | set_target_properties(${APP_NAME} PROPERTIES FOLDER "libNeonDomain") 17 | source_group(TREE ${CMAKE_CURRENT_LIST_DIR} PREFIX "${APP_NAME}" FILES ${SrcFiles}) 18 | 19 | add_test(NAME ${APP_NAME} COMMAND ${APP_NAME}) -------------------------------------------------------------------------------- /libNeonDomain/tests/domain-neighbour-globalIdx/src/TestInformation.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | namespace { 3 | struct TestInformation 4 | { 5 | static auto prefix() 6 | -> std::string 7 | { 8 | return "domain-unit-test-map"; 9 | } 10 | 11 | static auto fullName(const std::string& gridName) 12 | -> std::string 13 | { 14 | return prefix() + "-" + gridName; 15 | } 16 | }; 17 | } // namespace -------------------------------------------------------------------------------- /libNeonDomain/tests/domain-neighbour-globalIdx/src/gtests.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include "Neon/Neon.h" 3 | #include "gtest/gtest.h" 4 | #include "./testsAndContainers.h" 5 | #include "runHelper.h" 6 | 7 | TEST(domain_unit_test_globalIdx, dGrid) 8 | { 9 | int nGpus = 5; 10 | using Type = int64_t; 11 | runAllTestConfiguration(std::function(globalIdx::run), 12 | nGpus, 13 | 1); 14 | } 15 | 16 | TEST(domain_unit_test_globalIdx, eGrid) 17 | { 18 | int nGpus = 5; 19 | using Type = int64_t; 20 | runAllTestConfiguration(std::function(globalIdx::run), 21 | nGpus, 22 | 1); 23 | } 24 | 25 | TEST(domain_unit_test_globalIdx, bGrid) 26 | { 27 | int nGpus = 5; 28 | using Type = int64_t; 29 | runAllTestConfiguration(std::function(globalIdx::run), 30 | nGpus, 31 | 1); 32 | } 33 | 34 | int main(int argc, char** argv) 35 | { 36 | ::testing::InitGoogleTest(&argc, argv); 37 | Neon::init(); 38 | return RUN_ALL_TESTS(); 39 | } 40 | -------------------------------------------------------------------------------- /libNeonDomain/tests/domain-neighbour-globalIdx/src/testsAndContainers.h: -------------------------------------------------------------------------------- 1 | 2 | #pragma once 3 | #include 4 | 5 | #include "Neon/domain/Grids.h" 6 | #include "Neon/domain/tools/TestData.h" 7 | 8 | 9 | namespace globalIdx { 10 | using namespace Neon::domain::tool::testing; 11 | 12 | template 13 | auto run(TestData& data) -> void; 14 | 15 | extern template auto run(TestData&) -> void; 16 | extern template auto run(TestData&) -> void; 17 | extern template auto run(TestData&) -> void; 18 | 19 | 20 | } // namespace map 21 | -------------------------------------------------------------------------------- /libNeonDomain/tests/domain-stencil/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.19 FATAL_ERROR) 2 | 3 | set(APP_NAME domain-stencil) 4 | 5 | file(GLOB_RECURSE SrcFiles src/*.*) 6 | add_executable(${APP_NAME} ${SrcFiles}) 7 | 8 | set_target_properties(${APP_NAME} PROPERTIES 9 | CUDA_SEPARABLE_COMPILATION ON 10 | CUDA_RESOLVE_DEVICE_SYMBOLS ON) 11 | 12 | target_link_libraries(${APP_NAME} 13 | PUBLIC libNeonDomain 14 | PUBLIC gtest_main) 15 | 16 | set_target_properties(${APP_NAME} PROPERTIES FOLDER "libNeonDomain") 17 | source_group(TREE ${CMAKE_CURRENT_LIST_DIR} PREFIX ${APP_NAME} FILES ${SrcFiles}) 18 | 19 | 20 | add_test(NAME ${APP_NAME} COMMAND ${APP_NAME}) 21 | 22 | -------------------------------------------------------------------------------- /libNeonDomain/tests/domain-stencil/src/TestInformation.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | namespace { 3 | struct TestInformation 4 | { 5 | static auto prefix() 6 | -> std::string 7 | { 8 | return "domain-unit-test-map"; 9 | } 10 | 11 | static auto fullName(const std::string& gridName) 12 | -> std::string 13 | { 14 | return prefix() + "-" + gridName; 15 | } 16 | }; 17 | } // namespace -------------------------------------------------------------------------------- /libNeonDomain/tests/domain-stencil/src/gtests.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include "Neon/Neon.h" 3 | #include "gtest/gtest.h" 4 | #include "runHelper.h" 5 | #include "stencil.h" 6 | 7 | TEST(domain_stencil, dGrid) 8 | { 9 | int nGpus = 3; 10 | using Type = int64_t; 11 | runAllTestConfiguration(std::function(map::run), 12 | nGpus, 13 | 1); 14 | } 15 | 16 | TEST(domain_stencil, eGrid) 17 | { 18 | int nGpus = 3; 19 | using Type = int64_t; 20 | runAllTestConfiguration(std::function(map::run), 21 | nGpus, 22 | 1); 23 | } 24 | 25 | TEST(domain_stencil, bGri ) 26 | { 27 | int nGpus = 5; 28 | using Type = int64_t; 29 | runAllTestConfiguration(std::function(map::run), 30 | nGpus, 31 | 1); 32 | } 33 | 34 | int main(int argc, char** argv) 35 | { 36 | ::testing::InitGoogleTest(&argc, argv); 37 | Neon::init(); 38 | return RUN_ALL_TESTS(); 39 | } 40 | -------------------------------------------------------------------------------- /libNeonDomain/tests/domain-stencil/src/stencil.h: -------------------------------------------------------------------------------- 1 | 2 | #pragma once 3 | #include 4 | #include "Neon/domain/Grids.h" 5 | 6 | #include "Neon/domain/tools/TestData.h" 7 | 8 | 9 | 10 | namespace map { 11 | using namespace Neon::domain::tool::testing; 12 | 13 | template 14 | auto run(TestData& data) -> void; 15 | 16 | extern template auto run(TestData&) -> void; 17 | extern template auto run(TestData&) -> void; 18 | 19 | } // namespace map 20 | -------------------------------------------------------------------------------- /libNeonDomain/tests/domain-unit-test-cast/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.19 FATAL_ERROR) 2 | 3 | file(GLOB_RECURSE SrcFiles src/*.*) 4 | 5 | add_executable(domain-unit-test-cast ${SrcFiles}) 6 | 7 | target_link_libraries(domain-unit-test-cast 8 | PUBLIC libNeonDomain 9 | PUBLIC gtest_main) 10 | 11 | set_target_properties(domain-unit-test-cast PROPERTIES 12 | CUDA_SEPARABLE_COMPILATION ON 13 | CUDA_RESOLVE_DEVICE_SYMBOLS ON) 14 | set_target_properties(domain-unit-test-cast PROPERTIES FOLDER "libNeonDomain") 15 | source_group(TREE . PREFIX "domain-unit-test-cast" FILES ${SrcFiles}) 16 | 17 | add_test(NAME domain-unit-test-cast COMMAND domain-unit-test-cast) -------------------------------------------------------------------------------- /libNeonDomain/tests/domain-unit-test-cast/src/TestInformation.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | namespace { 3 | struct TestInformation 4 | { 5 | static auto prefix() -> std::string 6 | { 7 | return "domain-unit-test-cast"; 8 | } 9 | 10 | static auto fullName(const std::string& gridName) 11 | { 12 | return prefix() + "-" + gridName; 13 | } 14 | }; 15 | } // namespace -------------------------------------------------------------------------------- /libNeonDomain/tests/domain-unit-test-cast/src/gtests.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include "Neon/Neon.h" 3 | #include "cuda_fp16.h" 4 | #include "gtest/gtest.h" 5 | #include "map.h" 6 | #include "runHelper.h" 7 | 8 | TEST(domain, map) 9 | { 10 | int nGpus = 3; 11 | runAllTestConfiguration(std::function(map::run), 12 | nGpus, 13 | 1); 14 | } 15 | 16 | int main(int argc, char** argv) 17 | { 18 | ::testing::InitGoogleTest(&argc, argv); 19 | Neon::init(); 20 | return RUN_ALL_TESTS(); 21 | } 22 | -------------------------------------------------------------------------------- /libNeonDomain/tests/domain-unit-test-cast/src/map.h: -------------------------------------------------------------------------------- 1 | 2 | #pragma once 3 | #include 4 | #include "Neon/domain/dGrid.h" 5 | #include "Neon/domain/eGrid.h" 6 | #include "cuda_fp16.h" 7 | 8 | #include "Neon/domain/tools/TestData.h" 9 | 10 | 11 | namespace map { 12 | using namespace Neon::domain::tool::testing; 13 | 14 | template 15 | auto run(TestData& data) -> void; 16 | 17 | extern template auto run(TestData&) -> void; 18 | extern template auto run(TestData&) -> void; 19 | 20 | } // namespace map 21 | -------------------------------------------------------------------------------- /libNeonDomain/tests/domain-unit-test-eGrid/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.19 FATAL_ERROR) 2 | 3 | set(APP_NAME domain-unit-test-eGrid) 4 | file(GLOB_RECURSE SrcFiles src/*.*) 5 | 6 | add_executable(${APP_NAME} ${SrcFiles}) 7 | 8 | target_link_libraries(${APP_NAME} 9 | PUBLIC libNeonDomain 10 | PUBLIC gtest_main) 11 | 12 | set_target_properties(${APP_NAME} PROPERTIES 13 | CUDA_SEPARABLE_COMPILATION ON 14 | CUDA_RESOLVE_DEVICE_SYMBOLS ON) 15 | set_target_properties(${APP_NAME} PROPERTIES FOLDER "libNeonDomain") 16 | source_group(TREE ${CMAKE_CURRENT_LIST_DIR} PREFIX "${APP_NAME}" FILES ${SrcFiles}) 17 | 18 | add_test(NAME ${APP_NAME} COMMAND ${APP_NAME}) -------------------------------------------------------------------------------- /libNeonDomain/tests/domain-unit-test-eGrid/src/TestInformation.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | namespace { 3 | struct TestInformation 4 | { 5 | static auto prefix() 6 | -> std::string 7 | { 8 | return "domain-unit-test-map"; 9 | } 10 | 11 | static auto fullName(const std::string& gridName) 12 | -> std::string 13 | { 14 | return prefix() + "-" + gridName; 15 | } 16 | }; 17 | } // namespace -------------------------------------------------------------------------------- /libNeonDomain/tests/domain-unit-test-eGrid/src/eGridTest.h: -------------------------------------------------------------------------------- 1 | 2 | #pragma once 3 | #include 4 | 5 | #include "Neon/domain/Grids.h" 6 | #include "Neon/domain/tools/TestData.h" 7 | 8 | 9 | namespace eGridTesting { 10 | using namespace Neon::domain::tool::testing; 11 | 12 | template 13 | auto run(TestData& data) -> void; 14 | 15 | extern template auto run(TestData&) -> void; 16 | extern template auto run(TestData&) -> void; 17 | 18 | 19 | } // namespace map 20 | -------------------------------------------------------------------------------- /libNeonDomain/tests/domain-unit-test-eGrid/src/gtests.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include "Neon/Neon.h" 3 | #include "eGridTest.h" 4 | #include "gtest/gtest.h" 5 | #include "runHelper.h" 6 | 7 | 8 | TEST(domain_unit_test_eGrid, eGrid) 9 | { 10 | int nGpus = 3; 11 | using Type = int64_t; 12 | runAllTestConfiguration(std::function(eGridTesting::run), 13 | nGpus, 14 | 1); 15 | } 16 | 17 | int main(int argc, char** argv) 18 | { 19 | ::testing::InitGoogleTest(&argc, argv); 20 | Neon::init(); 21 | return RUN_ALL_TESTS(); 22 | } 23 | -------------------------------------------------------------------------------- /libNeonDomain/tests/domain-unit-test-gridInterface/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.19 FATAL_ERROR) 2 | 3 | set(APP_NAME domain-unit-test-gridInterface) 4 | file(GLOB_RECURSE SrcFiles src/*.*) 5 | 6 | add_executable(${APP_NAME} ${SrcFiles}) 7 | 8 | target_link_libraries(${APP_NAME} 9 | PUBLIC libNeonDomain 10 | PUBLIC gtest_main) 11 | 12 | set_target_properties(${APP_NAME} PROPERTIES 13 | CUDA_SEPARABLE_COMPILATION ON 14 | CUDA_RESOLVE_DEVICE_SYMBOLS ON) 15 | set_target_properties(${APP_NAME} PROPERTIES FOLDER "libNeonDomain") 16 | source_group(TREE ${CMAKE_CURRENT_LIST_DIR} PREFIX "${APP_NAME}" FILES ${SrcFiles}) 17 | 18 | add_test(NAME ${APP_NAME} COMMAND ${APP_NAME}) -------------------------------------------------------------------------------- /libNeonDomain/tests/domain-unit-test-gridInterface/src/TestInformation.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | namespace { 3 | struct TestInformation 4 | { 5 | static auto prefix() 6 | -> std::string 7 | { 8 | return "domain-unit-test-map"; 9 | } 10 | 11 | static auto fullName(const std::string& gridName) 12 | -> std::string 13 | { 14 | return prefix() + "-" + gridName; 15 | } 16 | }; 17 | } // namespace -------------------------------------------------------------------------------- /libNeonDomain/tests/domain-unit-test-gridInterface/src/gridInterface.h: -------------------------------------------------------------------------------- 1 | 2 | #pragma once 3 | #include 4 | 5 | #include "Neon/domain/Grids.h" 6 | #include "Neon/domain/tools/TestData.h" 7 | 8 | 9 | namespace globalIdx { 10 | using namespace Neon::domain::tool::testing; 11 | 12 | template 13 | auto run(TestData& data) -> void; 14 | 15 | extern template auto run(TestData&) -> void; 16 | extern template auto run(TestData&) -> void; 17 | 18 | 19 | } // namespace map 20 | -------------------------------------------------------------------------------- /libNeonDomain/tests/domain-unit-test-gridInterface/src/gtests.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include "Neon/Neon.h" 3 | #include "gridInterface.h" 4 | #include "gtest/gtest.h" 5 | #include "runHelper.h" 6 | 7 | TEST(domain_unit_test_globalIdx, dGrid) 8 | { 9 | int nGpus = 3; 10 | using Type = int64_t; 11 | runAllTestConfiguration(std::function(globalIdx::run), 12 | nGpus, 13 | 1); 14 | } 15 | 16 | TEST(domain_unit_test_globalIdx, eGrid) 17 | { 18 | int nGpus = 3; 19 | using Type = int64_t; 20 | runAllTestConfiguration(std::function(globalIdx::run), 21 | nGpus, 22 | 1); 23 | } 24 | 25 | int main(int argc, char** argv) 26 | { 27 | ::testing::InitGoogleTest(&argc, argv); 28 | Neon::init(); 29 | return RUN_ALL_TESTS(); 30 | } 31 | -------------------------------------------------------------------------------- /libNeonDomain/tests/domain-unit-test-patterns-containers/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.19 FATAL_ERROR) 2 | 3 | set(APP_NAME domain-unit-test-patterns-containers) 4 | 5 | file(GLOB_RECURSE SrcFiles src/*.*) 6 | add_executable(${APP_NAME} ${SrcFiles}) 7 | 8 | target_link_libraries(${APP_NAME} 9 | PUBLIC libNeonDomain 10 | PUBLIC gtest_main) 11 | 12 | set_target_properties(${APP_NAME} PROPERTIES FOLDER "libNeonDomain") 13 | source_group(TREE ${CMAKE_CURRENT_LIST_DIR} PREFIX ${APP_NAME} FILES ${SrcFiles}) 14 | 15 | add_test(NAME ${APP_NAME} COMMAND ${APP_NAME}) -------------------------------------------------------------------------------- /libNeonDomain/tests/domain-unit-test-patterns-containers/src/TestInformation.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | namespace { 3 | struct TestInformation 4 | { 5 | static auto prefix() 6 | -> std::string 7 | { 8 | return "domain-unit-test-patterns-containers"; 9 | } 10 | 11 | static auto fullName(const std::string& gridName) 12 | -> std::string 13 | { 14 | return prefix() + "-" + gridName; 15 | } 16 | }; 17 | } // namespace -------------------------------------------------------------------------------- /libNeonDomain/tests/domain-unit-test-patterns-containers/src/containerRun.h: -------------------------------------------------------------------------------- 1 | 2 | #pragma once 3 | #include 4 | #include "Neon/domain/details/dGrid/dGrid.h" 5 | #include "Neon/domain/tools/TestData.h" 6 | 7 | 8 | using namespace Neon::domain::tool::testing; 9 | 10 | template 11 | auto runContainer(TestData& data, 12 | const Neon::sys::patterns::Engine eng) -> void; 13 | 14 | extern template auto runContainer(TestData&, 15 | const Neon::sys::patterns::Engine eng) -> void; 16 | -------------------------------------------------------------------------------- /libNeonDomain/tests/domain-unit-test-patterns-containers/src/gtests.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include "Neon/Neon.h" 3 | #include "containerRun.h" 4 | #include "gtest/gtest.h" 5 | #include "runHelper.h" 6 | 7 | #include "Neon/domain/details/dGrid/dGrid.h" 8 | 9 | 10 | TEST(domain_unit_test_patterns_containers, DISABLED_dGrid) 11 | { 12 | int nGpus = 3; 13 | using Type = int64_t; 14 | 15 | runAllTestConfiguration( 16 | std::function(runContainer), 17 | {Neon::sys::patterns::Engine::CUB, 18 | Neon::sys::patterns::Engine::cuBlas} , 19 | nGpus, 20 | 1); 21 | } 22 | 23 | int main(int argc, char** argv) 24 | { 25 | ::testing::InitGoogleTest(&argc, argv); 26 | Neon::init(); 27 | return RUN_ALL_TESTS(); 28 | } 29 | -------------------------------------------------------------------------------- /libNeonDomain/tests/domain-unit-test-staggered-grid/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.19 FATAL_ERROR) 2 | 3 | file(GLOB_RECURSE SrcFiles src/*.*) 4 | 5 | add_executable(domain-unit-test-staggered-grid ${SrcFiles}) 6 | 7 | target_link_libraries(domain-unit-test-staggered-grid 8 | PUBLIC libNeonDomain 9 | PUBLIC libNeonSkeleton 10 | PUBLIC gtest_main) 11 | 12 | set_target_properties(domain-unit-test-staggered-grid PROPERTIES 13 | CUDA_SEPARABLE_COMPILATION ON 14 | CUDA_RESOLVE_DEVICE_SYMBOLS ON) 15 | 16 | set_target_properties(domain-unit-test-staggered-grid PROPERTIES FOLDER "libNeonDomain") 17 | source_group(TREE . PREFIX "gUt_containers" FILES ${SrcFiles}) 18 | 19 | add_test(NAME domain-unit-test-staggered-grid COMMAND domain-unit-test-staggered-grid) -------------------------------------------------------------------------------- /libNeonDomain/tests/domain-unit-test-staggered-grid/src/TestInformation.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | namespace { 3 | struct TestInformation 4 | { 5 | static auto prefix() 6 | -> std::string 7 | { 8 | return "domain-unit-test-staggered-grid"; 9 | } 10 | 11 | static auto fullName(const std::string& gridName, 12 | const std::string& subTestName) 13 | -> std::string 14 | { 15 | return prefix() + "-" +subTestName+"-"+ gridName; 16 | } 17 | }; 18 | } // namespace -------------------------------------------------------------------------------- /libNeonDomain/tests/domainUt_sGrid/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.19 FATAL_ERROR) 2 | 3 | file(GLOB_RECURSE SrcFiles src/*.*) 4 | 5 | add_executable(domainUt_sGrid ${SrcFiles}) 6 | 7 | target_link_libraries(domainUt_sGrid 8 | PUBLIC libNeonDomain 9 | PUBLIC libNeonSkeleton 10 | PUBLIC gtest_main) 11 | 12 | set_target_properties(domainUt_sGrid PROPERTIES 13 | CUDA_SEPARABLE_COMPILATION ON 14 | CUDA_RESOLVE_DEVICE_SYMBOLS ON) 15 | 16 | set_target_properties(domainUt_sGrid PROPERTIES FOLDER "libNeonDomain") 17 | source_group(TREE ${CMAKE_CURRENT_LIST_DIR} PREFIX "gUt_containers" FILES ${SrcFiles}) 18 | 19 | add_test(NAME domainUt_sGrid COMMAND domainUt_sGrid) -------------------------------------------------------------------------------- /libNeonDomain/tests/domainUt_swap/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.19 FATAL_ERROR) 2 | 3 | file(GLOB_RECURSE SrcFiles src/*.*) 4 | 5 | add_executable(domainUt_swap ${SrcFiles}) 6 | 7 | target_link_libraries(domainUt_swap 8 | PUBLIC libNeonDomain 9 | PUBLIC libNeonSkeleton 10 | PUBLIC gtest_main) 11 | 12 | set_target_properties(domainUt_swap PROPERTIES 13 | CUDA_SEPARABLE_COMPILATION ON 14 | CUDA_RESOLVE_DEVICE_SYMBOLS ON) 15 | 16 | set_target_properties(domainUt_swap PROPERTIES FOLDER "libNeonDomain") 17 | source_group(TREE ${CMAKE_CURRENT_LIST_DIR} PREFIX "gUt_containers" FILES ${SrcFiles}) 18 | 19 | add_test(NAME domainUt_swap COMMAND domainUt_swap) -------------------------------------------------------------------------------- /libNeonDomain/tests/gUt_dataView_patterns/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.19 FATAL_ERROR) 2 | 3 | file(GLOB_RECURSE SrcFiles src/*.*) 4 | 5 | add_executable(gUt_dataView_patterns ${SrcFiles}) 6 | 7 | target_link_libraries(gUt_dataView_patterns 8 | PUBLIC libNeonDomain 9 | PUBLIC gtest_main) 10 | 11 | set_target_properties(gUt_dataView_patterns PROPERTIES FOLDER "libNeonDomain") 12 | source_group(TREE . PREFIX "gUt_dataView_patterns" FILES ${SrcFiles}) 13 | 14 | add_test(NAME gUt_dataView_patterns COMMAND gUt_dataView_patterns) -------------------------------------------------------------------------------- /libNeonDomain/tests/gUt_mGrid/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.19 FATAL_ERROR) 2 | 3 | file(GLOB_RECURSE SrcFiles src/*.*) 4 | 5 | add_executable(gUt_mGrid ${SrcFiles}) 6 | 7 | target_link_libraries(gUt_mGrid 8 | PUBLIC libNeonDomain 9 | PUBLIC gtest_main) 10 | 11 | set_target_properties(gUt_mGrid PROPERTIES FOLDER "libNeonDomain") 12 | source_group(TREE ${CMAKE_CURRENT_LIST_DIR} PREFIX "gUt_mGrid" FILES ${SrcFiles}) 13 | 14 | add_test(NAME gUt_mGrid COMMAND gUt_mGrid) -------------------------------------------------------------------------------- /libNeonDomain/tests/gUt_periodic/_CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.19 FATAL_ERROR) 2 | 3 | file(GLOB_RECURSE SrcFiles src/*.*) 4 | 5 | add_executable(gUt_periodic ${SrcFiles}) 6 | 7 | target_link_libraries(gUt_periodic 8 | PUBLIC libNeonDomain 9 | PUBLIC gtest_main) 10 | 11 | set_target_properties(gUt_periodic PROPERTIES FOLDER "libNeonDomain") 12 | source_group(TREE ${CMAKE_CURRENT_LIST_DIR} PREFIX "gUt_periodic" FILES ${SrcFiles}) 13 | 14 | add_test(NAME gUt_periodic COMMAND gUt_periodic) -------------------------------------------------------------------------------- /libNeonDomain/tests/gUt_tools/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.19 FATAL_ERROR) 2 | 3 | file(GLOB_RECURSE SrcFiles src/*.*) 4 | 5 | add_executable(gUt_tools ${SrcFiles}) 6 | 7 | target_link_libraries(gUt_tools 8 | PUBLIC libNeonDomain 9 | PUBLIC gtest_main) 10 | 11 | set_target_properties(gUt_tools PROPERTIES FOLDER "libNeonDomain") 12 | source_group(TREE ${CMAKE_CURRENT_LIST_DIR} PREFIX "gUt_tools" FILES ${SrcFiles}) 13 | 14 | add_test(NAME gUt_tools COMMAND gUt_tools) -------------------------------------------------------------------------------- /libNeonDomain/tests/gUt_tools/src/gUt_IODomain.main.cpp: -------------------------------------------------------------------------------- 1 | #include "gtest/gtest.h" 2 | 3 | #include "Neon/Neon.h" 4 | 5 | #include 6 | 7 | int main(int argc, char** argv) 8 | { 9 | ::testing::InitGoogleTest(&argc, argv); 10 | Neon::init(); 11 | return RUN_ALL_TESTS(); 12 | } 13 | -------------------------------------------------------------------------------- /libNeonDomain/tests/gUt_vtk/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.19 FATAL_ERROR) 2 | 3 | file(GLOB_RECURSE SrcFiles src/*.*) 4 | 5 | add_executable(gUt_vtk ${SrcFiles}) 6 | 7 | target_link_libraries(gUt_vtk 8 | PUBLIC libNeonDomain 9 | PUBLIC gtest_main) 10 | 11 | set_target_properties(gUt_vtk PROPERTIES FOLDER "libNeonDomain") 12 | source_group(TREE ${CMAKE_CURRENT_LIST_DIR} PREFIX "gUt_vtk" FILES ${SrcFiles}) 13 | 14 | add_test(NAME gUt_vtk COMMAND gUt_vtk) -------------------------------------------------------------------------------- /libNeonDomain/tests/gUt_vtk/src/gUt_vtk.main.cpp: -------------------------------------------------------------------------------- 1 | #include "gtest/gtest.h" 2 | 3 | #include "Neon/Neon.h" 4 | 5 | #include 6 | 7 | int main(int argc, char** argv) 8 | { 9 | ::testing::InitGoogleTest(&argc, argv); 10 | Neon::init(); 11 | return RUN_ALL_TESTS(); 12 | } 13 | -------------------------------------------------------------------------------- /libNeonSet/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.19 FATAL_ERROR) 2 | 3 | file(GLOB_RECURSE libNeonSetFiles include/*.* src/*.*) 4 | 5 | #set(CUDA_PROPAGATE_HOST_FLAGS ON) 6 | 7 | if (${BUILD_NEON_SHARED_LIBS}) 8 | add_library(libNeonSet SHARED ${libNeonSetFiles}) 9 | message( STATUS "Configuring libNeonSet as a shared library...") 10 | set_target_properties(libNeonSet PROPERTIES WINDOWS_EXPORT_ALL_SYMBOLS ON) 11 | else () 12 | add_library(libNeonSet STATIC ${libNeonSetFiles}) 13 | message( STATUS "Configuring libNeonSet as a static library...") 14 | endif() 15 | 16 | target_link_libraries(libNeonSet 17 | PUBLIC NeonDeveloperLib 18 | PUBLIC libNeonCore 19 | PUBLIC libNeonSys) 20 | 21 | include("${PROJECT_SOURCE_DIR}/cmake/ExportHeader.cmake") 22 | ExportHeader(libNeonSet) 23 | 24 | target_include_directories(libNeonSet PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/include/") 25 | 26 | #add_flag(Public All COMPILE_DEFINITIONS NEONSYS_API_DLL_EXPORT) 27 | 28 | source_group(TREE ${CMAKE_CURRENT_LIST_DIR} PREFIX "libNeonSet" FILES ${libNeonSetFiles}) 29 | 30 | if (${BUILD_NEON_TESTING}) 31 | add_subdirectory("tests") 32 | endif() 33 | -------------------------------------------------------------------------------- /libNeonSet/include/Neon/set/ExecutionThreadSpan.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include 9 | 10 | #include "Neon/Report.h" 11 | #include "Neon/core/core.h" 12 | #include "Neon/set/MemoryOptions.h" 13 | // #include "Neon/core/types/mode.h" 14 | // #include "Neon/core/types/devType.h" 15 | 16 | namespace Neon::set::details { 17 | 18 | /* 19 | * Type of thread grids 20 | */ 21 | enum struct ExecutionThreadSpan 22 | { 23 | d1 = 0 /**< 1D dense thread grid */, 24 | d2 = 1 /**< 1D dense thread grid */, 25 | d3 = 2 /**< 1D dense thread grid */, 26 | d1b3 = 3 /**< 3D blocks arranged in a 1D */ 27 | }; 28 | 29 | 30 | struct ExecutionThreadSpanUtils 31 | { 32 | static constexpr int nOptions = 4; 33 | static auto toString(ExecutionThreadSpan runtime) -> std::string; 34 | 35 | static constexpr auto isBlockSpan(ExecutionThreadSpan executionThreadSpan){ 36 | return executionThreadSpan == ExecutionThreadSpan::d1b3; 37 | } 38 | }; 39 | 40 | } // namespace Neon::set::details 41 | -------------------------------------------------------------------------------- /libNeonSet/include/Neon/set/LaunchParametersTable.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | 4 | #include "Neon/core/core.h" 5 | #include "Neon/set/LaunchParameters.h" 6 | 7 | namespace Neon { 8 | class Backend; 9 | } 10 | namespace Neon::set { 11 | 12 | class DevSet; 13 | 14 | class LaunchParametersTable 15 | { 16 | public: 17 | LaunchParametersTable() = default; 18 | LaunchParametersTable(Neon::Backend const& bk); 19 | 20 | template 21 | auto forEachSeq(Lambda fun) 22 | -> void 23 | { 24 | for (auto dw : Neon::DataViewUtil::validOptions()) { 25 | fun(dw, mLaunchParameters[Neon::DataViewUtil::toInt(dw)]); 26 | } 27 | } 28 | 29 | auto init(Neon::Backend const& bk) 30 | -> void; 31 | 32 | auto get(Neon::DataView dw) 33 | -> Neon::set::LaunchParameters const&; 34 | 35 | private: 36 | int mSetSize = 0; 37 | std::array mLaunchParameters; 38 | }; 39 | } // namespace Neon::set 40 | -------------------------------------------------------------------------------- /libNeonSet/include/Neon/set/MultiXpuDataUid.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace Neon::set::dataDependency { 4 | 5 | using MultiXpuDataUid = size_t; 6 | using MultiXpuDataIdx = size_t; 7 | 8 | } // namespace Neon::set::dataDependency 9 | -------------------------------------------------------------------------------- /libNeonSet/include/Neon/set/Runtime.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include 9 | 10 | #include "Neon/Report.h" 11 | #include "Neon/core/core.h" 12 | #include "Neon/set/MemoryOptions.h" 13 | //#include "Neon/core/types/mode.h" 14 | //#include "Neon/core/types/devType.h" 15 | 16 | namespace Neon { 17 | 18 | enum struct Runtime 19 | { 20 | none = 0, 21 | system = 0, 22 | stream = 1, 23 | openmp = 2 24 | }; 25 | 26 | 27 | struct RuntimeUtils 28 | { 29 | static constexpr int nOptions = 2; 30 | 31 | static auto toString(Runtime runtime) -> std::string; 32 | static auto fromString(const std::string& runtime) -> Runtime; 33 | static auto getOptions() -> std::array; 34 | 35 | struct Cli 36 | { 37 | explicit Cli(std::string); 38 | explicit Cli(Runtime model); 39 | Cli(); 40 | 41 | auto getOption() -> Runtime; 42 | auto set(const std::string& opt) -> void; 43 | auto getStringOptions() -> std::string; 44 | 45 | private: 46 | bool mSet = false; 47 | Runtime mOption; 48 | }; 49 | }; 50 | 51 | } // namespace Neon::set 52 | -------------------------------------------------------------------------------- /libNeonSet/include/Neon/set/StencilSemantic.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | #include 4 | 5 | #include "Neon/core/core.h" 6 | 7 | namespace Neon::set { 8 | 9 | enum struct StencilSemantic 10 | { 11 | standard = 0 /*< Transfer for halo update on grid structure */, 12 | streaming = 1 /*< Transfer for halo update on lattice structure */ 13 | }; 14 | 15 | 16 | struct StencilSemanticUtils 17 | { 18 | static constexpr int nOptions = 2; 19 | 20 | static auto toString(StencilSemantic opt) -> std::string; 21 | static auto fromString(const std::string& opt) -> StencilSemantic; 22 | static auto getOptions() -> std::array; 23 | 24 | struct Cli 25 | { 26 | explicit Cli(std::string); 27 | explicit Cli(StencilSemantic model); 28 | Cli(); 29 | 30 | auto getOption() -> StencilSemantic; 31 | auto set(const std::string& opt) -> void; 32 | auto getStringOptions() -> std::string; 33 | 34 | private: 35 | bool mSet = false; 36 | StencilSemantic mOption; 37 | }; 38 | }; 39 | 40 | 41 | } // namespace Neon::set 42 | -------------------------------------------------------------------------------- /libNeonSet/include/Neon/set/TransferMode.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | #include 4 | 5 | #include "Neon/core/core.h" 6 | 7 | namespace Neon::set { 8 | 9 | enum struct TransferMode 10 | { 11 | put = 0, 12 | get = 1 13 | }; 14 | 15 | class TransferModeUtils 16 | { 17 | public: 18 | static constexpr int nOptions = 2; 19 | static auto toString(TransferMode occ) -> std::string; 20 | static auto fromString(const std::string& occ) -> TransferMode; 21 | static auto getOptions() -> std::array; 22 | 23 | struct Cli 24 | { 25 | explicit Cli(std::string); 26 | explicit Cli(TransferMode model); 27 | Cli(); 28 | 29 | auto getOption() -> TransferMode; 30 | auto set(const std::string& opt) -> void; 31 | auto getStringOptions() -> std::string; 32 | 33 | private: 34 | bool mSet = false; 35 | TransferMode mOption; 36 | }; 37 | }; 38 | 39 | } // namespace Neon::set 40 | -------------------------------------------------------------------------------- /libNeonSet/include/Neon/set/container/HaloUpdateContainer.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "Neon/core/core.h" 4 | 5 | #include "Neon/set/container/ContainerAPI.h" 6 | #include "Neon/set/container/Graph.h" 7 | #include "Neon/set/container/GraphContainer.h" 8 | #include "Neon/set/container/Loader.h" 9 | #include "Neon/set/container/types/SynchronizationContainerType.h" 10 | 11 | namespace Neon::set { 12 | struct Container; 13 | } 14 | 15 | namespace Neon::set::internal { 16 | 17 | template 18 | struct HaloUpdateContainer 19 | : public GraphContainer 20 | { 21 | 22 | public: 23 | ~HaloUpdateContainer() override = default; 24 | 25 | HaloUpdateContainer(const Neon::Backend& bk, 26 | const Neon::set::Container& dataTransferContainer, 27 | const Neon::set::Container& syncContainer); 28 | 29 | private: 30 | }; 31 | 32 | } // namespace Neon::set::internal 33 | 34 | #include "Neon/set/container/HaloUpdateContainer_imp.h" -------------------------------------------------------------------------------- /libNeonSet/include/Neon/set/container/graph/Bfs_imp.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "Neon/set/container/Graph.h" 4 | 5 | namespace Neon::set::container { 6 | 7 | template 8 | auto Bfs::forEachLevel(Fun fun) -> void 9 | { 10 | int levelIdx = 0; 11 | for (auto& level : data) { 12 | fun(level, levelIdx); 13 | levelIdx++; 14 | } 15 | } 16 | 17 | template 18 | auto Bfs::forEachNodeAtLevel(int levelIdx, Neon::set::container::Graph& graph, Fun fun) -> void 19 | { 20 | for (auto& nodeIdx : data.at(levelIdx)) { 21 | auto& node = graph.helpGetGraphNode(nodeIdx); 22 | fun(node); 23 | } 24 | } 25 | 26 | 27 | template 28 | auto Bfs::forEachNodeByLevel(Graph& graph, Fun fun) -> void 29 | { 30 | forEachLevel([&graph, &fun](const Level& level, int levelIdx) { 31 | for (const auto& nodeIdx : level) { 32 | auto& node = graph.helpGetGraphNode(nodeIdx); 33 | fun(node, levelIdx); 34 | } 35 | }); 36 | } 37 | 38 | 39 | } // namespace Neon::set::container 40 | -------------------------------------------------------------------------------- /libNeonSet/include/Neon/set/container/graph/GraphData.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include "vector" 5 | 6 | namespace Neon::set::container { 7 | 8 | class GraphData 9 | { 10 | public: 11 | using Uid = uint64_t; 12 | using Index = uint64_t; 13 | 14 | constexpr static Uid notSet = 0; 15 | constexpr static Uid beginUid = 1; 16 | constexpr static Uid endUid = 2; 17 | constexpr static Uid firstInternal = 3; 18 | 19 | GraphData(); 20 | GraphData(int uid); 21 | 22 | auto setUid(Uid uid) -> void; 23 | auto setIndex(Index index) -> void; 24 | 25 | auto getUid() const -> Uid; 26 | auto getIndex() const -> Index; 27 | 28 | private: 29 | Uid mUid /** unique identifier for the node */; 30 | Index mIndex /** relative index w.r.t the completed graph. This value may change during the life of the graph */; 31 | }; 32 | 33 | } // namespace Neon::set::container 34 | -------------------------------------------------------------------------------- /libNeonSet/include/Neon/set/container/graph/GraphInfo.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include "vector" 5 | 6 | namespace Neon::set::container { 7 | 8 | class GraphInfo 9 | { 10 | public: 11 | using NodeUid = uint64_t; 12 | using NodeIdx = uint64_t; 13 | 14 | constexpr static NodeUid notSet = 0; 15 | constexpr static NodeUid beginUid = 1; 16 | constexpr static NodeUid endUid = 2; 17 | constexpr static NodeUid firstInternal = 3; 18 | 19 | GraphInfo(); 20 | GraphInfo(int uid); 21 | 22 | auto setUid(NodeUid uid) -> void; 23 | auto setIndex(NodeIdx index) -> void; 24 | 25 | auto getUid() const -> NodeUid; 26 | auto getIndex() const -> NodeIdx; 27 | 28 | private: 29 | NodeUid mUid /**< unique identifier for the node. 30 | * This is different from a Container uid as in a graph the same container can appear more than once. 31 | * */ 32 | ; 33 | NodeIdx mIndex /** relative index w.r.t the completed graph. This value may change during the life of the graph */; 34 | }; 35 | 36 | } // namespace Neon::set::container 37 | -------------------------------------------------------------------------------- /libNeonSet/include/Neon/set/container/types/ContainerPatternType.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "Neon/set/DevSet.h" 4 | #include "functional" 5 | #include "type_traits" 6 | 7 | /** 8 | * Abstract interface to hide 9 | */ 10 | 11 | namespace Neon::set { 12 | 13 | enum struct ContainerPatternType 14 | { 15 | map = 0, 16 | stencil = 1, 17 | reduction = 2, 18 | complex = 3, 19 | }; 20 | 21 | 22 | struct ContainerPatternTypeUtils 23 | { 24 | static constexpr int nOptions = 4; 25 | 26 | static auto toString(ContainerPatternType option) -> std::string; 27 | static auto fromString(const std::string& option) -> ContainerPatternType; 28 | static auto getOptions() -> std::array; 29 | }; 30 | 31 | /** 32 | * operator<< 33 | */ 34 | std::ostream& operator<<(std::ostream& os, Neon::set::ContainerPatternType const& m); 35 | 36 | } // namespace Neon::set 37 | -------------------------------------------------------------------------------- /libNeonSet/include/Neon/set/container/types/HostManagedSyncType.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace Neon::set::internal { 4 | 5 | enum struct HostManagedSyncType 6 | { 7 | intraGPU = 0, 8 | multiGPU = 1, 9 | none = 2 10 | }; 11 | 12 | } // namespace Neon::set::internal 13 | -------------------------------------------------------------------------------- /libNeonSet/include/Neon/set/container/types/SynchronizationContainerType.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "Neon/set/DevSet.h" 4 | #include "functional" 5 | #include "type_traits" 6 | 7 | /** 8 | * Abstract interface to hide 9 | */ 10 | 11 | namespace Neon::set { 12 | 13 | enum struct SynchronizationContainerType 14 | { 15 | hostOmpBarrier = 0, 16 | none = 6 17 | }; 18 | 19 | 20 | struct SynchronizationContainerTypeUtils 21 | { 22 | static constexpr int nOptions = 1; 23 | 24 | static auto toString(SynchronizationContainerType option) 25 | -> std::string; 26 | 27 | static auto fromString(const std::string& option) 28 | -> SynchronizationContainerType; 29 | 30 | static auto getOptions() 31 | -> std::array; 32 | }; 33 | 34 | /** 35 | * operator<< 36 | */ 37 | std::ostream& operator<<(std::ostream& os, Neon::set::SynchronizationContainerType const& m); 38 | } // namespace Neon::set 39 | -------------------------------------------------------------------------------- /libNeonSet/include/Neon/set/dependency/AccessType.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "Neon/set/Backend.h" 3 | 4 | namespace Neon::set::dataDependency { 5 | 6 | 7 | /** 8 | * Define type of operation for a kernel parameter: Read or write. 9 | * Write includes also complex operation where the parameter is both read and written. 10 | */ 11 | enum struct AccessType 12 | { 13 | READ /**< The field or kernel parameter is in read only mode */, 14 | WRITE /**< The field or kernel parameter is in write mode (this include read and write) */, 15 | NONE /**< Not defined */ 16 | 17 | }; 18 | 19 | struct AccessTypeUtils 20 | { 21 | static auto toString(AccessType val) -> std::string; 22 | static auto merge(AccessType valA, AccessType valB) -> AccessType; 23 | }; 24 | 25 | } // namespace Neon::dependency -------------------------------------------------------------------------------- /libNeonSet/include/Neon/set/dependency/DataDependencyType.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "Neon/set/Backend.h" 3 | 4 | namespace Neon::set::dataDependency { 5 | 6 | /** 7 | * Classical definition of dependency types. 8 | */ 9 | enum struct DataDependencyType 10 | { 11 | RAW /**< Read after write */, 12 | WAR /**< Write after read */, 13 | RAR /**< Read after read. This is not actually a true dependency */, 14 | WAW /**< This configuration may indicate something wrong in the user graph */, 15 | NONE /**< Not defined */ 16 | }; 17 | 18 | struct DataDependencyTypeUtils 19 | { 20 | /** 21 | * Returns a string for the selected allocator 22 | * 23 | * @param allocator 24 | * @return 25 | */ 26 | static auto toString(DataDependencyType type) -> std::string; 27 | }; 28 | 29 | std::ostream& operator<<(std::ostream& os, Neon::set::dataDependency::DataDependencyType const& m); 30 | } 31 | -------------------------------------------------------------------------------- /libNeonSet/include/Neon/set/dependency/Pattern.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "Neon/set/Backend.h" 3 | 4 | namespace Neon { 5 | 6 | 7 | /** 8 | * Enumeration for the supported type of computation by the skeleton 9 | * */ 10 | enum struct Pattern 11 | { 12 | MAP /**< Map operation */, 13 | STENCIL /**< Stencil operation */, 14 | REDUCE /**< Reduction operation */ 15 | }; 16 | 17 | struct PatternUtils 18 | { 19 | /** 20 | * Returns a string for the selected allocator 21 | * 22 | * @param allocator 23 | * @return 24 | */ 25 | static auto toString(Pattern val) -> std::string; 26 | }; 27 | 28 | } // namespace Neon -------------------------------------------------------------------------------- /libNeonSet/src/set/ExecutionThreadSpan.cpp: -------------------------------------------------------------------------------- 1 | #include "Neon/set/ExecutionThreadSpan.h" 2 | 3 | namespace Neon::set::details { 4 | 5 | auto ExecutionThreadSpanUtils::toString(ExecutionThreadSpan runtime) -> std::string 6 | { 7 | switch (runtime) { 8 | case ExecutionThreadSpan::d1: { 9 | return "d1"; 10 | } 11 | case ExecutionThreadSpan::d2: { 12 | return "d2"; 13 | } 14 | case ExecutionThreadSpan::d3: { 15 | return "d3"; 16 | } 17 | case ExecutionThreadSpan::d1b3: { 18 | return "d1b3"; 19 | } 20 | } 21 | NEON_THROW_UNSUPPORTED_OPTION(""); 22 | } 23 | 24 | } // namespace Neon::set::details -------------------------------------------------------------------------------- /libNeonSet/src/set/GpuEventSet.cpp: -------------------------------------------------------------------------------- 1 | #include "Neon/set/GpuEventSet.h" 2 | #include "Neon/set/GpuStreamSet.h" 3 | 4 | #include "Neon/core/core.h" 5 | #include "Neon/sys/devices/gpu/ComputeID.h" 6 | #include "Neon/sys/global/GpuSysGlobal.h" 7 | 8 | #include 9 | 10 | namespace Neon { 11 | namespace set { 12 | 13 | 14 | GpuEventSet::GpuEventSet(int setCardinality) 15 | { 16 | eventVec = std::vector(setCardinality); 17 | } 18 | 19 | void GpuEventSet::release() 20 | { 21 | for (auto&& cudaStream : eventVec) { 22 | cudaStream.release(); 23 | } 24 | } 25 | 26 | } // namespace set 27 | } // End of namespace Neon 28 | -------------------------------------------------------------------------------- /libNeonSet/src/set/LaunchParametersTable.cpp: -------------------------------------------------------------------------------- 1 | #include "Neon/set/LaunchParametersTable.h" 2 | #include "Neon/set/Backend.h" 3 | #include "Neon/set/DevSet.h" 4 | 5 | namespace Neon::set { 6 | 7 | 8 | LaunchParametersTable::LaunchParametersTable(Neon::Backend const& bk) 9 | { 10 | init(bk); 11 | } 12 | 13 | auto LaunchParametersTable::init(const Neon::Backend& bk) 14 | ->void 15 | { 16 | mSetSize = bk.getDeviceCount(); 17 | for (auto& tableRow : mLaunchParameters) { 18 | tableRow = bk.devSet().newLaunchParameters(); 19 | } 20 | } 21 | 22 | auto LaunchParametersTable::get(Neon::DataView dw) -> Neon::set::LaunchParameters const& 23 | { 24 | return mLaunchParameters[Neon::DataViewUtil::toInt(dw)]; 25 | } 26 | 27 | } // namespace Neon::set 28 | -------------------------------------------------------------------------------- /libNeonSet/src/set/container/AnchorContainer.cpp: -------------------------------------------------------------------------------- 1 | #include "Neon/core/core.h" 2 | 3 | #include "Neon/set/container/AnchorContainer.h" 4 | 5 | namespace Neon::set::internal { 6 | 7 | AnchorContainer::AnchorContainer(const std::string& name) 8 | { 9 | setName(name); 10 | setContainerExecutionType(ContainerExecutionType::none); 11 | setContainerOperationType(ContainerOperationType::anchor); 12 | setDataViewSupport(ContainerAPI::DataViewSupport::off); 13 | } 14 | 15 | 16 | auto AnchorContainer:: 17 | parse() 18 | -> const std::vector& 19 | { 20 | return mEmtpy; 21 | } 22 | 23 | auto AnchorContainer:: 24 | run(int /*streamIdx*/, 25 | Neon::DataView /*dataView*/) 26 | -> void 27 | { 28 | } 29 | 30 | auto AnchorContainer:: 31 | run(Neon::SetIdx /*setIdx*/, 32 | int /*streamIdx*/, 33 | Neon::DataView /*dataView*/) 34 | -> void 35 | { 36 | } 37 | 38 | } // namespace Neon::set::internal 39 | -------------------------------------------------------------------------------- /libNeonSet/src/set/container/Loader.cpp: -------------------------------------------------------------------------------- 1 | #include "type_traits" 2 | 3 | #include "Neon/set/Containter.h" 4 | #include "Neon/set/container/Loader.h" 5 | 6 | 7 | namespace Neon::set { 8 | 9 | auto Loader:: 10 | computeMode() -> bool 11 | { 12 | return m_loadingMode == Neon::set::internal::LoadingMode_e::EXTRACT_LAMBDA; 13 | } 14 | 15 | auto Loader::getExecution() const -> Neon::Execution 16 | { 17 | return mExecution; 18 | } 19 | auto Loader::getSetIdx() const -> Neon::SetIdx 20 | { 21 | return m_setIdx; 22 | } 23 | 24 | auto Loader::getDataView() const -> Neon::DataView 25 | { 26 | return m_dataView; 27 | } 28 | 29 | } // namespace Neon::set -------------------------------------------------------------------------------- /libNeonSet/src/set/container/graph/GraphNodeOrganization.cpp: -------------------------------------------------------------------------------- 1 | #include "Neon/set/container/graph/GraphData.h" 2 | 3 | namespace Neon::set::container { 4 | 5 | GraphData::GraphData() 6 | { 7 | mUid = notSet; 8 | mIndex = notSet; 9 | } 10 | GraphData::GraphData(int uid) 11 | { 12 | mUid = uid; 13 | mIndex = notSet; 14 | } 15 | 16 | auto GraphData::setUid(Uid uid) -> void 17 | { 18 | mUid = uid; 19 | } 20 | auto GraphData::setIndex(Index index) -> void 21 | { 22 | mIndex = index; 23 | } 24 | 25 | auto GraphData::getUid() const -> Uid 26 | { 27 | return mUid; 28 | } 29 | 30 | auto GraphData::getIndex() const -> Index 31 | { 32 | return mIndex; 33 | } 34 | 35 | } // namespace Neon::set::container 36 | -------------------------------------------------------------------------------- /libNeonSet/src/set/depencencyTools/AccessType.cpp: -------------------------------------------------------------------------------- 1 | #include "Neon/set/dependency/AccessType.h" 2 | 3 | namespace Neon::set::dataDependency { 4 | 5 | auto AccessTypeUtils::toString(AccessType val) -> std::string 6 | { 7 | switch (val) { 8 | case AccessType::READ: { 9 | return "READ"; 10 | } 11 | case AccessType::WRITE: { 12 | return "WRITE"; 13 | } 14 | case AccessType::NONE: { 15 | return "NONE"; 16 | } 17 | } 18 | NEON_THROW_UNSUPPORTED_OPTION(); 19 | } 20 | 21 | auto AccessTypeUtils::merge(AccessType valA, AccessType valB) -> AccessType 22 | { 23 | if (valA == AccessType::WRITE) 24 | return AccessType::WRITE; 25 | if (valB == AccessType::WRITE) 26 | return AccessType::WRITE; 27 | if (valA == AccessType::READ) 28 | return AccessType::READ; 29 | if (valB == AccessType::READ) 30 | return AccessType::READ; 31 | return AccessType::NONE; 32 | } 33 | 34 | } // namespace Neon::set::internal -------------------------------------------------------------------------------- /libNeonSet/src/set/depencencyTools/ComputeType.cpp: -------------------------------------------------------------------------------- 1 | #include "Neon/set/dependency/Pattern.h" 2 | 3 | namespace Neon { 4 | 5 | auto PatternUtils::toString(Pattern val) -> std::string 6 | { 7 | switch (val) { 8 | case Pattern::MAP: { 9 | return "MAP"; 10 | } 11 | case Pattern::STENCIL: { 12 | return "STENCIL"; 13 | } 14 | case Pattern::REDUCE: { 15 | return "REDUCE"; 16 | } 17 | } 18 | NEON_THROW_UNSUPPORTED_OPTION(); 19 | } 20 | 21 | } // namespace Neon -------------------------------------------------------------------------------- /libNeonSet/src/set/depencencyTools/DataDependencyType.cpp: -------------------------------------------------------------------------------- 1 | #include "Neon/set/dependency/DataDependencyType.h" 2 | 3 | namespace Neon::set::dataDependency { 4 | 5 | auto DataDependencyTypeUtils::toString(DataDependencyType val) -> std::string 6 | { 7 | switch (val) { 8 | case DataDependencyType::RAW: { 9 | return "RAW"; 10 | } 11 | case DataDependencyType::WAR: { 12 | return "WAR"; 13 | } 14 | case DataDependencyType::RAR: { 15 | return "RAR"; 16 | } 17 | case DataDependencyType::WAW: { 18 | return "WAW"; 19 | } 20 | case DataDependencyType::NONE: { 21 | return "NONE"; 22 | } 23 | } 24 | NEON_THROW_UNSUPPORTED_OPTION(); 25 | } 26 | 27 | std::ostream& operator<<(std::ostream& os, Neon::set::dataDependency::DataDependencyType const& m){ 28 | os << DataDependencyTypeUtils::toString(m); 29 | return os; 30 | } 31 | 32 | } -------------------------------------------------------------------------------- /libNeonSet/src/set/patterns/BlasSet.cpp: -------------------------------------------------------------------------------- 1 | #include "Neon/set/patterns/BlasSet.h" 2 | 3 | namespace Neon::set::patterns { 4 | template class BlasSet; 5 | template class BlasSet; 6 | template class BlasSet; 7 | template class BlasSet; 8 | template class BlasSet; 9 | template class BlasSet; 10 | } // namespace Neon::set::patterns -------------------------------------------------------------------------------- /libNeonSet/tests/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.19 FATAL_ERROR) 2 | 3 | add_subdirectory("unit") -------------------------------------------------------------------------------- /libNeonSet/tests/unit/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.19 FATAL_ERROR) 2 | 3 | add_subdirectory("setUt_gpuSet") 4 | add_subdirectory("setUt_gpuSetNvcc") 5 | add_subdirectory("setUt_memMirrorSet") 6 | add_subdirectory("setUt_patterns") 7 | add_subdirectory("setUt_Replica") 8 | add_subdirectory("setUt_containerGraph") 9 | -------------------------------------------------------------------------------- /libNeonSet/tests/unit/setUt_Replica/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.19 FATAL_ERROR) 2 | 3 | file(GLOB_RECURSE SrcFiles src/*.*) 4 | 5 | add_executable(setUt_multiDeviceObject ${SrcFiles}) 6 | 7 | target_link_libraries(setUt_multiDeviceObject 8 | PUBLIC libNeonSet 9 | PUBLIC gtest_main) 10 | 11 | set_target_properties(setUt_multiDeviceObject PROPERTIES 12 | CUDA_SEPARABLE_COMPILATION ON 13 | CUDA_RESOLVE_DEVICE_SYMBOLS ON) 14 | 15 | set_target_properties(setUt_multiDeviceObject PROPERTIES FOLDER "libNeonSet") 16 | source_group(TREE ${CMAKE_CURRENT_LIST_DIR} PREFIX "setUt_multiDeviceObject" FILES ${SrcFiles}) 17 | 18 | 19 | add_test(NAME setUt_multiDeviceObject COMMAND setUt_multiDeviceObject) -------------------------------------------------------------------------------- /libNeonSet/tests/unit/setUt_containerGraph/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.19 FATAL_ERROR) 2 | 3 | SET(APP "setUt_containerGraph") 4 | file(GLOB_RECURSE SrcFiles src/*.*) 5 | 6 | SET(APP, "setUt_containerGraph") 7 | add_executable(${APP} ${SrcFiles}) 8 | 9 | target_compile_options(${APP} INTERFACE 10 | $<$:${NeonCXXFlags}> 11 | $<$:${NeonCUDAFlags}> 12 | ) 13 | 14 | target_link_libraries(${APP} 15 | PUBLIC libNeonSkeleton 16 | PUBLIC gtest_main) 17 | 18 | set_target_properties(${APP} PROPERTIES 19 | CUDA_SEPARABLE_COMPILATION ON 20 | CUDA_RESOLVE_DEVICE_SYMBOLS ON) 21 | 22 | set_target_properties(${APP} PROPERTIES FOLDER "libNeonSet") 23 | 24 | source_group(TREE ${CMAKE_CURRENT_LIST_DIR} PREFIX "${APP}" FILES ${SrcFiles}) 25 | 26 | add_test(NAME ${APP} COMMAND ${APP}) -------------------------------------------------------------------------------- /libNeonSet/tests/unit/setUt_containerGraph/src/setUt_containerGraph_main.cpp: -------------------------------------------------------------------------------- 1 | #include "gtest/gtest.h" 2 | 3 | #include "Neon/Neon.h" 4 | 5 | #include 6 | 7 | int main(int argc, char** argv) 8 | { 9 | ::testing::InitGoogleTest(&argc, argv); 10 | Neon::init(); 11 | return RUN_ALL_TESTS(); 12 | } 13 | -------------------------------------------------------------------------------- /libNeonSet/tests/unit/setUt_gpuSet/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.19 FATAL_ERROR) 2 | 3 | file(GLOB_RECURSE SrcFiles src/*.*) 4 | 5 | add_executable(setUt_gpuSet ${SrcFiles}) 6 | 7 | target_link_libraries(setUt_gpuSet 8 | PUBLIC libNeonSet 9 | PUBLIC gtest_main) 10 | 11 | set_target_properties(setUt_gpuSet PROPERTIES FOLDER "libNeonSet") 12 | source_group(TREE ${CMAKE_CURRENT_LIST_DIR} PREFIX "setUt_gpuSet" FILES ${SrcFiles}) 13 | 14 | add_test(NAME setUt_gpuSet COMMAND setUt_gpuSet) -------------------------------------------------------------------------------- /libNeonSet/tests/unit/setUt_gpuSetNvcc/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.19 FATAL_ERROR) 2 | 3 | file(GLOB_RECURSE SrcFiles src/*.*) 4 | 5 | add_executable(setUt_gpuSetNvcc ${SrcFiles}) 6 | 7 | target_link_libraries(setUt_gpuSetNvcc 8 | PUBLIC libNeonSet 9 | PUBLIC gtest_main) 10 | 11 | set_target_properties(setUt_gpuSetNvcc PROPERTIES 12 | CUDA_SEPARABLE_COMPILATION ON 13 | CUDA_RESOLVE_DEVICE_SYMBOLS ON) 14 | set_target_properties(setUt_gpuSetNvcc PROPERTIES FOLDER "libNeonSet") 15 | source_group(TREE ${CMAKE_CURRENT_LIST_DIR} PREFIX "setUt_gpuSetNvcc" FILES ${SrcFiles}) 16 | 17 | add_test(NAME setUt_gpuSetNvcc COMMAND setUt_gpuSetNvcc) -------------------------------------------------------------------------------- /libNeonSet/tests/unit/setUt_memMirrorSet/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.19 FATAL_ERROR) 2 | 3 | file(GLOB_RECURSE SrcFiles src/*.*) 4 | 5 | add_executable(setUt_memMirrorSet ${SrcFiles}) 6 | 7 | target_link_libraries(setUt_memMirrorSet 8 | PUBLIC libNeonSet 9 | PUBLIC gtest_main) 10 | 11 | set_target_properties(setUt_memMirrorSet PROPERTIES FOLDER "libNeonSet") 12 | source_group(TREE ${CMAKE_CURRENT_LIST_DIR} PREFIX "setUt_memMirrorSet" FILES ${SrcFiles}) 13 | 14 | add_test(NAME setUt_memMirrorSet COMMAND setUt_memMirrorSet) -------------------------------------------------------------------------------- /libNeonSet/tests/unit/setUt_patterns/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.19 FATAL_ERROR) 2 | 3 | file(GLOB_RECURSE SrcFiles src/*.*) 4 | 5 | add_executable(setUt_patterns ${SrcFiles}) 6 | 7 | target_link_libraries(setUt_patterns 8 | PUBLIC libNeonSet 9 | PUBLIC gtest_main) 10 | 11 | set_target_properties(setUt_patterns PROPERTIES FOLDER "libNeonSet") 12 | source_group(TREE ${CMAKE_CURRENT_LIST_DIR} PREFIX "setUt_patterns" FILES ${SrcFiles}) 13 | 14 | 15 | add_test(NAME setUt_patterns COMMAND setUt_patterns) -------------------------------------------------------------------------------- /libNeonSkeleton/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.19 FATAL_ERROR) 2 | 3 | file(GLOB_RECURSE libNeonSkeletonFiles include/*.* src/*.*) 4 | 5 | if (${BUILD_NEON_SHARED_LIBS}) 6 | add_library(libNeonSkeleton SHARED ${libNeonSkeletonFiles}) 7 | message( STATUS "Configuring libNeonSkeleton as a shared library...") 8 | set_target_properties(libNeonSet PROPERTIES WINDOWS_EXPORT_ALL_SYMBOLS ON) 9 | else () 10 | add_library(libNeonSkeleton STATIC ${libNeonSkeletonFiles}) 11 | message( STATUS "Configuring libNeonSkeleton as a static library...") 12 | endif() 13 | 14 | target_link_libraries(libNeonSkeleton 15 | PUBLIC NeonDeveloperLib 16 | PUBLIC libNeonCore 17 | PUBLIC libNeonSys 18 | PUBLIC libNeonSet 19 | PUBLIC libNeonDomain) 20 | 21 | include("${PROJECT_SOURCE_DIR}/cmake/ExportHeader.cmake") 22 | ExportHeader(libNeonSet) 23 | 24 | set_target_properties(libNeonSkeleton PROPERTIES 25 | CUDA_SEPARABLE_COMPILATION ON 26 | CUDA_RESOLVE_DEVICE_SYMBOLS ON) 27 | 28 | target_include_directories(libNeonSkeleton PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/include/") 29 | 30 | source_group(TREE ${CMAKE_CURRENT_LIST_DIR} PREFIX "libNeonSkeleton" FILES ${libNeonSkeletonFiles}) 31 | 32 | if (${BUILD_NEON_TESTING}) 33 | add_subdirectory("tests") 34 | endif() -------------------------------------------------------------------------------- /libNeonSkeleton/include/Neon/skeleton/Executor.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "Neon/Report.h" 3 | #include "Neon/set/Backend.h" 4 | #include "Neon/set/Containter.h" 5 | 6 | namespace Neon::skeleton { 7 | 8 | enum class Executor 9 | { 10 | ompAtNodeLevel, 11 | ompAtGraphLevel 12 | }; 13 | 14 | struct ExecutorUtils 15 | { 16 | static constexpr int nOptions = 2; 17 | 18 | static auto toString(Executor forkJoin) -> std::string; 19 | static auto toInt(Executor forkJoin) -> int; 20 | static auto fromString(const std::string& forkJoin) -> Executor; 21 | static auto fromInt(int forkJoin) -> Executor; 22 | 23 | static auto getOptions() -> std::array; 24 | 25 | struct Cli 26 | { 27 | explicit Cli(std::string); 28 | explicit Cli(Executor model); 29 | Cli(); 30 | 31 | auto getOption() -> Executor; 32 | auto getStringOptions() -> std::string; 33 | auto set(const std::string& opt) -> void; 34 | 35 | auto addToReport(Neon::Report& report, Neon::Report::SubBlock& subBlock)->void; 36 | auto addToReport(Neon::Report& report)->void; 37 | 38 | private: 39 | bool mSet = false; 40 | Executor mOption; 41 | }; 42 | }; 43 | 44 | 45 | } // namespace Neon::skeleton -------------------------------------------------------------------------------- /libNeonSkeleton/include/Neon/skeleton/Occ.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "Neon/Report.h" 3 | #include "Neon/set/Backend.h" 4 | #include "Neon/set/Containter.h" 5 | 6 | namespace Neon::skeleton { 7 | 8 | enum class Occ 9 | { 10 | standard, 11 | extended, 12 | twoWayExtended, 13 | none, 14 | }; 15 | 16 | struct OccUtils 17 | { 18 | static constexpr int nOptions = 4; 19 | 20 | static auto toString(Occ occ) -> std::string; 21 | static auto fromString(const std::string& occ) -> Occ; 22 | static auto getOptions() -> std::array; 23 | 24 | struct Cli 25 | { 26 | explicit Cli(std::string); 27 | explicit Cli(Occ model); 28 | Cli(); 29 | 30 | auto getOption() -> Occ; 31 | auto set(const std::string& opt) -> void; 32 | auto getStringOptions() -> std::string; 33 | 34 | auto addToReport(Neon::Report& report, Neon::Report::SubBlock& subBlock)->void; 35 | auto addToReport(Neon::Report& report)->void; 36 | 37 | private: 38 | bool mSet = false; 39 | Occ mOption; 40 | }; 41 | }; 42 | 43 | 44 | } // namespace Neon::skeleton -------------------------------------------------------------------------------- /libNeonSkeleton/include/Neon/skeleton/Options.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "Neon/Report.h" 3 | #include "Neon/set/Backend.h" 4 | #include "Neon/set/Containter.h" 5 | #include "Neon/skeleton/Executor.h" 6 | #include "Neon/skeleton/Occ.h" 7 | 8 | namespace Neon::skeleton { 9 | 10 | 11 | struct Options 12 | { 13 | public: 14 | /** 15 | * Constructor that defines options for the skeleton 16 | */ 17 | explicit Options(Occ occ, Neon::set::TransferMode transferMode = Neon::set::TransferMode::get); 18 | explicit Options() = default; 19 | 20 | void reportStore(Neon::Report& report); 21 | 22 | auto occ() const -> Occ; 23 | auto transferMode() const -> Neon::set::TransferMode; 24 | auto executor()const -> Neon::skeleton::Executor; 25 | 26 | private: 27 | Neon::set::TransferMode mTransferMode{Neon::set::TransferMode::get}; 28 | Neon::skeleton::Occ mOcc = Occ::none; 29 | Neon::skeleton::Executor mExecutor = Neon::skeleton::Executor::ompAtNodeLevel; 30 | }; 31 | 32 | } // namespace Neon::skeleton -------------------------------------------------------------------------------- /libNeonSkeleton/include/Neon/skeleton/internal/dependencyTools/DependencyAnalyser.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "Neon/set/Backend.h" 3 | #include "Neon/skeleton/internal/dependencyTools/DataDependency.h" 4 | 5 | namespace Neon::skeleton::internal { 6 | 7 | 8 | /** 9 | * Stores type of operations on data for each kernels while user code is "parsed" 10 | * It is used to construct the user kernel dependency graph 11 | */ 12 | struct DependencyAnalyser 13 | { 14 | private: 15 | std::vector mParsedR{}; 16 | std::vector mParsedW{}; 17 | 18 | Neon::set::dataDependency::MultiXpuDataUid mUid; 19 | Neon::set::dataDependency::MultiXpuDataIdx mIdx; 20 | 21 | public: 22 | DependencyAnalyser() = delete; 23 | DependencyAnalyser(Neon::set::dataDependency::MultiXpuDataUid, 24 | Neon::set::dataDependency::MultiXpuDataIdx); 25 | 26 | auto update(Neon::set::container::GraphInfo::NodeUid newKernel, 27 | Neon::set::dataDependency::AccessType newOp) 28 | -> std::vector; 29 | }; 30 | 31 | } // namespace Neon::skeleton::internal -------------------------------------------------------------------------------- /libNeonSkeleton/src/skeleton/Options.cpp: -------------------------------------------------------------------------------- 1 | #include "Neon/skeleton/Options.h" 2 | 3 | namespace Neon { 4 | namespace skeleton { 5 | 6 | Options::Options(Occ occEOpt, 7 | Neon::set::TransferMode trensferModeOpt) 8 | { 9 | mOcc = occEOpt; 10 | mTransferMode = trensferModeOpt; 11 | } 12 | 13 | void Options::reportStore(Neon::Report& report) 14 | { 15 | 16 | auto subdoc = report.getSubdoc(); 17 | report.addMember("OCC", OccUtils::toString(mOcc), &subdoc); 18 | report.addMember("TransferMode", Neon::set::TransferModeUtils::toString(mTransferMode), &subdoc); 19 | report.addSubdoc("SkeletonOptions", subdoc); 20 | } 21 | 22 | auto Options::occ() const -> Occ 23 | { 24 | return mOcc; 25 | } 26 | 27 | auto Options::transferMode() const -> Neon::set::TransferMode 28 | { 29 | return mTransferMode; 30 | } 31 | auto Options::executor() const -> Neon::skeleton::Executor 32 | { 33 | return mExecutor; 34 | } 35 | 36 | } // namespace skeleton 37 | } // namespace Neon -------------------------------------------------------------------------------- /libNeonSkeleton/src/skeleton/Skeleton.cpp: -------------------------------------------------------------------------------- 1 | #include "Neon/skeleton/Skeleton.h" 2 | 3 | namespace Neon { 4 | namespace skeleton { 5 | 6 | 7 | Skeleton::Skeleton(const Neon::Backend& bk) 8 | { 9 | setBackend(bk); 10 | m_inited = true; 11 | } 12 | 13 | void Skeleton::setBackend(const Neon::Backend& bk) 14 | { 15 | mBackend = bk; 16 | } 17 | 18 | } // namespace skeleton 19 | } // namespace Neon -------------------------------------------------------------------------------- /libNeonSkeleton/src/skeleton/depencencyTools/UserDataManager.cpp: -------------------------------------------------------------------------------- 1 | #include "Neon/skeleton/internal/dependencyTools/UserDataManager.h" 2 | 3 | namespace Neon::skeleton::internal { 4 | 5 | auto UserDataManager::helpGetIdx(Neon::set::dataDependency::MultiXpuDataUid uid) 6 | -> Neon::set::dataDependency::MultiXpuDataIdx 7 | { 8 | auto count = mUid2Idx.count(uid); 9 | if (count == 0) { 10 | Neon::set::dataDependency::MultiXpuDataIdx idx = mDepAnalyserVec.size(); 11 | mDepAnalyserVec.emplace_back(uid, idx); 12 | mUid2Idx[uid] = idx; 13 | return idx; 14 | } 15 | return mUid2Idx[uid]; 16 | } 17 | 18 | auto UserDataManager::updateStatus(Neon::set::container::GraphInfo::NodeUid nodeUid, 19 | Neon::set::dataDependency::AccessType op, 20 | Neon::set::dataDependency::MultiXpuDataUid dataUid) 21 | -> std::vector 22 | { 23 | auto idx = helpGetIdx(dataUid); 24 | auto depVec = mDepAnalyserVec[idx].update(nodeUid, op); 25 | return depVec; 26 | } 27 | 28 | } // namespace Neon::skeleton::internal 29 | -------------------------------------------------------------------------------- /libNeonSkeleton/tests/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.19 FATAL_ERROR) 2 | 3 | add_subdirectory("unit") 4 | add_subdirectory("perf") 5 | -------------------------------------------------------------------------------- /libNeonSkeleton/tests/perf/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.19 FATAL_ERROR) 2 | 3 | add_subdirectory("sPt_AXPY_Laplacian") 4 | add_subdirectory("SkeletonSyntheticBenchmarks") -------------------------------------------------------------------------------- /libNeonSkeleton/tests/perf/SkeletonSyntheticBenchmarks/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.19 FATAL_ERROR) 2 | 3 | file(GLOB_RECURSE SrcFiles src/*.*) 4 | 5 | add_executable(skeletonSyntheticBenchmarks ${SrcFiles}) 6 | 7 | target_link_libraries(skeletonSyntheticBenchmarks 8 | PUBLIC libNeonSkeleton) 9 | 10 | set_target_properties(skeletonSyntheticBenchmarks PROPERTIES 11 | CUDA_SEPARABLE_COMPILATION ON 12 | CUDA_RESOLVE_DEVICE_SYMBOLS ON) 13 | 14 | set_target_properties(skeletonSyntheticBenchmarks PROPERTIES FOLDER "libNeonSkeleton") 15 | source_group(TREE ${CMAKE_CURRENT_LIST_DIR} PREFIX "skeletonSyntheticBenchmarks" FILES ${SrcFiles}) -------------------------------------------------------------------------------- /libNeonSkeleton/tests/perf/SkeletonSyntheticBenchmarks/src/CLiApps.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "Neon/Report.h" 3 | #include "Neon/set/Backend.h" 4 | #include "Neon/set/Containter.h" 5 | 6 | namespace Cli { 7 | 8 | enum class Apps 9 | { 10 | map, 11 | mapMapMap, 12 | }; 13 | 14 | struct AppsUtils 15 | { 16 | static constexpr int nOptions = 2; 17 | 18 | static auto toString(Apps option) -> std::string; 19 | static auto toInt(Apps option) -> int; 20 | static auto fromString(const std::string& option) -> Apps; 21 | static auto fromInt(int option) -> Apps; 22 | 23 | static auto getOptions() -> std::array; 24 | 25 | struct Cli 26 | { 27 | explicit Cli(std::string); 28 | explicit Cli(Apps model); 29 | Cli(); 30 | 31 | auto getOption() -> Apps; 32 | auto getStringOptions() -> std::string; 33 | auto set(const std::string& opt) -> void; 34 | 35 | auto addToReport(Neon::Report& report, Neon::Report::SubBlock& subBlock) -> void; 36 | auto addToReport(Neon::Report& report) -> void; 37 | 38 | private: 39 | bool mSet = false; 40 | Apps mOption; 41 | }; 42 | }; 43 | 44 | 45 | } // namespace Cli -------------------------------------------------------------------------------- /libNeonSkeleton/tests/perf/SkeletonSyntheticBenchmarks/src/CLiCardinality.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "Neon/Report.h" 3 | #include "Neon/set/Backend.h" 4 | #include "Neon/set/Containter.h" 5 | 6 | namespace Cli { 7 | 8 | enum class Cardinality 9 | { 10 | one, 11 | three, 12 | nineteen 13 | }; 14 | 15 | struct CardinalityUtils 16 | { 17 | static constexpr int nOptions = 3; 18 | 19 | static auto toString(Cardinality option) -> std::string; 20 | static auto toInt(Cardinality option) -> int; 21 | static auto fromString(const std::string& option) -> Cardinality; 22 | static auto fromInt(int option) -> Cardinality; 23 | 24 | static auto getOptions() -> std::array; 25 | 26 | struct Cli 27 | { 28 | explicit Cli(std::string); 29 | explicit Cli(Cardinality model); 30 | Cli(); 31 | 32 | auto getOption() -> Cardinality; 33 | auto getStringOptions() -> std::string; 34 | auto set(const std::string& opt) -> void; 35 | 36 | auto addToReport(Neon::Report& report, Neon::Report::SubBlock& subBlock) -> void; 37 | auto addToReport(Neon::Report& report) -> void; 38 | 39 | private: 40 | bool mSet = false; 41 | Cardinality mOption; 42 | }; 43 | }; 44 | 45 | 46 | } // namespace Cli -------------------------------------------------------------------------------- /libNeonSkeleton/tests/perf/SkeletonSyntheticBenchmarks/src/CLiCorrectness.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "Neon/Report.h" 3 | #include "Neon/set/Backend.h" 4 | #include "Neon/set/Containter.h" 5 | 6 | namespace Cli { 7 | 8 | enum class Correctnesss 9 | { 10 | on, 11 | off, 12 | }; 13 | 14 | struct CorrectnesssUtils 15 | { 16 | static constexpr int nOptions = 2; 17 | 18 | static auto toString(Correctnesss option) -> std::string; 19 | static auto toInt(Correctnesss option) -> int; 20 | static auto fromString(const std::string& option) -> Correctnesss; 21 | static auto fromInt(int option) -> Correctnesss; 22 | 23 | static auto getOptions() -> std::array; 24 | 25 | struct Cli 26 | { 27 | explicit Cli(std::string); 28 | explicit Cli(Correctnesss model); 29 | Cli(); 30 | 31 | auto getOption() -> Correctnesss; 32 | auto getStringOptions() -> std::string; 33 | auto set(const std::string& opt) -> void; 34 | 35 | auto addToReport(Neon::Report& report, Neon::Report::SubBlock& subBlock) -> void; 36 | auto addToReport(Neon::Report& report) -> void; 37 | 38 | private: 39 | bool mSet = false; 40 | Correctnesss mOption; 41 | }; 42 | }; 43 | 44 | 45 | } // namespace Cli -------------------------------------------------------------------------------- /libNeonSkeleton/tests/perf/SkeletonSyntheticBenchmarks/src/CLiType.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "Neon/Report.h" 3 | #include "Neon/set/Backend.h" 4 | #include "Neon/set/Containter.h" 5 | #include "Neon/Report.h" 6 | 7 | namespace Cli { 8 | 9 | enum class Type 10 | { 11 | INT64, 12 | DOUBLE 13 | }; 14 | 15 | struct TypeUtils 16 | { 17 | static constexpr int nOptions = 2; 18 | 19 | static auto toString(Type type) -> std::string; 20 | static auto toInt(Type type) -> int; 21 | static auto fromString(const std::string& type) -> Type; 22 | static auto fromInt(int type) -> Type; 23 | static auto getOptions() -> std::array; 24 | 25 | struct Cli 26 | { 27 | explicit Cli(std::string); 28 | explicit Cli(Type model); 29 | Cli(); 30 | 31 | auto getOption() -> Type; 32 | auto getStringOptions() -> std::string; 33 | auto set(const std::string& opt) -> void; 34 | 35 | auto addToReport(Neon::Report& report, Neon::Report::SubBlock& subBlock)->void; 36 | auto addToReport(Neon::Report& report)->void; 37 | 38 | private: 39 | bool mSet = false; 40 | Type mOption; 41 | }; 42 | }; 43 | 44 | 45 | } // namespace Cli -------------------------------------------------------------------------------- /libNeonSkeleton/tests/perf/SkeletonSyntheticBenchmarks/src/GridType.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "Neon/Report.h" 3 | #include "Neon/set/Backend.h" 4 | #include "Neon/set/Containter.h" 5 | 6 | namespace Cli { 7 | 8 | enum class GridType 9 | { 10 | eGrid, 11 | dGrid, 12 | bGrid 13 | }; 14 | 15 | struct GridTypeUtils 16 | { 17 | static constexpr int nOptions = 3; 18 | 19 | static auto toString(GridType option) -> std::string; 20 | static auto toInt(GridType option) -> int; 21 | static auto fromString(const std::string& option) -> GridType; 22 | static auto fromInt(int option) -> GridType; 23 | 24 | static auto getOptions() -> std::array; 25 | 26 | struct Cli 27 | { 28 | explicit Cli(std::string); 29 | explicit Cli(GridType model); 30 | Cli(); 31 | 32 | auto getOption() -> GridType; 33 | auto getStringOptions() -> std::string; 34 | auto set(const std::string& opt) -> void; 35 | 36 | auto addToReport(Neon::Report& report, Neon::Report::SubBlock& subBlock) -> void; 37 | auto addToReport(Neon::Report& report) -> void; 38 | 39 | private: 40 | bool mSet = false; 41 | GridType mOption; 42 | }; 43 | }; 44 | 45 | 46 | } // namespace Cli -------------------------------------------------------------------------------- /libNeonSkeleton/tests/perf/SkeletonSyntheticBenchmarks/src/RunTest.h: -------------------------------------------------------------------------------- 1 | 2 | #include "Neon/Neon.h" 3 | #include "Neon/Report.h" 4 | #include "Neon/domain/eGrid.h" 5 | #include "Neon/domain/tools/TestData.h" 6 | #include "UserData.h" 7 | 8 | #include "Neon/skeleton/Skeleton.h" 9 | 10 | #include 11 | 12 | namespace Test { 13 | auto Run(Cli::UserData& userData, 14 | Neon::Report& report)-> void; 15 | } // namespace Test -------------------------------------------------------------------------------- /libNeonSkeleton/tests/perf/SkeletonSyntheticBenchmarks/src/containers/Axpy.h: -------------------------------------------------------------------------------- 1 | #include "Neon/domain/dGrid.h" 2 | #include "Neon/domain/eGrid.h" 3 | #include "Neon/set/DevSet.h" 4 | #include "Neon/skeleton/Skeleton.h" 5 | 6 | namespace Test::containers { 7 | 8 | template 9 | auto axpy(const Field& A_g, 10 | const typename Field::Type alpha, 11 | Field& C_g) -> Neon::set::Container 12 | { 13 | auto c = A_g.getGrid().newContainer( 14 | "axpy", [&A_g, &C_g, alpha](Neon::set::Loader& L) -> auto { 15 | auto& A = L.load(A_g); 16 | auto& C = L.load(C_g); 17 | const int CardField = A_g.getCardinality(); 18 | return [A, C, alpha, CardField] NEON_CUDA_HOST_DEVICE(const typename Field::Idx& cell) mutable { 19 | if constexpr (CardinalityTest == 1) { 20 | C(cell, 0) += alpha * A(cell, 0); 21 | } else { 22 | for (int card = 0; card < CardField; card++) { 23 | C(cell, card) += alpha * A(cell, card); 24 | } 25 | } 26 | }; 27 | }); 28 | return c; 29 | } 30 | 31 | } // namespace Test::containers 32 | -------------------------------------------------------------------------------- /libNeonSkeleton/tests/perf/SkeletonSyntheticBenchmarks/src/containers/Sum.h: -------------------------------------------------------------------------------- 1 | #include "Neon/domain/dGrid.h" 2 | #include "Neon/domain/eGrid.h" 3 | #include "Neon/set/DevSet.h" 4 | #include "Neon/skeleton/Skeleton.h" 5 | 6 | namespace Test { 7 | namespace containers { 8 | 9 | template 10 | auto sum(const Field& A_g, 11 | const Field& B_g, 12 | Field& C_g) -> Neon::set::Container 13 | { 14 | auto container = A_g.getGrid().newContainer( 15 | "sum", [&A_g, &C_g, &B_g](Neon::set::Loader& L) -> auto { 16 | auto& A = L.load(A_g); 17 | auto& B = L.load(B_g); 18 | auto& C = L.load(C_g); 19 | 20 | return [A, C] NEON_CUDA_HOST_DEVICE(const typename Field::Cell& cell) mutable { 21 | C(cell, 0) += alpha * A(cell, 0); 22 | }; 23 | }); 24 | return container; 25 | } 26 | 27 | } // namespace containers 28 | } // namespace Test 29 | -------------------------------------------------------------------------------- /libNeonSkeleton/tests/perf/sPt_AXPY_Laplacian/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.19 FATAL_ERROR) 2 | 3 | file(GLOB_RECURSE SrcFiles src/*.*) 4 | 5 | add_executable(sPt_AXPY_Laplacian ${SrcFiles}) 6 | 7 | target_link_libraries(sPt_AXPY_Laplacian 8 | PUBLIC libNeonSkeleton 9 | PUBLIC gtest_main) 10 | 11 | set_target_properties(sPt_AXPY_Laplacian PROPERTIES 12 | CUDA_SEPARABLE_COMPILATION ON 13 | CUDA_RESOLVE_DEVICE_SYMBOLS ON) 14 | set_target_properties(sPt_AXPY_Laplacian PROPERTIES FOLDER "libNeonSkeleton") 15 | source_group(TREE ${CMAKE_CURRENT_LIST_DIR} PREFIX "sPt_AXPY_Laplacian" FILES ${SrcFiles}) -------------------------------------------------------------------------------- /libNeonSkeleton/tests/unit/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.19 FATAL_ERROR) 2 | 3 | add_subdirectory("skeleton-maps") 4 | add_subdirectory("skeleton-stencil") 5 | 6 | add_subdirectory("sUt_skeletonOnStreams") 7 | add_subdirectory("sUt_userInterface") 8 | add_subdirectory("sUt_multiRes") -------------------------------------------------------------------------------- /libNeonSkeleton/tests/unit/sUt_multiRes/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.19 FATAL_ERROR) 2 | 3 | file(GLOB_RECURSE SrcFiles src/*.*) 4 | 5 | add_executable(sUt_multiRes ${SrcFiles}) 6 | 7 | target_link_libraries(sUt_multiRes 8 | PUBLIC libNeonSkeleton 9 | PUBLIC gtest_main) 10 | 11 | set_target_properties(sUt_multiRes PROPERTIES 12 | CUDA_SEPARABLE_COMPILATION ON 13 | CUDA_RESOLVE_DEVICE_SYMBOLS ON) 14 | set_target_properties(sUt_multiRes PROPERTIES FOLDER "libNeonSkeleton") 15 | source_group(TREE ${CMAKE_CURRENT_LIST_DIR} PREFIX "sUt_multiRes" FILES ${SrcFiles}) 16 | 17 | add_test(NAME sUt_multiRes COMMAND sUt_multiRes) -------------------------------------------------------------------------------- /libNeonSkeleton/tests/unit/sUt_multiRes/src/sUt_multiRes.cu: -------------------------------------------------------------------------------- 1 | #include "gtest/gtest.h" 2 | 3 | #include "Neon/Neon.h" 4 | 5 | #include "Neon/domain/mGrid.h" 6 | 7 | #include "Neon/skeleton/Options.h" 8 | #include "Neon/skeleton/Skeleton.h" 9 | 10 | #include "MultiResChild.h" 11 | #include "MultiResDemo.h" 12 | #include "MultiResMap.h" 13 | #include "MultiResParent.h" 14 | #include "MultiResSkeleton.h" 15 | #include "MultiResStencil.h" 16 | 17 | int main(int argc, char** argv) 18 | { 19 | ::testing::InitGoogleTest(&argc, argv); 20 | Neon::init(); 21 | return RUN_ALL_TESTS(); 22 | } -------------------------------------------------------------------------------- /libNeonSkeleton/tests/unit/sUt_skeletonOnStreams/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.19 FATAL_ERROR) 2 | 3 | file(GLOB_RECURSE SrcFiles src/*.*) 4 | 5 | add_executable(sUt_skeletonOnStreams ${SrcFiles}) 6 | 7 | target_link_libraries(sUt_skeletonOnStreams 8 | PUBLIC libNeonSkeleton 9 | PUBLIC gtest_main) 10 | 11 | set_target_properties(sUt_skeletonOnStreams PROPERTIES 12 | CUDA_SEPARABLE_COMPILATION ON 13 | CUDA_RESOLVE_DEVICE_SYMBOLS ON) 14 | set_target_properties(sUt_skeletonOnStreams PROPERTIES FOLDER "libNeonSkeleton") 15 | source_group(TREE ${CMAKE_CURRENT_LIST_DIR} PREFIX "sUt_skeletonOnStreams" FILES ${SrcFiles}) 16 | 17 | add_test(NAME sUt_skeletonOnStreams COMMAND sUt_skeletonOnStreams) -------------------------------------------------------------------------------- /libNeonSkeleton/tests/unit/sUt_skeletonOnStreams/src/sUt_skeleton.main.cpp: -------------------------------------------------------------------------------- 1 | #include "gtest/gtest.h" 2 | 3 | #include "Neon/Neon.h" 4 | 5 | #include 6 | 7 | int main(int argc, char** argv) 8 | { 9 | ::testing::InitGoogleTest(&argc, argv); 10 | Neon::init(); 11 | return RUN_ALL_TESTS(); 12 | } 13 | -------------------------------------------------------------------------------- /libNeonSkeleton/tests/unit/sUt_userInterface/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.19 FATAL_ERROR) 2 | 3 | file(GLOB_RECURSE SrcFiles src/*.*) 4 | 5 | add_executable(sUt_userInterface ${SrcFiles}) 6 | 7 | target_link_libraries(sUt_userInterface 8 | PUBLIC libNeonSkeleton 9 | PUBLIC gtest_main) 10 | 11 | set_target_properties(sUt_userInterface PROPERTIES 12 | CUDA_SEPARABLE_COMPILATION ON 13 | CUDA_RESOLVE_DEVICE_SYMBOLS ON) 14 | set_target_properties(sUt_userInterface PROPERTIES FOLDER "libNeonSkeleton") 15 | source_group(TREE ${CMAKE_CURRENT_LIST_DIR} PREFIX "sUt_userInterface" FILES ${SrcFiles}) 16 | 17 | add_test(NAME sUt_userInterface COMMAND sUt_userInterface) -------------------------------------------------------------------------------- /libNeonSkeleton/tests/unit/sUt_userInterface/src/sUt_main.cpp: -------------------------------------------------------------------------------- 1 | #include "gtest/gtest.h" 2 | #include 3 | 4 | #include "Neon/Neon.h" 5 | 6 | #include "Neon/core/core.h" 7 | #include "sUt_common.h" 8 | using namespace Neon; 9 | using namespace Neon::domain; 10 | 11 | 12 | int main(int argc, char** argv) 13 | { 14 | ::testing::InitGoogleTest(&argc, argv); 15 | Neon::init(); 16 | return RUN_ALL_TESTS(); 17 | } 18 | -------------------------------------------------------------------------------- /libNeonSkeleton/tests/unit/sUt_userInterface/src/sUt_tests.cu: -------------------------------------------------------------------------------- 1 | #include 2 | #include "Neon/domain/details/aGrid//aGrid.h" 3 | #include "Neon/domain/dGrid.h" 4 | #include "Neon/domain/eGrid.h" 5 | #include "gtest/gtest.h" 6 | #include "sUt_common.h" 7 | 8 | #include "sUt_add.h" 9 | 10 | int dummy() 11 | { 12 | return 0; 13 | } -------------------------------------------------------------------------------- /libNeonSkeleton/tests/unit/skeleton-maps/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.19 FATAL_ERROR) 2 | 3 | file(GLOB_RECURSE SrcFiles src/*.*) 4 | 5 | add_executable(skeleton-map ${SrcFiles}) 6 | 7 | target_link_libraries(skeleton-map 8 | PUBLIC libNeonSkeleton 9 | PUBLIC gtest_main) 10 | 11 | set_target_properties(skeleton-map PROPERTIES 12 | CUDA_SEPARABLE_COMPILATION ON 13 | CUDA_RESOLVE_DEVICE_SYMBOLS ON) 14 | set_target_properties(skeleton-map PROPERTIES FOLDER "libNeonSkeleton") 15 | source_group(TREE ${CMAKE_CURRENT_LIST_DIR} PREFIX "skeleton-map" FILES ${SrcFiles}) 16 | 17 | add_test(NAME skeleton-map COMMAND skeleton-map) -------------------------------------------------------------------------------- /libNeonSkeleton/tests/unit/skeleton-maps/src/main.cpp: -------------------------------------------------------------------------------- 1 | #include "gtest/gtest.h" 2 | 3 | #include "Neon/Neon.h" 4 | 5 | #include 6 | 7 | int main(int argc, char** argv) 8 | { 9 | ::testing::InitGoogleTest(&argc, argv); 10 | Neon::init(); 11 | return RUN_ALL_TESTS(); 12 | } 13 | -------------------------------------------------------------------------------- /libNeonSkeleton/tests/unit/skeleton-stencil/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.19 FATAL_ERROR) 2 | 3 | file(GLOB_RECURSE SrcFiles src/*.*) 4 | 5 | add_executable(skeleton-stencil ${SrcFiles}) 6 | 7 | target_link_libraries(skeleton-stencil 8 | PUBLIC libNeonSkeleton 9 | PUBLIC gtest_main) 10 | 11 | set_target_properties(skeleton-stencil PROPERTIES 12 | CUDA_SEPARABLE_COMPILATION ON 13 | CUDA_RESOLVE_DEVICE_SYMBOLS ON) 14 | set_target_properties(skeleton-stencil PROPERTIES FOLDER "libNeonSkeleton") 15 | source_group(TREE ${CMAKE_CURRENT_LIST_DIR} PREFIX "skeleton-stencil" FILES ${SrcFiles}) 16 | 17 | add_test(NAME skeleton-stencil COMMAND skeleton-stencil) -------------------------------------------------------------------------------- /libNeonSkeleton/tests/unit/skeleton-stencil/src/main.cpp: -------------------------------------------------------------------------------- 1 | #include "gtest/gtest.h" 2 | 3 | #include "Neon/Neon.h" 4 | 5 | #include "Neon/core/types/chrono.h" 6 | 7 | #include "Neon/domain/dGrid.h" 8 | #include "Neon/domain/tools/Geometries.h" 9 | #include "Neon/domain/tools/TestData.h" 10 | 11 | #include "Neon/skeleton/Options.h" 12 | #include "Neon/skeleton/Skeleton.h" 13 | 14 | using namespace Neon::domain::tool::testing; 15 | 16 | int main(int argc, char** argv) 17 | { 18 | ::testing::InitGoogleTest(&argc, argv); 19 | Neon::init(); 20 | return RUN_ALL_TESTS(); 21 | } -------------------------------------------------------------------------------- /libNeonSolver/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.19 FATAL_ERROR) 2 | 3 | file(GLOB_RECURSE libNeonSolverFiles include/*.* src/*.*) 4 | 5 | if (${BUILD_NEON_SHARED_LIBS}) 6 | add_library(libNeonSolver SHARED ${libNeonSolverFiles}) 7 | message( STATUS "Configuring libNeonSolver as a shared library...") 8 | set_target_properties(libNeonSet PROPERTIES WINDOWS_EXPORT_ALL_SYMBOLS ON) 9 | else () 10 | add_library(libNeonSolver STATIC ${libNeonSolverFiles}) 11 | message( STATUS "Configuring libNeonSolver as a static library...") 12 | endif() 13 | 14 | target_link_libraries(libNeonSolver 15 | PUBLIC NeonDeveloperLib 16 | PUBLIC libNeonCore 17 | PUBLIC libNeonSys 18 | PUBLIC libNeonSet 19 | PUBLIC libNeonDomain 20 | PUBLIC libNeonSkeleton) 21 | 22 | include("${PROJECT_SOURCE_DIR}/cmake/ExportHeader.cmake") 23 | ExportHeader(libNeonSet) 24 | 25 | set_target_properties(libNeonSolver PROPERTIES 26 | CUDA_SEPARABLE_COMPILATION ON 27 | CUDA_RESOLVE_DEVICE_SYMBOLS ON) 28 | target_include_directories(libNeonSolver PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/include/") 29 | 30 | source_group(TREE ${CMAKE_CURRENT_LIST_DIR} PREFIX "libNeonSolver" FILES ${libNeonSolverFiles}) 31 | 32 | if (${BUILD_NEON_TESTING}) 33 | add_subdirectory("tests") 34 | endif() -------------------------------------------------------------------------------- /libNeonSolver/tests/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.19 FATAL_ERROR) 2 | 3 | add_subdirectory("unit") 4 | add_subdirectory("perf") 5 | add_subdirectory("poisson") 6 | -------------------------------------------------------------------------------- /libNeonSolver/tests/perf/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.19 FATAL_ERROR) 2 | 3 | add_subdirectory("solverPt_Poisson") -------------------------------------------------------------------------------- /libNeonSolver/tests/perf/solverPt_Poisson/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.19 FATAL_ERROR) 2 | 3 | file(GLOB_RECURSE SrcFiles src/*.*) 4 | 5 | add_executable(solverPt_Poisson ${SrcFiles}) 6 | 7 | target_link_libraries(solverPt_Poisson 8 | PUBLIC libNeonSolver 9 | PUBLIC poisson 10 | PUBLIC gtest_main) 11 | 12 | set_target_properties(solverPt_Poisson PROPERTIES 13 | CUDA_SEPARABLE_COMPILATION ON 14 | CUDA_RESOLVE_DEVICE_SYMBOLS ON) 15 | set_target_properties(solverPt_Poisson PROPERTIES FOLDER "libNeonSolver") 16 | source_group(TREE ${CMAKE_CURRENT_LIST_DIR} PREFIX "solverPt_Poisson" FILES ${SrcFiles}) 17 | 18 | add_test(NAME solverPt_Poisson COMMAND solverPt_Poisson) -------------------------------------------------------------------------------- /libNeonSolver/tests/poisson/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.19 FATAL_ERROR) 2 | 3 | file(GLOB_RECURSE poissonFiles include/*.* src/*.*) 4 | 5 | add_library(poisson STATIC ${poissonFiles}) 6 | 7 | target_link_libraries(poisson PUBLIC libNeonSolver) 8 | 9 | target_include_directories(poisson PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/include/") 10 | 11 | set_target_properties(poisson PROPERTIES 12 | CUDA_SEPARABLE_COMPILATION ON 13 | CUDA_RESOLVE_DEVICE_SYMBOLS ON) 14 | set_target_properties(poisson PROPERTIES FOLDER "libNeonSolver") 15 | source_group(TREE ${CMAKE_CURRENT_LIST_DIR} PREFIX "poisson" FILES ${SrcFiles}) -------------------------------------------------------------------------------- /libNeonSolver/tests/unit/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.19 FATAL_ERROR) 2 | 3 | add_subdirectory("solverUt_Poisson") 4 | -------------------------------------------------------------------------------- /libNeonSolver/tests/unit/solverUt_Poisson/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.19 FATAL_ERROR) 2 | 3 | file(GLOB_RECURSE SrcFiles src/*.*) 4 | 5 | add_executable(solverUt_Poisson ${SrcFiles}) 6 | 7 | target_link_libraries(solverUt_Poisson 8 | PUBLIC libNeonSolver 9 | PUBLIC poisson 10 | PUBLIC gtest_main) 11 | 12 | set_target_properties(solverUt_Poisson PROPERTIES 13 | CUDA_SEPARABLE_COMPILATION ON 14 | CUDA_RESOLVE_DEVICE_SYMBOLS ON) 15 | set_target_properties(solverUt_Poisson PROPERTIES FOLDER "libNeonSolver") 16 | source_group(TREE ${CMAKE_CURRENT_LIST_DIR} PREFIX "solverUt_Poisson" FILES ${SrcFiles}) 17 | 18 | add_test(NAME solverUt_Poisson COMMAND solverUt_Poisson) -------------------------------------------------------------------------------- /libNeonSys/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.19 FATAL_ERROR) 2 | 3 | file(GLOB_RECURSE libNeonSysFiles include/*.* src/*.*) 4 | 5 | #set(CUDA_PROPAGATE_HOST_FLAGS ON) 6 | 7 | if(${BUILD_NEON_SHARED_LIBS}) 8 | add_library(libNeonSys SHARED ${libNeonSysFiles}) 9 | message( STATUS "Configuring libNeonSys as a shared library...") 10 | set_target_properties(libNeonSys PROPERTIES WINDOWS_EXPORT_ALL_SYMBOLS ON) 11 | else() 12 | add_library(libNeonSys STATIC ${libNeonSysFiles}) 13 | message( STATUS "Configuring libNeonSys as a static library...") 14 | endif() 15 | 16 | target_link_libraries(libNeonSys 17 | PUBLIC NeonDeveloperLib 18 | PUBLIC libNeonCore 19 | PUBLIC ${CUDA_cublas_LIBRARY} ${CUDA_cublas_device_LIBRARY}) 20 | 21 | include("${PROJECT_SOURCE_DIR}/cmake/ExportHeader.cmake") 22 | ExportHeader(libNeonSys) 23 | 24 | set_target_properties(libNeonSys PROPERTIES 25 | CUDA_SEPARABLE_COMPILATION ON 26 | CUDA_RESOLVE_DEVICE_SYMBOLS ON) 27 | 28 | target_include_directories(libNeonSys PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/include/") 29 | 30 | source_group(TREE ${CMAKE_CURRENT_LIST_DIR} PREFIX "libNeonSys" FILES ${libNeonSysFiles}) 31 | 32 | if (${BUILD_NEON_TESTING}) 33 | add_subdirectory("tests") 34 | endif() 35 | -------------------------------------------------------------------------------- /libNeonSys/include/Neon/Neon.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "Neon/sys/global/CpuSysGlobal.h" 3 | #include "Neon/sys/global/GpuSysGlobal.h" 4 | namespace Neon { 5 | 6 | void init(); 7 | 8 | } // namespace Neon 9 | -------------------------------------------------------------------------------- /libNeonSys/include/Neon/Report.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "Neon/core/tools/Report.h" 3 | 4 | 5 | namespace Neon { 6 | 7 | /** 8 | * Extends the base report in libNeonCore by adding host and device information to the report. 9 | * This is what the user should be using 10 | */ 11 | class Report : public core::Report 12 | { 13 | public: 14 | Report() = default; 15 | 16 | /** 17 | * Constructor with name of the record 18 | */ 19 | Report(const std::string& record_name); 20 | 21 | protected: 22 | /** 23 | * Adding gpus information to this report 24 | */ 25 | auto device() -> void; 26 | 27 | /** 28 | * Adding host information to this report 29 | */ 30 | auto system() -> void; 31 | }; 32 | 33 | 34 | } // namespace Neon -------------------------------------------------------------------------------- /libNeonSys/include/Neon/sys/devices/gpu/ComputeID.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | 4 | #include "Neon/core/core.h" 5 | #include "Neon/sys/devices/DevInterface.h" 6 | 7 | namespace Neon::sys { 8 | 9 | using ComputeID = DeviceID; 10 | 11 | } // namespace Neon::sys 12 | -------------------------------------------------------------------------------- /libNeonSys/include/Neon/sys/devices/gpu/GpuTools.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | #include 4 | 5 | namespace Neon { 6 | namespace sys { 7 | 8 | void gpuCheckLastError(const std::string& errorMsg); 9 | void gpuCheckLastError(); 10 | 11 | /** 12 | * @brief Converting cublas status to string 13 | * @param status the input status 14 | * @return a string of the status 15 | */ 16 | std::string cublasGetErrorString(cublasStatus_t status); 17 | 18 | 19 | } // namespace sys 20 | } // namespace Neon -------------------------------------------------------------------------------- /libNeonSys/include/Neon/sys/devices/memType.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | 6 | namespace Neon { 7 | namespace sys { 8 | 9 | struct mem_et 10 | { 11 | enum enum_e : int32_t 12 | { 13 | cpu = 0 /* used for cpu buffers */ 14 | , 15 | gpu = 1 /* used for cpu buffers */ 16 | , 17 | omp = cpu /* used for cpu buffers */ 18 | , 19 | host = cpu /* another name for cpu*/ 20 | , 21 | device = 2 /* general name for a device memory. It can be GPU or other */ 22 | }; 23 | 24 | mem_et(enum_e type); 25 | 26 | mem_et::enum_e type() const; 27 | 28 | static const char* name(enum_e type); 29 | 30 | const char* name() const; 31 | 32 | private: 33 | enum_e m_type; 34 | }; 35 | 36 | } // namespace sys 37 | } // namespace Neon 38 | -------------------------------------------------------------------------------- /libNeonSys/include/Neon/sys/global/CpuSysGlobal.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "Neon/sys/devices/cpu/CpuSys.h" 3 | #include "libneonsys_export.h" 4 | 5 | namespace Neon { 6 | namespace sys { 7 | namespace globalSpace { 8 | LIBNEONSYS_EXPORT extern CpuSys cpuSysObjStorage; 9 | 10 | CpuSys& cpuSysObj(); 11 | 12 | } // namespace globalSpace 13 | } // namespace sys 14 | } // namespace Neon 15 | -------------------------------------------------------------------------------- /libNeonSys/include/Neon/sys/global/GpuSysGlobal.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "Neon/sys/devices/gpu/GpuSys.h" 3 | #include "libneonsys_export.h" 4 | 5 | namespace Neon::sys::globalSpace { 6 | 7 | LIBNEONSYS_EXPORT extern GpuSys gpuSysObjStorage; 8 | 9 | GpuSys& gpuSysObj(); 10 | 11 | } // namespace Neon::sys::globalSpace -------------------------------------------------------------------------------- /libNeonSys/include/Neon/sys/memory/CudaIntrinsics.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "Neon/core/core.h" 3 | 4 | #ifdef NEON_COMPILER_CUDA 5 | #if (__CUDA_ARCH__ >= 350) 6 | #define NEON_CUDA_CONST_LOAD(ADDR) (__ldg(((ADDR)))) 7 | #else 8 | #define NEON_CUDA_CONST_LOAD(ADDR) (*((ADDR))) 9 | #endif 10 | #else 11 | #define NEON_CUDA_CONST_LOAD(ADDR) (*((ADDR))) 12 | #endif 13 | -------------------------------------------------------------------------------- /libNeonSys/include/Neon/sys/memory/memConf.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | #include "Neon/core/types/Allocator.h" 6 | #include "Neon/core/types/memOptions.h" 7 | #include "Neon/sys/devices/DevInterface.h" 8 | 9 | namespace Neon { 10 | namespace set { 11 | class DevSet; 12 | } 13 | namespace sys { 14 | 15 | } // namespace sys 16 | } // namespace Neon 17 | -------------------------------------------------------------------------------- /libNeonSys/src/sys/Neon.cpp: -------------------------------------------------------------------------------- 1 | #include "Neon/Neon.h" 2 | 3 | namespace Neon { 4 | void init() 5 | { 6 | ::Neon::sys::globalSpace::cpuSysObjStorage.init(); 7 | ::Neon::sys::globalSpace::gpuSysObjStorage.init(); 8 | } 9 | } // namespace Neon 10 | -------------------------------------------------------------------------------- /libNeonSys/src/sys/devices/cpu/cpuSys.cpp: -------------------------------------------------------------------------------- 1 | #include "Neon/sys/devices/cpu/CpuSys.h" 2 | #include "Neon/core/core.h" 3 | #include "Neon/sys/devices/cpu/CpuDevice.h" 4 | 5 | namespace Neon { 6 | namespace sys { 7 | 8 | 9 | CpuSys::CpuSys() 10 | : mInit(false) 11 | { 12 | } 13 | 14 | void CpuSys::init() 15 | { 16 | mInit = true; 17 | std::ostringstream msg; 18 | 19 | this->m_cpuDevVec.emplace_back(); 20 | this->m_cpuMemVec.emplace_back(this->m_cpuDevVec[0]); 21 | 22 | NEON_INFO("CpuSys_t: Loading info on CPU subsystem"); 23 | } 24 | 25 | const CpuDev& CpuSys::dev() const 26 | { 27 | const CpuDev& ret = this->m_cpuDevVec[0]; 28 | 29 | return ret; 30 | } 31 | 32 | CpuMem& CpuSys::allocator() 33 | { 34 | CpuMem& ret = this->m_cpuMemVec[0]; 35 | 36 | return ret; 37 | } 38 | 39 | int32_t CpuSys::numDevs() const 40 | { 41 | return static_cast(m_cpuMemVec.size()); 42 | } 43 | 44 | bool CpuSys::isInit() const 45 | { 46 | return mInit; 47 | } 48 | 49 | } // namespace sys 50 | } // End of namespace Neon -------------------------------------------------------------------------------- /libNeonSys/src/sys/devices/memType.cpp: -------------------------------------------------------------------------------- 1 | #include "Neon/sys/devices/memType.h" 2 | 3 | namespace Neon { 4 | namespace sys { 5 | 6 | 7 | mem_et::mem_et(enum_e type) 8 | : m_type(type){}; 9 | 10 | mem_et::enum_e mem_et::type() const 11 | { 12 | return m_type; 13 | } 14 | 15 | const char* mem_et::name(mem_et::enum_e type) 16 | { 17 | switch (type) { 18 | case mem_et::enum_e::cpu: { 19 | return "cpu"; 20 | } 21 | case mem_et::enum_e::gpu: { 22 | return "gpu"; 23 | } 24 | case mem_et::enum_e::device: { 25 | return "device"; 26 | } 27 | default: 28 | return nullptr; 29 | } 30 | } 31 | 32 | const char* mem_et::name() const 33 | { 34 | return this->name(m_type); 35 | } 36 | 37 | } // namespace sys 38 | } // namespace Neon 39 | -------------------------------------------------------------------------------- /libNeonSys/src/sys/global/cpuSysGlobal.cpp: -------------------------------------------------------------------------------- 1 | #include "Neon/sys/global/CpuSysGlobal.h" 2 | #include "libneonsys_export.h" 3 | 4 | namespace Neon { 5 | namespace sys { 6 | namespace globalSpace { 7 | 8 | LIBNEONSYS_EXPORT CpuSys cpuSysObjStorage; 9 | 10 | CpuSys& cpuSysObj() 11 | { 12 | return cpuSysObjStorage; 13 | } 14 | 15 | } // namespace globalSpace 16 | } // namespace sys 17 | } // End of namespace Neon 18 | -------------------------------------------------------------------------------- /libNeonSys/src/sys/global/gpuSysGlobal.cpp: -------------------------------------------------------------------------------- 1 | #include "Neon/sys/global/GpuSysGlobal.h" 2 | #include "libneonsys_export.h" 3 | 4 | namespace Neon { 5 | namespace sys { 6 | namespace globalSpace { 7 | 8 | LIBNEONSYS_EXPORT GpuSys gpuSysObjStorage; 9 | 10 | GpuSys& gpuSysObj() 11 | { 12 | return gpuSysObjStorage; 13 | } 14 | 15 | } // namespace globalSpace 16 | } // namespace sys 17 | } // End of namespace Neon 18 | -------------------------------------------------------------------------------- /libNeonSys/tests/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.19 FATAL_ERROR) 2 | 3 | add_subdirectory("unit") -------------------------------------------------------------------------------- /libNeonSys/tests/unit/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.19 FATAL_ERROR) 2 | 3 | add_subdirectory("sysUt_devCpu") 4 | add_subdirectory("sysUt_devGpu") 5 | add_subdirectory("sysUt_devGpuNvcc") 6 | add_subdirectory("sysUt_mem") 7 | add_subdirectory("sysUt_patterns") 8 | add_subdirectory("sysUt_report") 9 | 10 | -------------------------------------------------------------------------------- /libNeonSys/tests/unit/sysUt_devCpu/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.19 FATAL_ERROR) 2 | 3 | file(GLOB_RECURSE SrcFiles src/*.*) 4 | 5 | add_executable(sysUt_devCpu ${SrcFiles}) 6 | 7 | target_link_libraries(sysUt_devCpu 8 | PUBLIC libNeonSys 9 | PUBLIC gtest_main) 10 | 11 | set_target_properties(sysUt_devCpu PROPERTIES FOLDER "libNeonSys") 12 | source_group(TREE ${CMAKE_CURRENT_LIST_DIR} PREFIX "sysUt_devCpu" FILES ${SrcFiles}) 13 | 14 | add_test(NAME sysUt_devCpu COMMAND sysUt_devCpu) -------------------------------------------------------------------------------- /libNeonSys/tests/unit/sysUt_devCpu/src/testCount.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include "gtest/gtest.h" 3 | 4 | #include "Neon/Neon.h" 5 | 6 | #include "Neon/sys/devices/cpu/CpuDevice.h" 7 | #include 8 | #include 9 | 10 | TEST(cpuDev, memory) 11 | { 12 | Neon::sys::CpuDev cpuDev; 13 | auto res = cpuDev.info(); 14 | NEON_INFO("GoogleTest::cpuDev {}", res); 15 | } 16 | 17 | 18 | int main(int argc, char** argv) 19 | { 20 | ::testing::InitGoogleTest(&argc, argv); 21 | Neon::init(); 22 | return RUN_ALL_TESTS(); 23 | } 24 | -------------------------------------------------------------------------------- /libNeonSys/tests/unit/sysUt_devGpu/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.19 FATAL_ERROR) 2 | 3 | file(GLOB_RECURSE SrcFiles src/*.*) 4 | 5 | add_executable(sysUt_devGpu ${SrcFiles}) 6 | 7 | target_link_libraries(sysUt_devGpu 8 | PUBLIC libNeonSys 9 | PUBLIC gtest_main) 10 | 11 | set_target_properties(sysUt_devGpu PROPERTIES FOLDER "libNeonSys") 12 | source_group(TREE ${CMAKE_CURRENT_LIST_DIR} PREFIX "sysUt_devGpu" FILES ${SrcFiles}) 13 | 14 | add_test(NAME sysUt_devGpu COMMAND sysUt_devGpu) -------------------------------------------------------------------------------- /libNeonSys/tests/unit/sysUt_devGpuNvcc/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.19 FATAL_ERROR) 2 | 3 | file(GLOB_RECURSE SrcFiles src/*.*) 4 | 5 | add_executable(sysUt_devGpuNvcc ${SrcFiles}) 6 | 7 | target_link_libraries(sysUt_devGpuNvcc 8 | PUBLIC libNeonSys 9 | PUBLIC gtest_main) 10 | 11 | set_target_properties(sysUt_devGpuNvcc PROPERTIES 12 | CUDA_SEPARABLE_COMPILATION ON 13 | CUDA_RESOLVE_DEVICE_SYMBOLS ON) 14 | set_target_properties(sysUt_devGpuNvcc PROPERTIES FOLDER "libNeonSys") 15 | source_group(TREE ${CMAKE_CURRENT_LIST_DIR} PREFIX "sysUt_devGpuNvcc" FILES ${SrcFiles}) 16 | 17 | add_test(NAME sysUt_devGpuNvcc COMMAND sysUt_devGpuNvcc) -------------------------------------------------------------------------------- /libNeonSys/tests/unit/sysUt_mem/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.19 FATAL_ERROR) 2 | 3 | file(GLOB_RECURSE SrcFiles src/*.*) 4 | 5 | add_executable(sysUt_mem ${SrcFiles}) 6 | 7 | target_link_libraries(sysUt_mem 8 | PUBLIC libNeonSys 9 | PUBLIC gtest_main) 10 | 11 | set_target_properties(sysUt_mem PROPERTIES FOLDER "libNeonSys") 12 | source_group(TREE ${CMAKE_CURRENT_LIST_DIR} PREFIX "sysUt_mem" FILES ${SrcFiles}) 13 | 14 | add_test(NAME sysUt_mem COMMAND sysUt_mem) -------------------------------------------------------------------------------- /libNeonSys/tests/unit/sysUt_patterns/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.19 FATAL_ERROR) 2 | 3 | file(GLOB_RECURSE SrcFiles src/*.*) 4 | 5 | add_executable(sysUt_patterns ${SrcFiles}) 6 | 7 | target_link_libraries(sysUt_patterns 8 | PUBLIC libNeonSys 9 | PUBLIC gtest_main) 10 | 11 | set_target_properties(sysUt_patterns PROPERTIES 12 | CUDA_SEPARABLE_COMPILATION ON 13 | CUDA_RESOLVE_DEVICE_SYMBOLS ON) 14 | 15 | set_target_properties(sysUt_patterns PROPERTIES FOLDER "libNeonSys") 16 | source_group(TREE ${CMAKE_CURRENT_LIST_DIR} PREFIX "sysUt_patterns" FILES ${SrcFiles}) 17 | 18 | add_test(NAME sysUt_patterns COMMAND sysUt_patterns) -------------------------------------------------------------------------------- /libNeonSys/tests/unit/sysUt_report/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.19 FATAL_ERROR) 2 | 3 | file(GLOB_RECURSE SrcFiles src/*.*) 4 | 5 | add_executable(sysUt_report ${SrcFiles}) 6 | 7 | target_link_libraries(sysUt_report 8 | PUBLIC libNeonSys 9 | PUBLIC gtest_main) 10 | 11 | set_target_properties(sysUt_report PROPERTIES FOLDER "libNeonSys") 12 | source_group(TREE ${CMAKE_CURRENT_LIST_DIR} PREFIX "sysUt_report" FILES ${SrcFiles}) 13 | 14 | add_test(NAME sysUt_report COMMAND sysUt_report) -------------------------------------------------------------------------------- /tutorials/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.19 FATAL_ERROR) 2 | 3 | add_subdirectory("the-bases") 4 | # add_subdirectory("staggered-grids") 5 | -------------------------------------------------------------------------------- /tutorials/introduction/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.19 FATAL_ERROR) 2 | 3 | add_subdirectory("domainLevel") 4 | -------------------------------------------------------------------------------- /tutorials/introduction/domainLevel/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.19 FATAL_ERROR) 2 | 3 | set (TUTORIAL_NAME tutorial-domainLevel) 4 | file(GLOB_RECURSE SrcFiles domainLevel.cpp expandLevelSet.cu grad.cu) 5 | 6 | add_executable(${TUTORIAL_NAME} ${SrcFiles}) 7 | 8 | target_link_libraries(${TUTORIAL_NAME} PUBLIC libNeonSkeleton) 9 | 10 | set_target_properties(${TUTORIAL_NAME} PROPERTIES 11 | CUDA_SEPARABLE_COMPILATION ON 12 | CUDA_RESOLVE_DEVICE_SYMBOLS ON) 13 | 14 | set_target_properties(${TUTORIAL_NAME} PROPERTIES FOLDER "tutorials") 15 | source_group(TREE ${CMAKE_CURRENT_LIST_DIR} PREFIX "${TUTORIAL_NAME}" FILES ${SrcFiles}) 16 | -------------------------------------------------------------------------------- /tutorials/introduction/domainLevel/expandLevelSet.cu: -------------------------------------------------------------------------------- 1 | #include "Neon/Neon.h" 2 | #include "Neon/domain/eGrid.h" 3 | #include "Neon/skeleton/Skeleton.h" 4 | #include "expandLevelSet.h" 5 | 6 | template 7 | auto expandLevelSet(Field& sdf, 8 | double expansion) 9 | -> Neon::set::Container 10 | { 11 | return sdf.getGrid().getContainer( 12 | "ExpandLevelSet", 13 | // Neon Loading Lambda 14 | [&, expansion](Neon::set::Loader& L) { 15 | auto& px = L.load(sdf); 16 | 17 | // Neon Compute Lambda 18 | return [=] NEON_CUDA_HOST_DEVICE( 19 | const typename Field::Cell& cell) mutable { 20 | px(cell, 0) -= expansion; 21 | }; 22 | }); 23 | } 24 | 25 | template auto expandLevelSet>(Neon::domain::eGrid::Field& sdf, double expation) -> Neon::set::Container; -------------------------------------------------------------------------------- /tutorials/introduction/domainLevel/expandLevelSet.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "Neon/Neon.h" 4 | #include "Neon/domain/eGrid.h" 5 | #include "Neon/skeleton/Skeleton.h" 6 | 7 | template 8 | auto expandLevelSet(Field& sdf, 9 | double expantion) -> Neon::set::Container; 10 | 11 | extern template auto expandLevelSet>(Neon::domain::eGrid::Field& sdf, double expation) -> Neon::set::Container; -------------------------------------------------------------------------------- /tutorials/introduction/domainLevel/grad.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "Neon/Neon.h" 4 | #include "Neon/domain/eGrid.h" 5 | #include "Neon/skeleton/Skeleton.h" 6 | 7 | template 8 | auto computeGrad(const Field& sdfField, 9 | Field& gradField, 10 | double h) 11 | -> Neon::set::Container; 12 | 13 | extern template auto computeGrad>(const Neon::domain::eGrid::Field& sdf, Neon::domain::eGrid::Field& grad, double h) -> Neon::set::Container; -------------------------------------------------------------------------------- /tutorials/staggered-grids/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.19 FATAL_ERROR) 2 | 3 | SET(APP "tutorial-staggered-grid") 4 | 5 | file(GLOB_RECURSE SrcFiles src/*.*) 6 | 7 | add_executable(${APP} ${SrcFiles}) 8 | 9 | target_link_libraries(${APP} 10 | PUBLIC libNeonDomain 11 | PUBLIC libNeonSkeleton 12 | PUBLIC gtest_main) 13 | 14 | set_target_properties(${APP} PROPERTIES 15 | CUDA_SEPARABLE_COMPILATION ON 16 | CUDA_RESOLVE_DEVICE_SYMBOLS ON) 17 | 18 | target_compile_options(${APP} INTERFACE 19 | $<$:${NeonCXXFlags}> 20 | $<$:${NeonCUDAFlags}> 21 | ) 22 | 23 | set_target_properties(${APP} PROPERTIES FOLDER "libNeonDomain") 24 | source_group(TREE ${CMAKE_CURRENT_LIST_DIR} PREFIX "gUt_containers" FILES ${SrcFiles}) 25 | 26 | add_test(NAME ${APP} COMMAND ${APP}) -------------------------------------------------------------------------------- /tutorials/the-bases/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.19 FATAL_ERROR) 2 | 3 | add_subdirectory("domainLevel") 4 | -------------------------------------------------------------------------------- /tutorials/the-bases/domainLevel/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.19 FATAL_ERROR) 2 | 3 | set (TUTORIAL_NAME tutorial-domainLevel) 4 | file(GLOB_RECURSE SrcFiles domainLevel.cpp expandSphere.cu grad.cu) 5 | 6 | add_executable(${TUTORIAL_NAME} ${SrcFiles}) 7 | 8 | target_link_libraries(${TUTORIAL_NAME} PUBLIC libNeonSkeleton) 9 | 10 | set_target_properties(${TUTORIAL_NAME} PROPERTIES 11 | CUDA_SEPARABLE_COMPILATION ON 12 | CUDA_RESOLVE_DEVICE_SYMBOLS ON) 13 | 14 | set_target_properties(${TUTORIAL_NAME} PROPERTIES FOLDER "tutorials") 15 | source_group(TREE ${CMAKE_CURRENT_LIST_DIR} PREFIX "${TUTORIAL_NAME}" FILES ${SrcFiles}) 16 | -------------------------------------------------------------------------------- /tutorials/the-bases/domainLevel/expandSphere.cu: -------------------------------------------------------------------------------- 1 | #include "Neon/Neon.h" 2 | #include "Neon/domain/Grids.h" 3 | #include "Neon/skeleton/Skeleton.h" 4 | #include "expandSphere.h" 5 | 6 | template 7 | auto expandedLevelSet(Field& sdf, 8 | double expantion) 9 | ->Neon::set::Container 10 | { 11 | return sdf.getGrid().newContainer( 12 | "ExpandedLevelSet", [&, expantion](Neon::set::Loader& L) { 13 | auto& px = L.load(sdf); 14 | 15 | return [=] NEON_CUDA_HOST_DEVICE( 16 | const typename Field::Idx& gidx) mutable { 17 | px(gidx, 0) -= expantion; 18 | }; 19 | }); 20 | } 21 | 22 | template auto expandedLevelSet>(Neon::dGrid::Field& sdf, double expation) -> Neon::set::Container; -------------------------------------------------------------------------------- /tutorials/the-bases/domainLevel/expandSphere.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "Neon/Neon.h" 4 | #include "Neon/domain/Grids.h" 5 | 6 | template 7 | auto expandedLevelSet(Field& sdf, 8 | double expantion) -> Neon::set::Container; 9 | 10 | extern template auto expandedLevelSet>(Neon::dGrid::Field& sdf, double expation) -> Neon::set::Container; -------------------------------------------------------------------------------- /tutorials/the-bases/domainLevel/grad.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "Neon/Neon.h" 4 | #include "Neon/domain/Grids.h" 5 | #include "Neon/skeleton/Skeleton.h" 6 | 7 | template 8 | auto computeGrad(const Field& gidx, 9 | Field& gradField, 10 | double h) 11 | -> Neon::set::Container; 12 | 13 | extern template auto computeGrad>(const Neon::dGrid::Field& gidx, 14 | Neon::dGrid::Field& grad, 15 | double h) -> Neon::set::Container; -------------------------------------------------------------------------------- /webDocumentation.sh: -------------------------------------------------------------------------------- 1 | pushd docs/doxygen 2 | doxygen Doxyfile 3 | popd 4 | mkdocs serve 5 | --------------------------------------------------------------------------------