{"action":"created","comment":{"url":"https://api.github.com/repos/halide/Halide/pulls/comments/198229984","pull_request_review_id":132117778,"id":198229984,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDE5ODIyOTk4NA==","diff_hunk":"@@ -0,0 +1,165 @@\n+#include \"HalideRuntime.h\"\n+#include \"mini_hexagon_dma.h\"\n+#include \"HalideRuntimeHexagonDma.h\"\n+\n+namespace Halide { namespace Runtime { namespace Internal {\n+\n+typedef struct hexagon_cache_block {\n+    void *l2memory;\n+    size_t bytes;\n+    bool used;\n+    struct hexagon_cache_block *next;\n+} hexagon_cache_pool_t;\n+\n+typedef hexagon_cache_pool_t *pcache_pool;\n+\n+pcache_pool hexagon_cache_pool = NULL;\n+halide_mutex hexagon_cache_mutex; \n+\n+}}}\n+\n+using namespace Halide::Runtime::Internal;\n+\n+extern \"C\" {\n+//TO DO Add hjalide_mutex_lock to make it thread sahe \n+static inline void *hexagon_cache_pool_get (void *user_context, size_t size, bool retry) {\n+    // TODO: Add Mutex locking for access to hexagon_cache_pool ( To be thread safe )\n+    halide_mutex_lock(&hexagon_cache_mutex);\n+    pcache_pool temp = hexagon_cache_pool;\n+    pcache_pool prev = NULL;\n+\n+    // Walk the free list for chunk of memory.\n+    //Simplistic approach if free block size is less than the size requested assign\n+    while (temp != NULL) {\n+        if ((temp->used == false) &&\n+            (size == temp->bytes)) {\n+            temp->used = true;\n+            halide_mutex_unlock(&hexagon_cache_mutex);\n+            return (void *)temp->l2memory;\n+        }\n+        prev = temp;\n+        temp = temp->next;\n+    }\n+\n+    // If we are still here that means temp was null.\n+    temp = (pcache_pool) malloc(sizeof(hexagon_cache_pool_t));\n+    if (temp == NULL) {\n+        halide_print(user_context, \"Hexagon Cache Pool Allocation Failed.\\n\");\n+        halide_mutex_unlock(&hexagon_cache_mutex);     \n+        return NULL;\n+    }\n+    uint8_t *mem = (uint8_t *)HAP_cache_lock(sizeof(char) * size, NULL);\n+    if ((mem == NULL) && retry) {\n+        halide_print(user_context, \"HAP_cache_lock failed, try deallocating unused cache.\\n\");\n+        //Walk the list and deallocate unused blocks\n+        pcache_pool temp2 = hexagon_cache_pool;\n+        pcache_pool prev_node = hexagon_cache_pool;\n+        while (temp2 != NULL) {\n+            if (temp2->used == false) {\n+                HAP_cache_unlock(temp2->l2memory);\n+                //set previous node details\n+                prev_node->next = (temp2->next)->next;\n+                prev_node = temp2->next;\n+                //set head\n+                if (temp2 == hexagon_cache_pool) {\n+                    hexagon_cache_pool = temp2->next;\n+                 }","path":"src/runtime/hexagon_cache_allocator.cpp","position":66,"original_position":66,"commit_id":"bbcaee91c32c98ba43aba452fb1de3624f14cc5a","original_commit_id":"bbcaee91c32c98ba43aba452fb1de3624f14cc5a","user":{"login":"dsharletg","id":7494796,"node_id":"MDQ6VXNlcjc0OTQ3OTY=","avatar_url":"https://avatars1.githubusercontent.com/u/7494796?v=4","gravatar_id":"","url":"https://api.github.com/users/dsharletg","html_url":"https://github.com/dsharletg","followers_url":"https://api.github.com/users/dsharletg/followers","following_url":"https://api.github.com/users/dsharletg/following{/other_user}","gists_url":"https://api.github.com/users/dsharletg/gists{/gist_id}","starred_url":"https://api.github.com/users/dsharletg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dsharletg/subscriptions","organizations_url":"https://api.github.com/users/dsharletg/orgs","repos_url":"https://api.github.com/users/dsharletg/repos","events_url":"https://api.github.com/users/dsharletg/events{/privacy}","received_events_url":"https://api.github.com/users/dsharletg/received_events","type":"User","site_admin":false},"body":"Indentation","created_at":"2018-06-26T17:21:50Z","updated_at":"2018-06-26T17:43:49Z","html_url":"https://github.com/halide/Halide/pull/3087#discussion_r198229984","pull_request_url":"https://api.github.com/repos/halide/Halide/pulls/3087","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/halide/Halide/pulls/comments/198229984"},"html":{"href":"https://github.com/halide/Halide/pull/3087#discussion_r198229984"},"pull_request":{"href":"https://api.github.com/repos/halide/Halide/pulls/3087"}}},"pull_request":{"url":"https://api.github.com/repos/halide/Halide/pulls/3087","id":197478286,"node_id":"MDExOlB1bGxSZXF1ZXN0MTk3NDc4Mjg2","html_url":"https://github.com/halide/Halide/pull/3087","diff_url":"https://github.com/halide/Halide/pull/3087.diff","patch_url":"https://github.com/halide/Halide/pull/3087.patch","issue_url":"https://api.github.com/repos/halide/Halide/issues/3087","number":3087,"state":"open","locked":false,"title":"Hex dma2","user":{"login":"vgundlur","id":29530783,"node_id":"MDQ6VXNlcjI5NTMwNzgz","avatar_url":"https://avatars0.githubusercontent.com/u/29530783?v=4","gravatar_id":"","url":"https://api.github.com/users/vgundlur","html_url":"https://github.com/vgundlur","followers_url":"https://api.github.com/users/vgundlur/followers","following_url":"https://api.github.com/users/vgundlur/following{/other_user}","gists_url":"https://api.github.com/users/vgundlur/gists{/gist_id}","starred_url":"https://api.github.com/users/vgundlur/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vgundlur/subscriptions","organizations_url":"https://api.github.com/users/vgundlur/orgs","repos_url":"https://api.github.com/users/vgundlur/repos","events_url":"https://api.github.com/users/vgundlur/events{/privacy}","received_events_url":"https://api.github.com/users/vgundlur/received_events","type":"User","site_admin":false},"body":"1. Added Changes to support smaller Resolution Images\r\n   a. Width and Height must be Even and ROIWidth <=Width and ROIHeght <= Height\r\n2. Fixed the DMA Transfer For RAW Format by supported multiple dimensions\r\n   a. Added Two new Test Cases to validate this change\r\n3. Added New Memory Allocation type : \"LockedCache\" to storein() directive to lock the L2 cache for DMA\r\n   a. We have Extended Allocate visitor of \"CodeGen_Posix.cpp \" to handle Locked cache for Hexagon DMA\r\n   b. Modified all the current DMA Examples to use Storein() and the LockedCache Allocation Type.\r\n","created_at":"2018-06-26T16:15:16Z","updated_at":"2018-06-26T17:43:49Z","closed_at":null,"merged_at":null,"merge_commit_sha":"127b799abf7504030ba294c3440292c817d805bb","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/halide/Halide/pulls/3087/commits","review_comments_url":"https://api.github.com/repos/halide/Halide/pulls/3087/comments","review_comment_url":"https://api.github.com/repos/halide/Halide/pulls/comments{/number}","comments_url":"https://api.github.com/repos/halide/Halide/issues/3087/comments","statuses_url":"https://api.github.com/repos/halide/Halide/statuses/bbcaee91c32c98ba43aba452fb1de3624f14cc5a","head":{"label":"vgundlur:hex-dma2","ref":"hex-dma2","sha":"bbcaee91c32c98ba43aba452fb1de3624f14cc5a","user":{"login":"vgundlur","id":29530783,"node_id":"MDQ6VXNlcjI5NTMwNzgz","avatar_url":"https://avatars0.githubusercontent.com/u/29530783?v=4","gravatar_id":"","url":"https://api.github.com/users/vgundlur","html_url":"https://github.com/vgundlur","followers_url":"https://api.github.com/users/vgundlur/followers","following_url":"https://api.github.com/users/vgundlur/following{/other_user}","gists_url":"https://api.github.com/users/vgundlur/gists{/gist_id}","starred_url":"https://api.github.com/users/vgundlur/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vgundlur/subscriptions","organizations_url":"https://api.github.com/users/vgundlur/orgs","repos_url":"https://api.github.com/users/vgundlur/repos","events_url":"https://api.github.com/users/vgundlur/events{/privacy}","received_events_url":"https://api.github.com/users/vgundlur/received_events","type":"User","site_admin":false},"repo":{"id":118442524,"node_id":"MDEwOlJlcG9zaXRvcnkxMTg0NDI1MjQ=","name":"Halide","full_name":"vgundlur/Halide","owner":{"login":"vgundlur","id":29530783,"node_id":"MDQ6VXNlcjI5NTMwNzgz","avatar_url":"https://avatars0.githubusercontent.com/u/29530783?v=4","gravatar_id":"","url":"https://api.github.com/users/vgundlur","html_url":"https://github.com/vgundlur","followers_url":"https://api.github.com/users/vgundlur/followers","following_url":"https://api.github.com/users/vgundlur/following{/other_user}","gists_url":"https://api.github.com/users/vgundlur/gists{/gist_id}","starred_url":"https://api.github.com/users/vgundlur/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vgundlur/subscriptions","organizations_url":"https://api.github.com/users/vgundlur/orgs","repos_url":"https://api.github.com/users/vgundlur/repos","events_url":"https://api.github.com/users/vgundlur/events{/privacy}","received_events_url":"https://api.github.com/users/vgundlur/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/vgundlur/Halide","description":"a language for image processing and computational photography","fork":true,"url":"https://api.github.com/repos/vgundlur/Halide","forks_url":"https://api.github.com/repos/vgundlur/Halide/forks","keys_url":"https://api.github.com/repos/vgundlur/Halide/keys{/key_id}","collaborators_url":"https://api.github.com/repos/vgundlur/Halide/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/vgundlur/Halide/teams","hooks_url":"https://api.github.com/repos/vgundlur/Halide/hooks","issue_events_url":"https://api.github.com/repos/vgundlur/Halide/issues/events{/number}","events_url":"https://api.github.com/repos/vgundlur/Halide/events","assignees_url":"https://api.github.com/repos/vgundlur/Halide/assignees{/user}","branches_url":"https://api.github.com/repos/vgundlur/Halide/branches{/branch}","tags_url":"https://api.github.com/repos/vgundlur/Halide/tags","blobs_url":"https://api.github.com/repos/vgundlur/Halide/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/vgundlur/Halide/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/vgundlur/Halide/git/refs{/sha}","trees_url":"https://api.github.com/repos/vgundlur/Halide/git/trees{/sha}","statuses_url":"https://api.github.com/repos/vgundlur/Halide/statuses/{sha}","languages_url":"https://api.github.com/repos/vgundlur/Halide/languages","stargazers_url":"https://api.github.com/repos/vgundlur/Halide/stargazers","contributors_url":"https://api.github.com/repos/vgundlur/Halide/contributors","subscribers_url":"https://api.github.com/repos/vgundlur/Halide/subscribers","subscription_url":"https://api.github.com/repos/vgundlur/Halide/subscription","commits_url":"https://api.github.com/repos/vgundlur/Halide/commits{/sha}","git_commits_url":"https://api.github.com/repos/vgundlur/Halide/git/commits{/sha}","comments_url":"https://api.github.com/repos/vgundlur/Halide/comments{/number}","issue_comment_url":"https://api.github.com/repos/vgundlur/Halide/issues/comments{/number}","contents_url":"https://api.github.com/repos/vgundlur/Halide/contents/{+path}","compare_url":"https://api.github.com/repos/vgundlur/Halide/compare/{base}...{head}","merges_url":"https://api.github.com/repos/vgundlur/Halide/merges","archive_url":"https://api.github.com/repos/vgundlur/Halide/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/vgundlur/Halide/downloads","issues_url":"https://api.github.com/repos/vgundlur/Halide/issues{/number}","pulls_url":"https://api.github.com/repos/vgundlur/Halide/pulls{/number}","milestones_url":"https://api.github.com/repos/vgundlur/Halide/milestones{/number}","notifications_url":"https://api.github.com/repos/vgundlur/Halide/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/vgundlur/Halide/labels{/name}","releases_url":"https://api.github.com/repos/vgundlur/Halide/releases{/id}","deployments_url":"https://api.github.com/repos/vgundlur/Halide/deployments","created_at":"2018-01-22T10:31:38Z","updated_at":"2018-06-08T03:37:41Z","pushed_at":"2018-06-26T15:42:43Z","git_url":"git://github.com/vgundlur/Halide.git","ssh_url":"git@github.com:vgundlur/Halide.git","clone_url":"https://github.com/vgundlur/Halide.git","svn_url":"https://github.com/vgundlur/Halide","homepage":"http://halide-lang.org","size":244733,"stargazers_count":0,"watchers_count":0,"language":"C++","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":1,"license":{"key":"other","name":"Other","spdx_id":null,"url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"base":{"label":"halide:hex-dma2","ref":"hex-dma2","sha":"16976589a624916dd7a374adcfa2680c8bae4c74","user":{"login":"halide","id":1548551,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE1NDg1NTE=","avatar_url":"https://avatars2.githubusercontent.com/u/1548551?v=4","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,"node_id":"MDEwOlJlcG9zaXRvcnk1MjQxMzEy","name":"Halide","full_name":"halide/Halide","owner":{"login":"halide","id":1548551,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE1NDg1NTE=","avatar_url":"https://avatars2.githubusercontent.com/u/1548551?v=4","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 fast, portable data-parallel computation","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}","deployments_url":"https://api.github.com/repos/halide/Halide/deployments","created_at":"2012-07-31T04:05:25Z","updated_at":"2018-06-25T23:34:57Z","pushed_at":"2018-06-26T17:27:46Z","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":245681,"stargazers_count":2383,"watchers_count":2383,"language":"C++","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":491,"mirror_url":null,"archived":false,"open_issues_count":462,"license":{"key":"other","name":"Other","spdx_id":null,"url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":491,"open_issues":462,"watchers":2383,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/halide/Halide/pulls/3087"},"html":{"href":"https://github.com/halide/Halide/pull/3087"},"issue":{"href":"https://api.github.com/repos/halide/Halide/issues/3087"},"comments":{"href":"https://api.github.com/repos/halide/Halide/issues/3087/comments"},"review_comments":{"href":"https://api.github.com/repos/halide/Halide/pulls/3087/comments"},"review_comment":{"href":"https://api.github.com/repos/halide/Halide/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/halide/Halide/pulls/3087/commits"},"statuses":{"href":"https://api.github.com/repos/halide/Halide/statuses/bbcaee91c32c98ba43aba452fb1de3624f14cc5a"}},"author_association":"NONE"}}
{"actor":{"display_login":"dsharletg"}}