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

prevent allocMappedBufIfSupported from accepting arbitrary Types as TPlatform #2120

Conversation

chaever
Copy link
Contributor

@chaever chaever commented Sep 1, 2023

This PR aims to resolve #2065.

@psychocoderHPC
Copy link
Member

@chaever Thanks for your first PR. We will have a look into it!

j-stephan
j-stephan previously approved these changes Sep 1, 2023
Copy link
Member

@j-stephan j-stephan left a comment

Choose a reason for hiding this comment

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

Thank you!

@@ -175,9 +177,10 @@ namespace alpaka
TPlatform const& platform,
TExtent const& extent = TExtent())
{
if constexpr(hasMappedBufSupport<TPlatform>)
using PlatformForMappedAlloc = Platform<TPlatform>;
Copy link
Contributor

Choose a reason for hiding this comment

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

I would suggest

Suggested change
using PlatformForMappedAlloc = Platform<TPlatform>;
using Platform = alpaka::Platform<TPlatform>;

if it works?

Copy link
Contributor

Choose a reason for hiding this comment

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

See for example

using Platform = alpaka::Platform<Dev>;

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This should now be consistent with the other usages of the Platform-Trait, which all have the alpaka namespace prefixed.

@@ -175,9 +177,10 @@ namespace alpaka
TPlatform const& platform,
TExtent const& extent = TExtent())
{
if constexpr(hasMappedBufSupport<TPlatform>)
using PlatformForMappedAlloc = alpaka::Platform<TPlatform>;
Copy link
Contributor

Choose a reason for hiding this comment

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

can you use using Platform like everywhere else?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That was the initial version, until this was pointed out.

Copy link
Member

Choose a reason for hiding this comment

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

My assumption was wrong. Platform = Platform<T> doesn't trigger -Wshadow. So feel free to follow @fwyzard's suggestion.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

PlatformForMappedAlloc should now be replaced by Platform.

@psychocoderHPC
Copy link
Member

@chaever Could you please call git commit --amend -a on you terminal and force push again. We had last week CI issues and must retrigger the CI.

@chaever chaever force-pushed the check_TPltf_when_allocating_device_memory branch from 4156839 to 3709711 Compare September 5, 2023 13:57
@chaever
Copy link
Contributor Author

chaever commented Sep 5, 2023

I think the same job failed again.
It looks like that has something to do with a failure to transfer the code for test compilation, see here.

@j-stephan
Copy link
Member

Can you do a git rebase develop and then force-push again?

@chaever chaever force-pushed the check_TPltf_when_allocating_device_memory branch from 3709711 to a0ca64a Compare September 5, 2023 17:08
@chaever
Copy link
Contributor Author

chaever commented Sep 5, 2023

This branch should now be branching off from develop at 6b43b8d (most recent develop-commit at time of writing).

@bernhardmgruber bernhardmgruber merged commit 2b2ea22 into alpaka-group:develop Sep 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

allocMappedBufIfSupported silently accepts non-platform types as TPlatform
5 participants