{"action":"created","comment":{"url":"https://api.github.com/repos/halide/Halide/pulls/comments/28270966","id":28270966,"diff_hunk":"@@ -140,6 +140,11 @@ struct Target {\n         return has_feature(CUDA) || has_feature(OpenCL);\n     }\n \n+    /** Some device apis use coordinate-based stores/loads. */\n+    bool has_coordinates_feature() const {\n+        return has_feature(OpenGL);","path":"src/Target.h","position":6,"original_position":6,"commit_id":"aae1887fd8cde3fa982173485a861725cc59076e","original_commit_id":"aae1887fd8cde3fa982173485a861725cc59076e","user":{"login":"aam","id":381137,"avatar_url":"https://avatars.githubusercontent.com/u/381137?v=3","gravatar_id":"","url":"https://api.github.com/users/aam","html_url":"https://github.com/aam","followers_url":"https://api.github.com/users/aam/followers","following_url":"https://api.github.com/users/aam/following{/other_user}","gists_url":"https://api.github.com/users/aam/gists{/gist_id}","starred_url":"https://api.github.com/users/aam/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aam/subscriptions","organizations_url":"https://api.github.com/users/aam/orgs","repos_url":"https://api.github.com/users/aam/repos","events_url":"https://api.github.com/users/aam/events{/privacy}","received_events_url":"https://api.github.com/users/aam/received_events","type":"User","site_admin":false},"body":"@dsharletg , well inside_kernel_loop condition is finer-grained since it looks for the loops that are scheduled for appropriate target device(OpenGL), while this has_coordinates_feature guards whole pass. Basically inject_coordinates_intrinsics does zero_gpu_loop_mins in addition to stuff in inside_kernel_loop.\r\nI was using existing OpenGL flow as inspiration, truth be told...","created_at":"2015-04-13T19:33:02Z","updated_at":"2015-04-13T19:33:02Z","html_url":"https://github.com/halide/Halide/pull/746#discussion_r28270966","pull_request_url":"https://api.github.com/repos/halide/Halide/pulls/746","_links":{"self":{"href":"https://api.github.com/repos/halide/Halide/pulls/comments/28270966"},"html":{"href":"https://github.com/halide/Halide/pull/746#discussion_r28270966"},"pull_request":{"href":"https://api.github.com/repos/halide/Halide/pulls/746"}}},"pull_request":{"url":"https://api.github.com/repos/halide/Halide/pulls/746","id":33160824,"html_url":"https://github.com/halide/Halide/pull/746","diff_url":"https://github.com/halide/Halide/pull/746.diff","patch_url":"https://github.com/halide/Halide/pull/746.patch","issue_url":"https://api.github.com/repos/halide/Halide/issues/746","number":746,"state":"open","locked":false,"title":"Introduce coordinate-based gets/sets intrinsics.","user":{"login":"aam","id":381137,"avatar_url":"https://avatars.githubusercontent.com/u/381137?v=3","gravatar_id":"","url":"https://api.github.com/users/aam","html_url":"https://github.com/aam","followers_url":"https://api.github.com/users/aam/followers","following_url":"https://api.github.com/users/aam/following{/other_user}","gists_url":"https://api.github.com/users/aam/gists{/gist_id}","starred_url":"https://api.github.com/users/aam/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aam/subscriptions","organizations_url":"https://api.github.com/users/aam/orgs","repos_url":"https://api.github.com/users/aam/repos","events_url":"https://api.github.com/users/aam/events{/privacy}","received_events_url":"https://api.github.com/users/aam/received_events","type":"User","site_admin":false},"body":"With introduction of Renderscript gets/sets, there is a need to refactor out coordinate-based intrinsics out of OpenGL GLSL normalized coordinates intrinsics.\r\nBoth Renderscript and OpenGL use (x,y[,c]) \"coordinates\" to access elements, rather than \"memory offset\" ```(x*stride+y*stride+c*stride)```.\r\nThis pull request splits OpenGL intrinsics into two: one is coordinates_get/set, which will be common between Renderscript and OpenGL, second is existing glsl_texture_get/set, which adds normalization to the coordinates: (x,y,c) becomes ```((x+0.5)/width, (y+0.5)/height, c)```.\r\n\r\n#rs-codegen and then #rs-runtime pull requests build up on this and actually add first Renderscript codegen, then Renderscript BitcodeWriter and bitcode generation.","created_at":"2015-04-13T12:56:35Z","updated_at":"2015-04-13T19:33:02Z","closed_at":null,"merged_at":null,"merge_commit_sha":"b7fecb589b7050468a082a786ff2499407cf6ba7","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/halide/Halide/pulls/746/commits","review_comments_url":"https://api.github.com/repos/halide/Halide/pulls/746/comments","review_comment_url":"https://api.github.com/repos/halide/Halide/pulls/comments{/number}","comments_url":"https://api.github.com/repos/halide/Halide/issues/746/comments","statuses_url":"https://api.github.com/repos/halide/Halide/statuses/aae1887fd8cde3fa982173485a861725cc59076e","head":{"label":"halide:coordinates-getset","ref":"coordinates-getset","sha":"aae1887fd8cde3fa982173485a861725cc59076e","user":{"login":"halide","id":1548551,"avatar_url":"https://avatars.githubusercontent.com/u/1548551?v=3","gravatar_id":"","url":"https://api.github.com/users/halide","html_url":"https://github.com/halide","followers_url":"https://api.github.com/users/halide/followers","following_url":"https://api.github.com/users/halide/following{/other_user}","gists_url":"https://api.github.com/users/halide/gists{/gist_id}","starred_url":"https://api.github.com/users/halide/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/halide/subscriptions","organizations_url":"https://api.github.com/users/halide/orgs","repos_url":"https://api.github.com/users/halide/repos","events_url":"https://api.github.com/users/halide/events{/privacy}","received_events_url":"https://api.github.com/users/halide/received_events","type":"Organization","site_admin":false},"repo":{"id":5241312,"name":"Halide","full_name":"halide/Halide","owner":{"login":"halide","id":1548551,"avatar_url":"https://avatars.githubusercontent.com/u/1548551?v=3","gravatar_id":"","url":"https://api.github.com/users/halide","html_url":"https://github.com/halide","followers_url":"https://api.github.com/users/halide/followers","following_url":"https://api.github.com/users/halide/following{/other_user}","gists_url":"https://api.github.com/users/halide/gists{/gist_id}","starred_url":"https://api.github.com/users/halide/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/halide/subscriptions","organizations_url":"https://api.github.com/users/halide/orgs","repos_url":"https://api.github.com/users/halide/repos","events_url":"https://api.github.com/users/halide/events{/privacy}","received_events_url":"https://api.github.com/users/halide/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/halide/Halide","description":"a language for image processing and computational photography","fork":false,"url":"https://api.github.com/repos/halide/Halide","forks_url":"https://api.github.com/repos/halide/Halide/forks","keys_url":"https://api.github.com/repos/halide/Halide/keys{/key_id}","collaborators_url":"https://api.github.com/repos/halide/Halide/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/halide/Halide/teams","hooks_url":"https://api.github.com/repos/halide/Halide/hooks","issue_events_url":"https://api.github.com/repos/halide/Halide/issues/events{/number}","events_url":"https://api.github.com/repos/halide/Halide/events","assignees_url":"https://api.github.com/repos/halide/Halide/assignees{/user}","branches_url":"https://api.github.com/repos/halide/Halide/branches{/branch}","tags_url":"https://api.github.com/repos/halide/Halide/tags","blobs_url":"https://api.github.com/repos/halide/Halide/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/halide/Halide/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/halide/Halide/git/refs{/sha}","trees_url":"https://api.github.com/repos/halide/Halide/git/trees{/sha}","statuses_url":"https://api.github.com/repos/halide/Halide/statuses/{sha}","languages_url":"https://api.github.com/repos/halide/Halide/languages","stargazers_url":"https://api.github.com/repos/halide/Halide/stargazers","contributors_url":"https://api.github.com/repos/halide/Halide/contributors","subscribers_url":"https://api.github.com/repos/halide/Halide/subscribers","subscription_url":"https://api.github.com/repos/halide/Halide/subscription","commits_url":"https://api.github.com/repos/halide/Halide/commits{/sha}","git_commits_url":"https://api.github.com/repos/halide/Halide/git/commits{/sha}","comments_url":"https://api.github.com/repos/halide/Halide/comments{/number}","issue_comment_url":"https://api.github.com/repos/halide/Halide/issues/comments{/number}","contents_url":"https://api.github.com/repos/halide/Halide/contents/{+path}","compare_url":"https://api.github.com/repos/halide/Halide/compare/{base}...{head}","merges_url":"https://api.github.com/repos/halide/Halide/merges","archive_url":"https://api.github.com/repos/halide/Halide/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/halide/Halide/downloads","issues_url":"https://api.github.com/repos/halide/Halide/issues{/number}","pulls_url":"https://api.github.com/repos/halide/Halide/pulls{/number}","milestones_url":"https://api.github.com/repos/halide/Halide/milestones{/number}","notifications_url":"https://api.github.com/repos/halide/Halide/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/halide/Halide/labels{/name}","releases_url":"https://api.github.com/repos/halide/Halide/releases{/id}","created_at":"2012-07-31T04:05:25Z","updated_at":"2015-04-12T12:33:58Z","pushed_at":"2015-04-13T13:11:32Z","git_url":"git://github.com/halide/Halide.git","ssh_url":"git@github.com:halide/Halide.git","clone_url":"https://github.com/halide/Halide.git","svn_url":"https://github.com/halide/Halide","homepage":"http://halide-lang.org","size":125429,"stargazers_count":934,"watchers_count":934,"language":"C++","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":163,"mirror_url":null,"open_issues_count":96,"forks":163,"open_issues":96,"watchers":934,"default_branch":"master"}},"base":{"label":"halide:master","ref":"master","sha":"eed096aa4520f4fc23141e2b5611fabb84a7c7ee","user":{"login":"halide","id":1548551,"avatar_url":"https://avatars.githubusercontent.com/u/1548551?v=3","gravatar_id":"","url":"https://api.github.com/users/halide","html_url":"https://github.com/halide","followers_url":"https://api.github.com/users/halide/followers","following_url":"https://api.github.com/users/halide/following{/other_user}","gists_url":"https://api.github.com/users/halide/gists{/gist_id}","starred_url":"https://api.github.com/users/halide/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/halide/subscriptions","organizations_url":"https://api.github.com/users/halide/orgs","repos_url":"https://api.github.com/users/halide/repos","events_url":"https://api.github.com/users/halide/events{/privacy}","received_events_url":"https://api.github.com/users/halide/received_events","type":"Organization","site_admin":false},"repo":{"id":5241312,"name":"Halide","full_name":"halide/Halide","owner":{"login":"halide","id":1548551,"avatar_url":"https://avatars.githubusercontent.com/u/1548551?v=3","gravatar_id":"","url":"https://api.github.com/users/halide","html_url":"https://github.com/halide","followers_url":"https://api.github.com/users/halide/followers","following_url":"https://api.github.com/users/halide/following{/other_user}","gists_url":"https://api.github.com/users/halide/gists{/gist_id}","starred_url":"https://api.github.com/users/halide/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/halide/subscriptions","organizations_url":"https://api.github.com/users/halide/orgs","repos_url":"https://api.github.com/users/halide/repos","events_url":"https://api.github.com/users/halide/events{/privacy}","received_events_url":"https://api.github.com/users/halide/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/halide/Halide","description":"a language for image processing and computational photography","fork":false,"url":"https://api.github.com/repos/halide/Halide","forks_url":"https://api.github.com/repos/halide/Halide/forks","keys_url":"https://api.github.com/repos/halide/Halide/keys{/key_id}","collaborators_url":"https://api.github.com/repos/halide/Halide/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/halide/Halide/teams","hooks_url":"https://api.github.com/repos/halide/Halide/hooks","issue_events_url":"https://api.github.com/repos/halide/Halide/issues/events{/number}","events_url":"https://api.github.com/repos/halide/Halide/events","assignees_url":"https://api.github.com/repos/halide/Halide/assignees{/user}","branches_url":"https://api.github.com/repos/halide/Halide/branches{/branch}","tags_url":"https://api.github.com/repos/halide/Halide/tags","blobs_url":"https://api.github.com/repos/halide/Halide/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/halide/Halide/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/halide/Halide/git/refs{/sha}","trees_url":"https://api.github.com/repos/halide/Halide/git/trees{/sha}","statuses_url":"https://api.github.com/repos/halide/Halide/statuses/{sha}","languages_url":"https://api.github.com/repos/halide/Halide/languages","stargazers_url":"https://api.github.com/repos/halide/Halide/stargazers","contributors_url":"https://api.github.com/repos/halide/Halide/contributors","subscribers_url":"https://api.github.com/repos/halide/Halide/subscribers","subscription_url":"https://api.github.com/repos/halide/Halide/subscription","commits_url":"https://api.github.com/repos/halide/Halide/commits{/sha}","git_commits_url":"https://api.github.com/repos/halide/Halide/git/commits{/sha}","comments_url":"https://api.github.com/repos/halide/Halide/comments{/number}","issue_comment_url":"https://api.github.com/repos/halide/Halide/issues/comments{/number}","contents_url":"https://api.github.com/repos/halide/Halide/contents/{+path}","compare_url":"https://api.github.com/repos/halide/Halide/compare/{base}...{head}","merges_url":"https://api.github.com/repos/halide/Halide/merges","archive_url":"https://api.github.com/repos/halide/Halide/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/halide/Halide/downloads","issues_url":"https://api.github.com/repos/halide/Halide/issues{/number}","pulls_url":"https://api.github.com/repos/halide/Halide/pulls{/number}","milestones_url":"https://api.github.com/repos/halide/Halide/milestones{/number}","notifications_url":"https://api.github.com/repos/halide/Halide/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/halide/Halide/labels{/name}","releases_url":"https://api.github.com/repos/halide/Halide/releases{/id}","created_at":"2012-07-31T04:05:25Z","updated_at":"2015-04-12T12:33:58Z","pushed_at":"2015-04-13T13:11:32Z","git_url":"git://github.com/halide/Halide.git","ssh_url":"git@github.com:halide/Halide.git","clone_url":"https://github.com/halide/Halide.git","svn_url":"https://github.com/halide/Halide","homepage":"http://halide-lang.org","size":125429,"stargazers_count":934,"watchers_count":934,"language":"C++","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":163,"mirror_url":null,"open_issues_count":96,"forks":163,"open_issues":96,"watchers":934,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/halide/Halide/pulls/746"},"html":{"href":"https://github.com/halide/Halide/pull/746"},"issue":{"href":"https://api.github.com/repos/halide/Halide/issues/746"},"comments":{"href":"https://api.github.com/repos/halide/Halide/issues/746/comments"},"review_comments":{"href":"https://api.github.com/repos/halide/Halide/pulls/746/comments"},"review_comment":{"href":"https://api.github.com/repos/halide/Halide/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/halide/Halide/pulls/746/commits"},"statuses":{"href":"https://api.github.com/repos/halide/Halide/statuses/aae1887fd8cde3fa982173485a861725cc59076e"}}}}