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

Change Enums in ScatterView to types #3076

Merged
merged 8 commits into from
Aug 6, 2020

Conversation

jeffmiles63
Copy link
Contributor

@jeffmiles63 jeffmiles63 commented Jun 2, 2020

Update all of ScatterView and aggregate classes to use types instead of enum.
Update create_scatter_view to use types instead of enums
Add two additional create_scatter_view overloads that can derive the types:
create_scatter_view(OpType, Duplication, Contribution,View<RT, RP...> const& original_view)
create_scatter_view(OpType,View<RT, RP...> const& original_view)
Added/updated unit tests to match changes
Also cleaned up the documentation for ScatterValue classes

Part of issue #3024

struct DefaultContribution;

#ifdef KOKKOS_ENABLE_SERIAL
template <>
struct DefaultDuplication<Kokkos::Serial> {
enum : int { value = Kokkos::Experimental::ScatterNonDuplicated };
using duplication_type = Kokkos::Experimental::ScatterNonDuplicated;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"tag" rather than "type"?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure I understand your question. Could you please clarify.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suggest to use duplication_tag rather than duplication_type and to prefer the name "tag" when you refer to the new classes you introduced to replace the enum.

I am not firmly asking you to change. Wondering what others think.
@crtrott @dhollman

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think duplication_tag is a better name, as it indicates what it is.

That leads to side questions:

  1. Should "Tag" be part of the name of the tag, as in ScatterNonDuplicatedTag? (It seems like extra verbosity which doesn't really convey extra meaning, so I'm leaning against it.)
  2. Should tag types have explicit default constructors? When passed to functions, it disallows aggregate initialization {} syntax. I don't think it matters at all in this case, but we should have a consistent policy towards it.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe I have addressed these issues @dalg24 @nliber please review

@masterleinad
Copy link
Contributor

C:\projects\source\containers\unit_tests\TestScatterView.hpp(444,59): error C2065: 'duplication': undeclared identifier [C:\projects\source\build\containers\unit_tests\KokkosContainers_UnitTest_Serial.vcxproj]
C:\projects\source\containers\unit_tests\TestScatterView.hpp(445,55): error C2065: 'contribution': undeclared identifier [C:\projects\source\build\containers\unit_tests\KokkosContainers_UnitTest_Serial.vcxproj]
C:\projects\source\containers\unit_tests\TestScatterView.hpp(444,35): error C2672: 'Kokkos::Experimental::create_scatter_view': no matching overloaded function found [C:\projects\source\build\containers\unit_tests\KokkosContainers_UnitTest_Serial.vcxproj]
C:\projects\source\containers\unit_tests\TestScatterView.hpp(445,1): error C2974: 'Kokkos::Experimental::create_scatter_view': invalid template argument for 'OpType', type expected [C:\projects\source\build\containers\unit_tests\KokkosContainers_UnitTest_Serial.vcxproj]

@jeffmiles63
Copy link
Contributor Author

Retest this please

@dalg24
Copy link
Member

dalg24 commented Jul 8, 2020

@jeffmiles63 build issues are related to c5e32b8#diff-90ccdebd1a5c5cce9dce2a2d6bfd4c74 that got merged in the meantime.

@jeffmiles63 jeffmiles63 force-pushed the fix-make-scatterview branch 2 times, most recently from d48d581 to 3d8aac7 Compare July 13, 2020 23:15
@masterleinad
Copy link
Contributor

Can you squash your changes?

apply clang format

add / fix overrides of create_scatter_view

Fix issue with HPX

fix comments with ScatterValue

fix compile error after rebasing

change types to tags

Fix issue with OpenMPTarget

Fix formatting for openmp target

fix compilation issues with scatter view and openmptarget
Co-authored-by: Daniel Arndt <arndtd@ornl.gov>
@masterleinad
Copy link
Contributor

Retest this please.

Copy link
Contributor

@masterleinad masterleinad left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Still looks good to me but we could squash the last fixup commits.

Co-authored-by: Daniel Arndt <arndtd@ornl.gov>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants