{"action":"opened","issue":{"url":"https://api.github.com/repos/kokkos/kokkos/issues/1630","repository_url":"https://api.github.com/repos/kokkos/kokkos","labels_url":"https://api.github.com/repos/kokkos/kokkos/issues/1630/labels{/name}","comments_url":"https://api.github.com/repos/kokkos/kokkos/issues/1630/comments","events_url":"https://api.github.com/repos/kokkos/kokkos/issues/1630/events","html_url":"https://github.com/kokkos/kokkos/issues/1630","id":324505593,"number":1630,"title":"Question: Kokkos::deep_copy of Kokkos::DualView","user":{"login":"Char-Aznable","id":32589713,"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":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-05-18T18:15:36Z","updated_at":"2018-05-18T18:15:36Z","closed_at":null,"author_association":"NONE","body":"I'm looking at the specialization of Kokkos::deep_copy for Kokkos::DualView:\r\n```\r\ntemplate< class DT , class DL , class DD , class DM ,\r\n          class ST , class SL , class SD , class SM >\r\nvoid\r\ndeep_copy (DualView<DT,DL,DD,DM> dst, // trust me, this must not be a reference\r\n           const DualView<ST,SL,SD,SM>& src )\r\n{\r\n  if (src.modified_device () >= src.modified_host ()) {\r\n    deep_copy (dst.d_view, src.d_view);\r\n    dst.template modify<typename DualView<DT,DL,DD,DM>::device_type> ();\r\n  } else {\r\n    deep_copy (dst.h_view, src.h_view);\r\n    dst.template modify<typename DualView<DT,DL,DD,DM>::host_mirror_space> ();\r\n  }\r\n}\r\n```\r\nIf my guess is right, deep copying DualView only copy the device view when neither the source device or host view is marked modified. This seems a bit counter-intuitive because one would manually perform deep_copy on the member d_view if that's what needs to be done. Why not perform deep_copy on both host and device view unconditionally?"}}
{"actor":{"display_login":"Char-Aznable"}}