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

Kokkos View dimension_() for long returning unsigned int #20

Closed
jdbooth opened this issue Jun 9, 2015 · 2 comments
Closed

Kokkos View dimension_() for long returning unsigned int #20

jdbooth opened this issue Jun 9, 2015 · 2 comments
Assignees
Labels
Bug Broken / incorrect code; it could be Kokkos' responsibility, or others’ (e.g., Trilinos)

Comments

@jdbooth
Copy link

jdbooth commented Jun 9, 2015

Ticket: Regarding issue posted on Kokkos-developers
view.dimiension_0() returning unsigned int, when using long type to index.

Email

Ok that said. It actually does do something incorrect. It seems that somewhere internally an unsigned int is used. 4294967296 gives a view with dimension_0() being reported as 0 while 4294967295 gives back the correct length. Can you open a ticket on github for us?

Thanks
Christian

Test Code:

include

//Kokkos

include <Kokkos_Core.hpp>

include <impl/Kokkos_Timer.hpp>

int main(int argc, char* argv[])
{
typedef long long Int;
typedef double Entry;
typedef Kokkos::OpenMP Node;
typedef Kokkos::View<Entry*, Node> View;
typedef Kokkos::ViewAllocateWithoutInitializing NO_INIT;
Kokkos::initialize(argc, argv);
Node::print_configuration(std::cout, true);
Int size = 67449499257;
View a = View(NO_INIT("a"), size);
std::cout << "Size: " << size << " View.size: " << a.dimension_0() << std::en
dl;
for(Int i = 0; i < size-1; i++)
{
a(i) = 0.0;
}
}//end main()

@crtrott crtrott added the Bug Broken / incorrect code; it could be Kokkos' responsibility, or others’ (e.g., Trilinos) label Jun 10, 2015
@jgfouca
Copy link
Contributor

jgfouca commented Jun 12, 2015

I have a pull request in to fix this:
#22

@crtrott
Copy link
Member

crtrott commented Jun 15, 2015

This is merged in and seems to fix the issue.

@crtrott crtrott closed this as completed Jun 15, 2015
dalg24 pushed a commit to dalg24/kokkos that referenced this issue Dec 1, 2020
add device-portable copysign for floats
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Broken / incorrect code; it could be Kokkos' responsibility, or others’ (e.g., Trilinos)
Projects
None yet
Development

No branches or pull requests

3 participants