{"action":"created","issue":{"url":"https://api.github.com/repos/halide/Halide/issues/792","labels_url":"https://api.github.com/repos/halide/Halide/issues/792/labels{/name}","comments_url":"https://api.github.com/repos/halide/Halide/issues/792/comments","events_url":"https://api.github.com/repos/halide/Halide/issues/792/events","html_url":"https://github.com/halide/Halide/issues/792","id":75687958,"number":792,"title":"GPU code shouldn't call halide_copy_to_device for output buffers","user":{"login":"steven-johnson","id":328955,"avatar_url":"https://avatars.githubusercontent.com/u/328955?v=3","gravatar_id":"","url":"https://api.github.com/users/steven-johnson","html_url":"https://github.com/steven-johnson","followers_url":"https://api.github.com/users/steven-johnson/followers","following_url":"https://api.github.com/users/steven-johnson/following{/other_user}","gists_url":"https://api.github.com/users/steven-johnson/gists{/gist_id}","starred_url":"https://api.github.com/users/steven-johnson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/steven-johnson/subscriptions","organizations_url":"https://api.github.com/users/steven-johnson/orgs","repos_url":"https://api.github.com/users/steven-johnson/repos","events_url":"https://api.github.com/users/steven-johnson/events{/privacy}","received_events_url":"https://api.github.com/users/steven-johnson/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-05-12T18:08:24Z","updated_at":"2015-05-12T18:30:39Z","closed_at":null,"body":"It appears that the GLSL code calls halide_copy_to_device() for all buffers; this is necessary for input buffers, but not for output buffers (which should only need to ensure that the device field references a valid texture, not that the texture's contents matches host). (Might be true for all GPU backends, but GLSL is the only one I've tried.)"},"comment":{"url":"https://api.github.com/repos/halide/Halide/issues/comments/101376910","html_url":"https://github.com/halide/Halide/issues/792#issuecomment-101376910","issue_url":"https://api.github.com/repos/halide/Halide/issues/792","id":101376910,"user":{"login":"abestephensg","id":8227267,"avatar_url":"https://avatars.githubusercontent.com/u/8227267?v=3","gravatar_id":"","url":"https://api.github.com/users/abestephensg","html_url":"https://github.com/abestephensg","followers_url":"https://api.github.com/users/abestephensg/followers","following_url":"https://api.github.com/users/abestephensg/following{/other_user}","gists_url":"https://api.github.com/users/abestephensg/gists{/gist_id}","starred_url":"https://api.github.com/users/abestephensg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/abestephensg/subscriptions","organizations_url":"https://api.github.com/users/abestephensg/orgs","repos_url":"https://api.github.com/users/abestephensg/repos","events_url":"https://api.github.com/users/abestephensg/events{/privacy}","received_events_url":"https://api.github.com/users/abestephensg/received_events","type":"User","site_admin":false},"created_at":"2015-05-12T18:30:39Z","updated_at":"2015-05-12T18:30:39Z","body":"If the host_dirty flag is not set, the GL runtime won't copy any data--there shouldn't be a corresponding call to halide_opengl_copy_to_device.\r\n\r\nIf Halide can determine that the entire buffer is written to by the filter, we could eliminate the call and ignore the flag, even if it is set."}}