{"action":"created","issue":{"url":"https://api.github.com/repos/kokkos/kokkos/issues/1695","repository_url":"https://api.github.com/repos/kokkos/kokkos","labels_url":"https://api.github.com/repos/kokkos/kokkos/issues/1695/labels{/name}","comments_url":"https://api.github.com/repos/kokkos/kokkos/issues/1695/comments","events_url":"https://api.github.com/repos/kokkos/kokkos/issues/1695/events","html_url":"https://github.com/kokkos/kokkos/issues/1695","id":340378125,"node_id":"MDU6SXNzdWUzNDAzNzgxMjU=","number":1695,"title":"Illegal memory access to shared-memory view","user":{"login":"Char-Aznable","id":32589713,"node_id":"MDQ6VXNlcjMyNTg5NzEz","avatar_url":"https://avatars1.githubusercontent.com/u/32589713?v=4","gravatar_id":"","url":"https://api.github.com/users/Char-Aznable","html_url":"https://github.com/Char-Aznable","followers_url":"https://api.github.com/users/Char-Aznable/followers","following_url":"https://api.github.com/users/Char-Aznable/following{/other_user}","gists_url":"https://api.github.com/users/Char-Aznable/gists{/gist_id}","starred_url":"https://api.github.com/users/Char-Aznable/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Char-Aznable/subscriptions","organizations_url":"https://api.github.com/users/Char-Aznable/orgs","repos_url":"https://api.github.com/users/Char-Aznable/repos","events_url":"https://api.github.com/users/Char-Aznable/events{/privacy}","received_events_url":"https://api.github.com/users/Char-Aznable/received_events","type":"User","site_admin":false},"labels":[{"id":197378049,"node_id":"MDU6TGFiZWwxOTczNzgwNDk=","url":"https://api.github.com/repos/kokkos/kokkos/labels/question","name":"question","color":"cc317c","default":true}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2018-07-11T19:38:02Z","updated_at":"2018-07-11T20:15:48Z","closed_at":null,"author_association":"NONE","body":"I have the following code that triggers a `terminating with uncaught exception of type std::runtime_error: cudaDeviceSynchronize() error( cudaErrorIllegalAddress): an illegal memory access was encountered /home/aznb/mycodes/kokkos/core/src/Cuda/Kokkos_Cuda_Impl.cpp:119` in Cuda:\r\n\r\n```\r\n#include <Kokkos_Core.hpp>\r\n#include <Kokkos_DualView.hpp>\r\n#include <Kokkos_Random.hpp>\r\n\r\nusing namespace std;\r\n\r\nusing ExecutionSpace = Kokkos::DefaultExecutionSpace;\r\n\r\nstruct Foo {\r\n\r\n  Foo(uint64_t rndSeed) : rndPool_(rndSeed) {};\r\n\r\n  template < class E >\r\n  KOKKOS_INLINE_FUNCTION void move() {\r\n    \r\n    using TeamPolicy = Kokkos::TeamPolicy<E>;\r\n    using Team = typename TeamPolicy::member_type;\r\n    TeamPolicy policy(100, 256);\r\n\r\n    auto rndPool = rndPool_; //avoid capture this by pointer\r\n\r\n    Kokkos::parallel_for(policy.set_scratch_size(0,Kokkos::PerTeam(sizeof(int))), KOKKOS_LAMBDA (Team team) {\r\n\r\n      Kokkos::View<int, typename E::scratch_memory_space, Kokkos::MemoryTraits<Kokkos::Unmanaged>> \r\n        sharedInt(team.team_scratch(0));\r\n      sharedInt() = 10889;\r\n      }); \r\n  }\r\n\r\n  Kokkos::Random_XorShift64_Pool<ExecutionSpace> rndPool_;\r\n};\r\n\r\n\r\nint main(int argc, char* argv[]) {\r\n  Kokkos::initialize(argc,argv); {\r\n\r\n  Foo d(829819);\r\n\r\n  d.move<ExecutionSpace>();\r\n\r\n  Kokkos::fence();\r\n\r\n  } Kokkos::finalize();\r\n}\r\n\r\n```\r\nI couldn't figure out a way to debug this. Any suggestion?"},"comment":{"url":"https://api.github.com/repos/kokkos/kokkos/issues/comments/404296180","html_url":"https://github.com/kokkos/kokkos/issues/1695#issuecomment-404296180","issue_url":"https://api.github.com/repos/kokkos/kokkos/issues/1695","id":404296180,"node_id":"MDEyOklzc3VlQ29tbWVudDQwNDI5NjE4MA==","user":{"login":"crtrott","id":9490481,"node_id":"MDQ6VXNlcjk0OTA0ODE=","avatar_url":"https://avatars1.githubusercontent.com/u/9490481?v=4","gravatar_id":"","url":"https://api.github.com/users/crtrott","html_url":"https://github.com/crtrott","followers_url":"https://api.github.com/users/crtrott/followers","following_url":"https://api.github.com/users/crtrott/following{/other_user}","gists_url":"https://api.github.com/users/crtrott/gists{/gist_id}","starred_url":"https://api.github.com/users/crtrott/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/crtrott/subscriptions","organizations_url":"https://api.github.com/users/crtrott/orgs","repos_url":"https://api.github.com/users/crtrott/repos","events_url":"https://api.github.com/users/crtrott/events{/privacy}","received_events_url":"https://api.github.com/users/crtrott/received_events","type":"User","site_admin":false},"created_at":"2018-07-11T20:15:48Z","updated_at":"2018-07-11T20:15:48Z","author_association":"MEMBER","body":"Can you give more info (SHA of Kokkos, post the KokkosCore_config.h, compiler versions, hardware)? I can't reproduce it. The example you gave runs fine even when checking with cuda-memcheck. "}}
{"actor":{"display_login":"crtrott"}}