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

fix uid generation and usage #1

Conversation

psychocoderHPC
Copy link

  • add id call to function allocVar and allocArr
  • UniqueId.hpp
    • use #if" instead of#ifdef` to check the compiler
    • use signed value for array declaration

@@ -32,7 +32,7 @@ namespace alpaka
namespace detail
{
//#############################################################################
// Based on the code from Filip Ros�en at http://b.atch.se/posts/constexpr-counter/
// Based on the code from Filip Ros�en at http://b.atch.se/posts/constexpr-counter/
Copy link
Owner

Choose a reason for hiding this comment

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

Could you replace the '�' with a simple 'e'?

Copy link
Author

Choose a reason for hiding this comment

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

ohh yes. We should encode all files with plain ascii and not with UTF8. There are some compiler were we get problems with UTF8:-(

@@ -108,7 +108,7 @@ namespace alpaka
auto constexpr reader(
float,
flag<N>,
std::size_t R = reader(std::size_t{0u}, flag<N-1u>{}))
std::size_t R = reader(std::size_t(0), flag<N-1u>()))
Copy link
Owner

Choose a reason for hiding this comment

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

What is the advantage of using paranthesis versus the brackets?
There is a semantic difference. Your version is a cast while my version fails compilation if the value is not exactly representable by the given type. However, in this case there is no difference for the flag constructor.

Copy link
Author

Choose a reason for hiding this comment

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

I think I changed it because it not compile with {} but I will check it again.

- add id call to function `allocVar` and `allocArr`
- `UniqueId.hpp`
  - use `#if" instead of `#ifdef` to check the compiler
  - use signed value for array declaration
  - enable declaration of `flag<>` and `adl_flag<>()`
@psychocoderHPC
Copy link
Author

I changed site_t(0) back to size_t{0} and enable the forward declarations of flag<> and flag_adl<>() else nvcc not compile.

nvcc still produce wrong/equal id's!

BenjaminW3 added a commit that referenced this pull request Nov 6, 2015
@BenjaminW3 BenjaminW3 merged commit 4c1a306 into BenjaminW3:fix-shared-alloc Nov 6, 2015
@psychocoderHPC psychocoderHPC deleted the fix-shared-alloc-onHost branch November 6, 2015 17:59
BenjaminW3 pushed a commit that referenced this pull request Oct 31, 2019
Add unit tests for template argument deduction in kernels
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.

2 participants