-
Notifications
You must be signed in to change notification settings - Fork 27
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Initial MIR component #1438
Open
BradWhitlock
wants to merge
344
commits into
develop
Choose a base branch
from
feature/whitlock/mir_update
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Initial MIR component #1438
Changes from 250 commits
Commits
Show all changes
344 commits
Select commit
Hold shift + click to select a range
9b143d1
Compilation fixes
BradWhitlock a2fa467
Change accessing edges
BradWhitlock 0930c1c
Fixed some coordset views. Added distance field
BradWhitlock fc240cb
SLIC errors
BradWhitlock eefee2b
Fix bit functions
BradWhitlock 6af4fa2
Added mechanism for Conduit to allocate through Axom.
BradWhitlock 7f0d095
Added mechanism for making Conduit allocate through Axom. Fixed a few…
BradWhitlock 719329b
Debugging ClipField
BradWhitlock 72d3240
Populate slice data so we can map element fields to new mesh
BradWhitlock 7b293b0
Added ClipOptions
BradWhitlock a5ff0ac
More testing
BradWhitlock 07bdecf
templated
BradWhitlock 395c37c
Changes that let ClipField run on GPU with HIP
BradWhitlock 24a78d5
Initial mixed topo support
BradWhitlock 41e6a46
Try out the mixed shape view
BradWhitlock 4ba2c84
Some cleanup/refactoring
BradWhitlock 6ff5327
code cleanup
BradWhitlock 721e970
Adjust 3D shapes
BradWhitlock 6db7e4b
debugging
BradWhitlock 39b3e33
Some refactoring to see if that helps for debugging.
BradWhitlock 8cd51b2
wedge is bad too
BradWhitlock acf1ac2
Added a test for explicit coordset view
BradWhitlock 5331c0a
Fix typo
BradWhitlock b46d992
Fixed a clip bug from incorrect shape traversal
BradWhitlock 40152ce
Fixed wedge edges
BradWhitlock 43d9c47
Fixes for wedge clip
BradWhitlock e8c8474
start trying to work around OMP issue
BradWhitlock 2f39c3e
Broke ClipField::execute into methods.
BradWhitlock a7d9e1e
code cleanup
BradWhitlock dd75375
Attempts to work around OMP problems.
BradWhitlock 41dd065
Debug prints, etc
BradWhitlock e817b07
Changed conduit memory allocation. Fix view usage in one place.
BradWhitlock 18f3026
Debugging
BradWhitlock 5634141
Fix for HIP
BradWhitlock 3418c07
Always use wrapped scan
BradWhitlock f45ebb7
Disable formatting in some borrowed data tables
BradWhitlock 5fd8a62
clang-format is the worst! clang-ugly is more like it.
BradWhitlock e5dd66d
Move some name generation to NamingPolicy.
BradWhitlock 7ece514
make style
BradWhitlock d85270f
A test for a mixed mesh
BradWhitlock b3ce4e0
make style
BradWhitlock d9150f3
Moved methods for better linking
BradWhitlock 7b981ce
Better VTK file saving
BradWhitlock c7f50f3
save/load/compare baselines
BradWhitlock 1e73a44
make style
BradWhitlock 1a5a120
Added tests for rectilinear clipping
BradWhitlock eabf434
Moved some functions into a header.
BradWhitlock bbfb600
More consistent naming, make some view creation functions.
BradWhitlock 4e9b17c
make style
BradWhitlock 23aa1f7
progress on strided structured
BradWhitlock 817fc1d
Improvements for strided structured.
BradWhitlock 1bf8fcd
Improved strided structure support
BradWhitlock 21fc10d
make style
BradWhitlock 1dd88a4
Try selecting a few zones. Remove a method from views.
BradWhitlock 11c0135
make style
BradWhitlock 90ab9c2
fix macro
BradWhitlock 15fdbf5
Fix types
BradWhitlock a5cfcc8
fix recenter
BradWhitlock 4d0addd
Fixes
BradWhitlock 6a78310
Adding ClipFieldFilter
BradWhitlock 2069e10
Cut down code size
BradWhitlock 7c5eb91
make style
BradWhitlock 64c6024
Combined some structured topo dispatch
BradWhitlock 60bd3cd
make style
BradWhitlock 5c51478
Separate out options
BradWhitlock b708890
Separate some code
BradWhitlock 35616f2
make style
BradWhitlock 0207e14
Changed how options work, separated out selected zones. Starting a MI…
BradWhitlock 84d3514
in progress
BradWhitlock 642a218
Fixes for a matset view
BradWhitlock 06e3eb9
make style
BradWhitlock db64fac
wrote a test for NodeToZoneRelationBuilder.
BradWhitlock 284f9e2
make style
BradWhitlock e143dc8
Fix for NodetoZoneRelationBuilder tests
BradWhitlock 52ec6fe
Changed namespace
BradWhitlock c294717
moved some tests
BradWhitlock 47c55bf
Added test for RecenterField
BradWhitlock 3d12af0
make style
BradWhitlock 087b33b
Working on a MIR algorithm
BradWhitlock ebe2c46
Debugging MIR
BradWhitlock 4f8e359
MIR improvements. Started some new helper classes that can replace pa…
BradWhitlock 09dfb43
Abstract out Intersector code from ClipField so I can template on an …
BradWhitlock c8d84c6
make style
BradWhitlock b71a743
MIR improvements
BradWhitlock 68f9b3f
debugging
BradWhitlock dfff7dc
MIR checkpoint - switching machines
BradWhitlock b0c9a5b
progress but not quite right
BradWhitlock 389cb1b
Better result
BradWhitlock c9c5ee8
code cleanup
BradWhitlock b0dc1a8
make style
BradWhitlock 44e75d4
Added timers
BradWhitlock d645a4f
Replaced timer with annotation so it will instead use Caliper.
BradWhitlock 61e0ec0
make style
BradWhitlock 393fe77
Minor fixes
BradWhitlock 189b3c3
code cleanup
BradWhitlock aa51d5a
I renumbered clipping table symbol values to reduce the size of a sta…
BradWhitlock ac4aea5
make style
BradWhitlock e82a13e
Added more timers, some code renaming
BradWhitlock 4b863be
porting MeshTester.
BradWhitlock f29c26f
Emit edge points using endpoint ids in blend groups if close to start…
BradWhitlock e2ab64e
make style
BradWhitlock 0249309
Add degenerate zone filtering. Enable multiple policies in concentric…
BradWhitlock da2d547
make style
BradWhitlock f58b7bc
More timings
BradWhitlock 4d86bb4
Sorting
BradWhitlock 5b74ac2
timers
BradWhitlock 3c319fc
Change to naming policy - could be faster in 3D
BradWhitlock 28493fa
make style
BradWhitlock 2fbe418
Changes to unique and n2z relation builder.
BradWhitlock 45415b2
make style
BradWhitlock b8d3c1c
Some speedup for serial NodeToZoneRelationBuilder.
BradWhitlock 85b6dc4
Skip a little work with 1 blend value.
BradWhitlock 3ee18ae
Start of algorithm change to reduce blend group count. Not enabled ri…
BradWhitlock 1bfbd24
make style
BradWhitlock 064588e
Adding some new components for slicing matsets and extracting zones f…
BradWhitlock 79144cc
Added some tests
BradWhitlock bd8fe95
Added more tests, other improvements.
BradWhitlock 28f3c8a
Changed ZoneListBuilder to atomics instead of requiring node to zone …
BradWhitlock 449f16a
Added selected zones to zone list builder.
BradWhitlock 00b5305
make style
BradWhitlock 98fcf66
Fixed problem in ClipField
BradWhitlock 17ec665
Reset node
BradWhitlock 4f43bbe
Added test for selecting zones in clipfield
BradWhitlock 5a0a8ec
Fixed some tests on HIP
BradWhitlock d86f2f2
Updated data
BradWhitlock 6250b37
Broken topo merging - WIP
BradWhitlock d237448
Add Ninja
BradWhitlock c8c00c4
Progress on MergeMeshes
BradWhitlock 6b3468b
Progress on MergeMeshes
BradWhitlock c1f6fba
Merge is working for coordsets/topo.
BradWhitlock 954df19
Fixed bug in NodeArrayView.
BradWhitlock 3b91266
Added a test
BradWhitlock fb7ff8b
Initial stab at merging fields.
BradWhitlock 0cae1d2
Added material merging in MergeMeshes.
BradWhitlock 2225bf5
Fix timers
BradWhitlock debe458
make style
BradWhitlock e52d1bd
More timings
BradWhitlock b6325e0
Merged develop to branch
BradWhitlock e25cf83
remove warning
BradWhitlock 99596ff
Fix build
BradWhitlock d6ea691
Some progress on adjusting for CUDA
BradWhitlock 0a1d705
Changed comment format
BradWhitlock ef1fb76
possible CUDA solution
BradWhitlock 1a6c6df
Progress on nvcc compatibility.
BradWhitlock e5bc818
nvcc compatibility
BradWhitlock 8340505
nvcc progress
BradWhitlock 27ecc84
nvcc progress
BradWhitlock 9409974
testing fixes
BradWhitlock cef6203
Added a note in the docs.
BradWhitlock c723789
good changes
BradWhitlock d9a3595
GPU porting doc
BradWhitlock cf8b987
Added test for MakeUnstructured
BradWhitlock fc5763a
Adding zone function to topology views. Removing some c++17.
BradWhitlock 4f8e751
Added getAllocatorIDForAddress
BradWhitlock c216e1d
Added StackArray::data method.
BradWhitlock 95517c9
nvcc compatibility changes
BradWhitlock 7f19ba7
Merged develop to branch.
BradWhitlock 32e5f5e
Removed for_all_zones.
BradWhitlock 583b3da
Removed for_all_zones from views.
BradWhitlock 8e7fb09
make style
BradWhitlock 6011470
Do not default construct on host if memory was device-allocated.
BradWhitlock ad20d9b
nvcc compatibility
BradWhitlock e976930
make style
BradWhitlock d5bfe00
Moved some files to future and removed from build.
BradWhitlock 048eb1b
cleanup
BradWhitlock d935dad
fix warning
BradWhitlock 49725ec
New GPU porting tips
BradWhitlock d3282af
Removed some old tests
BradWhitlock a147431
Added more GPU tips
BradWhitlock f459f3d
Array fixes
BradWhitlock aae8269
Removing some if constexpr
BradWhitlock ab2c73f
Working on docs
BradWhitlock c0b9e02
Removed empty file
BradWhitlock 90a41ab
Remove more if constexpr
BradWhitlock 6718215
Guard RAJA better
BradWhitlock 2271300
fieldslicer test
BradWhitlock 40eea7e
Added some docs
BradWhitlock 524df5f
Added doc
BradWhitlock 8f73ed0
More doc
BradWhitlock 5429ff4
doc edits
BradWhitlock cb12815
Ported mir_tutorial_simple
BradWhitlock fc8626e
Merged from develop.
BradWhitlock bbc1e46
Fix 3D equiz test
BradWhitlock 73f1307
Added ph topo view example in docs
BradWhitlock fd268ae
small fix
BradWhitlock 40660ea
Move some files
BradWhitlock ac04c0d
Moved reference files
BradWhitlock 54037c3
Moved files
BradWhitlock d7ef289
Moved files to clipping
BradWhitlock 7d27fed
Moved files
BradWhitlock 9a0aa0a
Split template instantiation up in concentric_circles example
BradWhitlock f637473
make style
BradWhitlock e03b481
fix
BradWhitlock 2f82aa3
Break up compilation into more files
BradWhitlock 5e780a1
Split tests into more files
BradWhitlock 9f9bbdc
Removed reference mesh generation routines from MeshTester
BradWhitlock e864ec1
CUDA fixes. Doc fixes.
BradWhitlock bdcc302
make style
BradWhitlock 233b0fe
Small doc correction.
BradWhitlock 83a7ec6
Fix build and warnings for no-RAJA case.
BradWhitlock 2433ca6
Warnings. Fix some int/IndexType usage. Loosen equiz_3d tolerance a l…
BradWhitlock 03d00d0
Code changes
BradWhitlock 259b8df
make style on rzwhippet
BradWhitlock 98f9c0b
Merge branch 'develop' into feature/whitlock/mir_update
BradWhitlock 409e95b
Typos
BradWhitlock e894e7a
Merge branch 'feature/whitlock/mir_update' of github.com:LLNL/axom in…
BradWhitlock a1386ed
typos
BradWhitlock 9bbf830
Remove TODO.txt
BradWhitlock 204b181
Try dynamically setting parallel make -j argument.
BradWhitlock 70b0d7d
Adjust dynamic make -j
BradWhitlock bdb101b
Merge branch 'develop' into feature/whitlock/mir_update
BradWhitlock 2e5aa10
gcc, intel compatibility
BradWhitlock eb54313
Merge branch 'feature/whitlock/mir_update' of github.com:LLNL/axom in…
BradWhitlock 4abba0a
Increase job time allocation for lassen and ruby.
BradWhitlock 2c672da
Merge branch 'develop' into feature/whitlock/mir_update
BradWhitlock a254953
Fix comment
BradWhitlock 125700f
Merge branch 'develop' into feature/whitlock/mir_update
BradWhitlock 4cbcfb9
Incorporate some doc suggestions/fixes.
BradWhitlock ade297e
Included more doc suggestions/fixes.
BradWhitlock c8d7ebd
Doc fix
BradWhitlock bc06320
Doc change.
BradWhitlock d6498bf
Use popcount function and remove countBits.
BradWhitlock 6165c35
Always add mir component.
BradWhitlock cc23482
Try turning off MIR in some CI builds where dependencies are not met.
BradWhitlock cd3a9c7
Remove explicit umpire dependency in mir.
BradWhitlock 6e8bbf8
Change some when some using declarations are made so it should work w…
BradWhitlock d848ea9
Merge branch 'develop' into feature/whitlock/mir_update
BradWhitlock cf008dc
Updated data directory to main.
BradWhitlock 9a0f9c2
Merged develop into branch.
BradWhitlock cc74af3
Removed unused test. Updated copyrights
BradWhitlock 438de42
Use join
BradWhitlock 0d55d81
Some CLI11 improvements.
BradWhitlock 3a478ef
Run example programs as tests.
BradWhitlock 95961ab
make style
BradWhitlock 639a154
Only allow certain test policies if umpire and raja are available. Fi…
BradWhitlock 28673c5
Disable MIR if RAJA and Umpire are not in the Spack spec.
BradWhitlock 8d967a6
make style
BradWhitlock c86654d
Added --disable-write flag to example programs so we can prevent them…
BradWhitlock 1e4e913
Enable caliper on some tests. Increase Azure time limit.
BradWhitlock d277541
Merged develop to branch.
BradWhitlock 128da10
Minor fixes, build changes
BradWhitlock 8229455
Added mir_concentric_circles.py script
BradWhitlock 2a4987f
Fix mistake from previous merge in macos on Azure.
BradWhitlock 558b844
Speedup for MeshTester case that generates circle materials.
BradWhitlock 275851d
Added exception handling for when getAllocatorIDForAddress called wit…
BradWhitlock a034b56
Added comments about template specialization in sorting. Made a few s…
BradWhitlock 42cb6fc
Fixed issue introduced when speeding up MeshTester.
BradWhitlock e4c8ca1
make style
BradWhitlock 4537b07
Merged develop to branch.
BradWhitlock ab3e869
Merge branch 'develop' into feature/whitlock/mir_update
BradWhitlock File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,7 +16,7 @@ variables: | |
jobs: | ||
- job: Build_and_Test | ||
|
||
timeoutInMinutes: 90 | ||
timeoutInMinutes: 120 | ||
|
||
strategy: | ||
matrix: | ||
|
@@ -45,7 +45,7 @@ jobs: | |
linux_clang14_noraja: | ||
VM_ImageName: 'ubuntu-22.04' | ||
Compiler_ImageName: '$(CLANG14_IMAGENAME)' | ||
CMAKE_EXTRA_FLAGS: '-DBUILD_SHARED_LIBS=ON -DAXOM_QUEST_ENABLE_EXTRA_REGRESSION_TESTS:BOOL=ON -U RAJA_DIR' | ||
CMAKE_EXTRA_FLAGS: '-DBUILD_SHARED_LIBS=ON -DAXOM_QUEST_ENABLE_EXTRA_REGRESSION_TESTS:BOOL=ON -DAXOM_ENABLE_MIR:BOOL=OFF -U RAJA_DIR' | ||
BUILD_TYPE: 'Debug' | ||
COMPILER: 'clang++' | ||
TEST_TARGET: 'linux_clang14' | ||
|
@@ -61,7 +61,7 @@ jobs: | |
linux_clang14_noraja_noumpire: | ||
VM_ImageName: 'ubuntu-22.04' | ||
Compiler_ImageName: '$(CLANG14_IMAGENAME)' | ||
CMAKE_EXTRA_FLAGS: '-DBUILD_SHARED_LIBS=ON -DAXOM_QUEST_ENABLE_EXTRA_REGRESSION_TESTS:BOOL=ON -U RAJA_DIR -U UMPIRE_DIR' | ||
CMAKE_EXTRA_FLAGS: '-DBUILD_SHARED_LIBS=ON -DAXOM_QUEST_ENABLE_EXTRA_REGRESSION_TESTS:BOOL=ON -DAXOM_ENABLE_MIR:BOOL=OFF -U RAJA_DIR -U UMPIRE_DIR' | ||
BUILD_TYPE: 'Debug' | ||
COMPILER: 'clang++' | ||
TEST_TARGET: 'linux_clang14' | ||
|
@@ -76,11 +76,11 @@ jobs: | |
HOST_CONFIG: '[email protected]' | ||
osx_gcc: | ||
VM_ImageName: 'macos-13' | ||
CMAKE_EXTRA_FLAGS: '-DAXOM_ENABLE_SIDRE:BOOL=OFF -DAXOM_ENABLE_INLET:BOOL=OFF -DAXOM_ENABLE_KLEE:BOOL=OFF' | ||
CMAKE_EXTRA_FLAGS: '-DAXOM_ENABLE_SIDRE:BOOL=OFF -DAXOM_ENABLE_INLET:BOOL=OFF -DAXOM_ENABLE_KLEE:BOOL=OFF -DAXOM_ENABLE_MIR:BOOL=OFF' | ||
TEST_TARGET: 'osx_gcc' | ||
windows: | ||
VM_ImageName: 'windows-2019' | ||
CMAKE_EXTRA_FLAGS: '-DAXOM_ENABLE_SIDRE:BOOL=OFF -DAXOM_ENABLE_INLET:BOOL=OFF -DAXOM_ENABLE_KLEE:BOOL=OFF' | ||
CMAKE_EXTRA_FLAGS: '-DAXOM_ENABLE_SIDRE:BOOL=OFF -DAXOM_ENABLE_INLET:BOOL=OFF -DAXOM_ENABLE_KLEE:BOOL=OFF -DAXOM_ENABLE_MIR:BOOL=OFF' | ||
TEST_TARGET: 'win_vs' | ||
|
||
pool: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
kennyweiss marked this conversation as resolved.
Show resolved
Hide resolved
|
Submodule data
updated
19 files
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
import os, sys | ||
|
||
runs = { | ||
"[email protected]_cuda-release" : ["seq", "omp", "cuda"], | ||
"[email protected]" : ["seq", "omp"], | ||
"[email protected]" : ["seq", "omp"], | ||
"[email protected]" : ["seq", "omp"], | ||
"[email protected]_hip-release" : ["seq", "hip"], | ||
"[email protected]_hip-release" :["seq", "hip"] | ||
} | ||
|
||
sizes = (50, 100, 200, 500, 1000, 1500, 2000, 4000, 8000) | ||
|
||
def generate(): | ||
for r in runs: | ||
filename = os.path.join(r, "run_concentric_circles.bash") | ||
f = open(filename, "wt") | ||
f.write("#!/bin/bash\n\n") | ||
f.write("CONCENTRIC_CIRCLES=./examples/mir_concentric_circles\n\n") | ||
|
||
for s in sizes: | ||
f.write(f"# Size {s}\n") | ||
for policy in runs[r]: | ||
f.write(f'echo "Running --gridsize {s} --numcircles 5 --policy {policy}"\n') | ||
f.write(f'$CONCENTRIC_CIRCLES --gridsize {s} --numcircles 5 --policy {policy} > result_{policy}_{s}.txt\n\n') | ||
|
||
f.close() | ||
os.chmod(filename, 0o700) | ||
print(f"Wrote {filename}") | ||
|
||
def read_timings(filename): | ||
retval = "" # no data | ||
try: | ||
lines = open(filename, "rt").readlines() | ||
for line in lines: | ||
pos = line.find("runMIR") | ||
if pos != -1: | ||
toks = [x for x in line.split() if x != ''] | ||
retval = float(toks[2]) # timings (I) | ||
break | ||
except: | ||
pass | ||
return retval | ||
|
||
def make_csv(outputfile): | ||
columns = [] | ||
# Add sizes column | ||
sc = ["Sizes"] | ||
for s in sizes: | ||
sc.append(s) | ||
columns.append(sc) | ||
|
||
# Gather data. | ||
for r in sorted(runs.keys()): | ||
for policy in runs[r]: | ||
buildname = r[6:-8] | ||
name = f"{buildname} {policy.upper()}" | ||
data = [name] | ||
for s in sizes: | ||
filename = os.path.join(r, f"result_{policy}_{s}.txt") | ||
value = read_timings(filename) | ||
data.append(value) | ||
columns.append(data) | ||
|
||
# Write data | ||
f = open(outputfile, "wt") | ||
nrows = len(columns[0]) | ||
for i in range(nrows): | ||
rowdata = [str(c[i]) for c in columns] | ||
line = ",".join(rowdata) | ||
f.write(f"{line}\n") | ||
f.close() | ||
|
||
def main(): | ||
if "--generate" in sys.argv: | ||
generate() | ||
else: | ||
make_csv("concentric_circle_timings.csv") | ||
|
||
main() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,6 +10,8 @@ | |
#include "axom/core/Macros.hpp" // for axom macros | ||
#include "axom/core/Types.hpp" // for axom types | ||
|
||
#include <iostream> | ||
|
||
namespace axom | ||
{ | ||
/*! | ||
|
@@ -27,6 +29,14 @@ namespace axom | |
template <typename T, int N> | ||
struct StackArray | ||
{ | ||
using value_type = T; | ||
|
||
/*! | ||
* \brief Return size of the array. | ||
*/ | ||
AXOM_HOST_DEVICE | ||
constexpr static int size() { return N; } | ||
|
||
/*! | ||
* \brief Accessor, returns a reference to the value at the given index. | ||
* | ||
|
@@ -55,6 +65,9 @@ struct StackArray | |
AXOM_HOST_DEVICE | ||
constexpr operator const T*() const noexcept { return &m_data[0]; } | ||
|
||
AXOM_HOST_DEVICE T* data() noexcept { return &m_data[0]; } | ||
AXOM_HOST_DEVICE const T* data() const noexcept { return &m_data[0]; } | ||
Comment on lines
+68
to
+69
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Since these have the same return type/value as Should the |
||
|
||
/// @} | ||
|
||
/*! | ||
|
@@ -135,6 +148,28 @@ AXOM_HOST_DEVICE bool operator<(const StackArray<T, N>& lhs, | |
return false; | ||
} | ||
|
||
/** | ||
* \brief Print the StackArray to a stream. | ||
* \param os The stream to use. | ||
* \param obj The StackArray to print. | ||
* \return The input stream. | ||
*/ | ||
template <typename T, int N> | ||
std::ostream& operator<<(std::ostream& os, const StackArray<T, N>& obj) | ||
{ | ||
os << "("; | ||
for(int i = 0; i < N; i++) | ||
{ | ||
if(i > 0) | ||
{ | ||
os << ", "; | ||
} | ||
os << obj.m_data[i]; | ||
} | ||
os << ")"; | ||
return os; | ||
} | ||
|
||
} /* namespace axom */ | ||
|
||
#endif /* AXOM_STACKARRAY_HPP_ */ |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍