Skip to content
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

Feature: Smart STK Field Types #1209

Merged
merged 41 commits into from
Sep 27, 2023
Merged
Show file tree
Hide file tree
Changes from 28 commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
35f57cd
Add prototype for smartptr
psakievich Sep 12, 2023
7c80c29
Attempt some new things
psakievich Sep 12, 2023
f1391d8
Working concept on device
psakievich Sep 12, 2023
660f458
clean some things up
psakievich Sep 12, 2023
5464e46
Start working on the actual class implementation
psakievich Sep 13, 2023
2f19cc6
Make unit test fixture
psakievich Sep 13, 2023
610da57
Generalize code a little
psakievich Sep 13, 2023
256a3bd
Trying a new design
psakievich Sep 13, 2023
739f50e
Redesign again: templates for space and access type
psakievich Sep 14, 2023
a4767f9
Add more tests
psakievich Sep 14, 2023
dcb0479
Add tests to ensure sync count is correct
psakievich Sep 14, 2023
af017d9
Rename file
psakievich Sep 14, 2023
f5a954d
Add some fixes for host
psakievich Sep 14, 2023
6d9f5fd
Style
psakievich Sep 14, 2023
609ab46
Change scope to access and create creator obj
psakievich Sep 17, 2023
cf82d24
Add host specialization for bucket loops
psakievich Sep 18, 2023
2c6d127
Add host READ access overloads
psakievich Sep 18, 2023
d25fa68
Format
psakievich Sep 18, 2023
bfc6678
Refactor for three different MEMSPACE's
psakievich Sep 18, 2023
a4ad40e
Update some comments
psakievich Sep 18, 2023
e4f309b
Style
psakievich Sep 18, 2023
f579c4c
Passing device tests
psakievich Sep 18, 2023
be477fc
Style
psakievich Sep 18, 2023
6fd30a8
Rename to SmartField and add explicit instantiation
psakievich Sep 19, 2023
005de2d
Code comments and things
psakievich Sep 19, 2023
bf884f8
Tweaks
psakievich Sep 19, 2023
1cc7176
Prep FieldManager for interface
psakievich Sep 19, 2023
8b55e0e
Merge branch 'master' into f/smartptr
psakievich Sep 20, 2023
09b33a0
Add some partial template specializations
psakievich Sep 20, 2023
a7a1c7f
FieldManager interface
psakievich Sep 21, 2023
1a42c96
Test FieldManager iFace
psakievich Sep 21, 2023
bc3de85
Style
psakievich Sep 21, 2023
93ee934
Style
psakievich Sep 21, 2023
fa1b4c1
Start using, and improve interface for legacy case
psakievich Sep 21, 2023
00d9173
More conversions in unit-tests
psakievich Sep 21, 2023
f3080ac
Style
psakievich Sep 21, 2023
b6a6de2
Add additional accessor functions
psakievich Sep 23, 2023
c69329c
Fix unit tests
psakievich Sep 25, 2023
733baba
Split classes
psakievich Sep 27, 2023
9ad8018
Test on device and format
psakievich Sep 27, 2023
d68eba4
Add some convenience type names
psakievich Sep 27, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions include/ElemDataRequestsGPU.h
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@ auto&
ElemDataRequestsGPU::get_coord_ptr(const T& fieldMgr, const U& iter) const
{
if constexpr (std::is_same_v<T, nalu::FieldManager>)
return fieldMgr.get_ngp_field_ptr(iter.second->name());
return fieldMgr.template get_ngp_field_ptr<double>(iter.second->name());
else
return fieldMgr.template get_field<double>(
iter.second->mesh_meta_data_ordinal());
Expand Down Expand Up @@ -297,7 +297,7 @@ ElemDataRequestsGPU::get_field_ptr(
const T& fieldMgr, const FieldInfo& finfo) const
{
if constexpr (std::is_same_v<T, nalu::FieldManager>)
return fieldMgr.get_ngp_field_ptr(finfo.field->name());
return fieldMgr.template get_ngp_field_ptr<double>(finfo.field->name());
else
return fieldMgr.template get_field<double>(
finfo.field->mesh_meta_data_ordinal());
Expand Down
7 changes: 4 additions & 3 deletions include/FieldManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,8 @@ class FieldManager

/// Given the named field that has already been registered on the CPU
/// return the GPU version of the same field.
stk::mesh::NgpField<double>& get_ngp_field_ptr(std::string name) const
template<typename T>
stk::mesh::NgpField<T>& get_ngp_field_ptr(std::string name) const
{
FieldDefTypes fieldDef =
FieldRegistry::query(numDimensions_, numStates_, name);
Expand All @@ -143,8 +144,8 @@ class FieldManager
->field_of_state(stk::mesh::FieldState::StateNone);
},
fieldDef);
stk::mesh::NgpField<double>& tmp =
stk::mesh::get_updated_ngp_field<double>(stkField);
stk::mesh::NgpField<T>& tmp =
stk::mesh::get_updated_ngp_field<T>(stkField);
return tmp;
}
};
Expand Down
Loading