{"action":"created","comment":{"url":"https://api.github.com/repos/cupy/cupy/pulls/comments/214575348","pull_request_review_id":151659179,"id":214575348,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIxNDU3NTM0OA==","diff_hunk":"@@ -1,67 +1,60 @@\n+cimport cpython  # NOQA\n import os\n+import warnings\n \n from cupy import cuda\n-\n from cupy.cuda cimport function\n from cupy.cuda cimport runtime\n \n-import warnings\n-\n-\n-cdef struct _CArray:\n-    void* data\n-    Py_ssize_t size\n-    Py_ssize_t shape_and_strides[MAX_NDIM * 2]\n-\n \n cdef class CArray(CPointer):\n \n-    cdef:\n-        _CArray val\n-\n     def __init__(self, ndarray arr):\n-        cdef Py_ssize_t i\n-        cdef int ndim = arr._shape.size()\n-        self.val.data = <void*>arr.data.ptr\n-        self.val.size = arr.size\n+        cdef int i, ndim = arr._shape.size()\n+        self.ptr = cpython.PyObject_Malloc(sizeof(Py_ssize_t) * (2 + 2 * ndim))","path":"cupy/core/carray.pxi","position":30,"original_position":30,"commit_id":"29a16f2aae32f1776f8b1ac3203489182dced0b9","original_commit_id":"29a16f2aae32f1776f8b1ac3203489182dced0b9","user":{"login":"okuta","id":7133388,"node_id":"MDQ6VXNlcjcxMzMzODg=","avatar_url":"https://avatars1.githubusercontent.com/u/7133388?v=4","gravatar_id":"","url":"https://api.github.com/users/okuta","html_url":"https://github.com/okuta","followers_url":"https://api.github.com/users/okuta/followers","following_url":"https://api.github.com/users/okuta/following{/other_user}","gists_url":"https://api.github.com/users/okuta/gists{/gist_id}","starred_url":"https://api.github.com/users/okuta/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/okuta/subscriptions","organizations_url":"https://api.github.com/users/okuta/orgs","repos_url":"https://api.github.com/users/okuta/repos","events_url":"https://api.github.com/users/okuta/events{/privacy}","received_events_url":"https://api.github.com/users/okuta/received_events","type":"User","site_admin":false},"body":"https://docs.python.org/3.6/c-api/memory.html#the-pymalloc-allocator\r\n> Python has a pymalloc allocator optimized for small objects (smaller or equal to 512 bytes) with a short lifetime. \r\nCurrent CArray and CIndexter is smaller than 512 bytes. OK, I will revert,","created_at":"2018-09-03T04:52:27Z","updated_at":"2018-09-03T04:52:27Z","html_url":"https://github.com/cupy/cupy/pull/719#discussion_r214575348","pull_request_url":"https://api.github.com/repos/cupy/cupy/pulls/719","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/cupy/cupy/pulls/comments/214575348"},"html":{"href":"https://github.com/cupy/cupy/pull/719#discussion_r214575348"},"pull_request":{"href":"https://api.github.com/repos/cupy/cupy/pulls/719"}},"in_reply_to_id":214565574},"pull_request":{"url":"https://api.github.com/repos/cupy/cupy/pulls/719","id":150719713,"node_id":"MDExOlB1bGxSZXF1ZXN0MTUwNzE5NzEz","html_url":"https://github.com/cupy/cupy/pull/719","diff_url":"https://github.com/cupy/cupy/pull/719.diff","patch_url":"https://github.com/cupy/cupy/pull/719.patch","issue_url":"https://api.github.com/repos/cupy/cupy/issues/719","number":719,"state":"open","locked":false,"title":"Reduce Python object to improve kernel launch performance","user":{"login":"okuta","id":7133388,"node_id":"MDQ6VXNlcjcxMzMzODg=","avatar_url":"https://avatars1.githubusercontent.com/u/7133388?v=4","gravatar_id":"","url":"https://api.github.com/users/okuta","html_url":"https://github.com/okuta","followers_url":"https://api.github.com/users/okuta/followers","following_url":"https://api.github.com/users/okuta/following{/other_user}","gists_url":"https://api.github.com/users/okuta/gists{/gist_id}","starred_url":"https://api.github.com/users/okuta/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/okuta/subscriptions","organizations_url":"https://api.github.com/users/okuta/orgs","repos_url":"https://api.github.com/users/okuta/repos","events_url":"https://api.github.com/users/okuta/events{/privacy}","received_events_url":"https://api.github.com/users/okuta/received_events","type":"User","site_admin":false},"body":"Creating Python object is high cost. This PR reduce it.\r\n- Use convert_scalar to simplify.\r\n- Use PyObject_Malloc to avoid MAX_NDIM limit.","created_at":"2017-11-05T12:14:48Z","updated_at":"2018-09-03T04:52:27Z","closed_at":null,"merged_at":null,"merge_commit_sha":"c5afd721502885aeec828dbda3499c9410ffcbcc","assignee":{"login":"niboshi","id":635436,"node_id":"MDQ6VXNlcjYzNTQzNg==","avatar_url":"https://avatars0.githubusercontent.com/u/635436?v=4","gravatar_id":"","url":"https://api.github.com/users/niboshi","html_url":"https://github.com/niboshi","followers_url":"https://api.github.com/users/niboshi/followers","following_url":"https://api.github.com/users/niboshi/following{/other_user}","gists_url":"https://api.github.com/users/niboshi/gists{/gist_id}","starred_url":"https://api.github.com/users/niboshi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/niboshi/subscriptions","organizations_url":"https://api.github.com/users/niboshi/orgs","repos_url":"https://api.github.com/users/niboshi/repos","events_url":"https://api.github.com/users/niboshi/events{/privacy}","received_events_url":"https://api.github.com/users/niboshi/received_events","type":"User","site_admin":false},"assignees":[{"login":"niboshi","id":635436,"node_id":"MDQ6VXNlcjYzNTQzNg==","avatar_url":"https://avatars0.githubusercontent.com/u/635436?v=4","gravatar_id":"","url":"https://api.github.com/users/niboshi","html_url":"https://github.com/niboshi","followers_url":"https://api.github.com/users/niboshi/followers","following_url":"https://api.github.com/users/niboshi/following{/other_user}","gists_url":"https://api.github.com/users/niboshi/gists{/gist_id}","starred_url":"https://api.github.com/users/niboshi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/niboshi/subscriptions","organizations_url":"https://api.github.com/users/niboshi/orgs","repos_url":"https://api.github.com/users/niboshi/repos","events_url":"https://api.github.com/users/niboshi/events{/privacy}","received_events_url":"https://api.github.com/users/niboshi/received_events","type":"User","site_admin":false}],"requested_reviewers":[],"requested_teams":[],"labels":[{"id":472944226,"node_id":"MDU6TGFiZWw0NzI5NDQyMjY=","url":"https://api.github.com/repos/cupy/cupy/labels/enhancement","name":"enhancement","color":"84b6eb","default":true}],"milestone":null,"commits_url":"https://api.github.com/repos/cupy/cupy/pulls/719/commits","review_comments_url":"https://api.github.com/repos/cupy/cupy/pulls/719/comments","review_comment_url":"https://api.github.com/repos/cupy/cupy/pulls/comments{/number}","comments_url":"https://api.github.com/repos/cupy/cupy/issues/719/comments","statuses_url":"https://api.github.com/repos/cupy/cupy/statuses/29a16f2aae32f1776f8b1ac3203489182dced0b9","head":{"label":"okuta:improve-kernel-launch","ref":"improve-kernel-launch","sha":"29a16f2aae32f1776f8b1ac3203489182dced0b9","user":{"login":"okuta","id":7133388,"node_id":"MDQ6VXNlcjcxMzMzODg=","avatar_url":"https://avatars1.githubusercontent.com/u/7133388?v=4","gravatar_id":"","url":"https://api.github.com/users/okuta","html_url":"https://github.com/okuta","followers_url":"https://api.github.com/users/okuta/followers","following_url":"https://api.github.com/users/okuta/following{/other_user}","gists_url":"https://api.github.com/users/okuta/gists{/gist_id}","starred_url":"https://api.github.com/users/okuta/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/okuta/subscriptions","organizations_url":"https://api.github.com/users/okuta/orgs","repos_url":"https://api.github.com/users/okuta/repos","events_url":"https://api.github.com/users/okuta/events{/privacy}","received_events_url":"https://api.github.com/users/okuta/received_events","type":"User","site_admin":false},"repo":{"id":92201297,"node_id":"MDEwOlJlcG9zaXRvcnk5MjIwMTI5Nw==","name":"cupy","full_name":"okuta/cupy","owner":{"login":"okuta","id":7133388,"node_id":"MDQ6VXNlcjcxMzMzODg=","avatar_url":"https://avatars1.githubusercontent.com/u/7133388?v=4","gravatar_id":"","url":"https://api.github.com/users/okuta","html_url":"https://github.com/okuta","followers_url":"https://api.github.com/users/okuta/followers","following_url":"https://api.github.com/users/okuta/following{/other_user}","gists_url":"https://api.github.com/users/okuta/gists{/gist_id}","starred_url":"https://api.github.com/users/okuta/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/okuta/subscriptions","organizations_url":"https://api.github.com/users/okuta/orgs","repos_url":"https://api.github.com/users/okuta/repos","events_url":"https://api.github.com/users/okuta/events{/privacy}","received_events_url":"https://api.github.com/users/okuta/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/okuta/cupy","description":"NumPy-like API accelerated with CUDA","fork":true,"url":"https://api.github.com/repos/okuta/cupy","forks_url":"https://api.github.com/repos/okuta/cupy/forks","keys_url":"https://api.github.com/repos/okuta/cupy/keys{/key_id}","collaborators_url":"https://api.github.com/repos/okuta/cupy/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/okuta/cupy/teams","hooks_url":"https://api.github.com/repos/okuta/cupy/hooks","issue_events_url":"https://api.github.com/repos/okuta/cupy/issues/events{/number}","events_url":"https://api.github.com/repos/okuta/cupy/events","assignees_url":"https://api.github.com/repos/okuta/cupy/assignees{/user}","branches_url":"https://api.github.com/repos/okuta/cupy/branches{/branch}","tags_url":"https://api.github.com/repos/okuta/cupy/tags","blobs_url":"https://api.github.com/repos/okuta/cupy/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/okuta/cupy/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/okuta/cupy/git/refs{/sha}","trees_url":"https://api.github.com/repos/okuta/cupy/git/trees{/sha}","statuses_url":"https://api.github.com/repos/okuta/cupy/statuses/{sha}","languages_url":"https://api.github.com/repos/okuta/cupy/languages","stargazers_url":"https://api.github.com/repos/okuta/cupy/stargazers","contributors_url":"https://api.github.com/repos/okuta/cupy/contributors","subscribers_url":"https://api.github.com/repos/okuta/cupy/subscribers","subscription_url":"https://api.github.com/repos/okuta/cupy/subscription","commits_url":"https://api.github.com/repos/okuta/cupy/commits{/sha}","git_commits_url":"https://api.github.com/repos/okuta/cupy/git/commits{/sha}","comments_url":"https://api.github.com/repos/okuta/cupy/comments{/number}","issue_comment_url":"https://api.github.com/repos/okuta/cupy/issues/comments{/number}","contents_url":"https://api.github.com/repos/okuta/cupy/contents/{+path}","compare_url":"https://api.github.com/repos/okuta/cupy/compare/{base}...{head}","merges_url":"https://api.github.com/repos/okuta/cupy/merges","archive_url":"https://api.github.com/repos/okuta/cupy/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/okuta/cupy/downloads","issues_url":"https://api.github.com/repos/okuta/cupy/issues{/number}","pulls_url":"https://api.github.com/repos/okuta/cupy/pulls{/number}","milestones_url":"https://api.github.com/repos/okuta/cupy/milestones{/number}","notifications_url":"https://api.github.com/repos/okuta/cupy/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/okuta/cupy/labels{/name}","releases_url":"https://api.github.com/repos/okuta/cupy/releases{/id}","deployments_url":"https://api.github.com/repos/okuta/cupy/deployments","created_at":"2017-05-23T17:33:17Z","updated_at":"2018-08-26T18:38:29Z","pushed_at":"2018-09-02T17:00:48Z","git_url":"git://github.com/okuta/cupy.git","ssh_url":"git@github.com:okuta/cupy.git","clone_url":"https://github.com/okuta/cupy.git","svn_url":"https://github.com/okuta/cupy","homepage":null,"size":15323,"stargazers_count":1,"watchers_count":1,"language":"Python","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":0,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":0,"open_issues":0,"watchers":1,"default_branch":"master"}},"base":{"label":"cupy:master","ref":"master","sha":"7ab65ec861f1cafe78233f413eebb8ef0f038bb7","user":{"login":"cupy","id":23187665,"node_id":"MDEyOk9yZ2FuaXphdGlvbjIzMTg3NjY1","avatar_url":"https://avatars2.githubusercontent.com/u/23187665?v=4","gravatar_id":"","url":"https://api.github.com/users/cupy","html_url":"https://github.com/cupy","followers_url":"https://api.github.com/users/cupy/followers","following_url":"https://api.github.com/users/cupy/following{/other_user}","gists_url":"https://api.github.com/users/cupy/gists{/gist_id}","starred_url":"https://api.github.com/users/cupy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cupy/subscriptions","organizations_url":"https://api.github.com/users/cupy/orgs","repos_url":"https://api.github.com/users/cupy/repos","events_url":"https://api.github.com/users/cupy/events{/privacy}","received_events_url":"https://api.github.com/users/cupy/received_events","type":"Organization","site_admin":false},"repo":{"id":72523920,"node_id":"MDEwOlJlcG9zaXRvcnk3MjUyMzkyMA==","name":"cupy","full_name":"cupy/cupy","owner":{"login":"cupy","id":23187665,"node_id":"MDEyOk9yZ2FuaXphdGlvbjIzMTg3NjY1","avatar_url":"https://avatars2.githubusercontent.com/u/23187665?v=4","gravatar_id":"","url":"https://api.github.com/users/cupy","html_url":"https://github.com/cupy","followers_url":"https://api.github.com/users/cupy/followers","following_url":"https://api.github.com/users/cupy/following{/other_user}","gists_url":"https://api.github.com/users/cupy/gists{/gist_id}","starred_url":"https://api.github.com/users/cupy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cupy/subscriptions","organizations_url":"https://api.github.com/users/cupy/orgs","repos_url":"https://api.github.com/users/cupy/repos","events_url":"https://api.github.com/users/cupy/events{/privacy}","received_events_url":"https://api.github.com/users/cupy/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/cupy/cupy","description":"NumPy-like API accelerated with CUDA","fork":false,"url":"https://api.github.com/repos/cupy/cupy","forks_url":"https://api.github.com/repos/cupy/cupy/forks","keys_url":"https://api.github.com/repos/cupy/cupy/keys{/key_id}","collaborators_url":"https://api.github.com/repos/cupy/cupy/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/cupy/cupy/teams","hooks_url":"https://api.github.com/repos/cupy/cupy/hooks","issue_events_url":"https://api.github.com/repos/cupy/cupy/issues/events{/number}","events_url":"https://api.github.com/repos/cupy/cupy/events","assignees_url":"https://api.github.com/repos/cupy/cupy/assignees{/user}","branches_url":"https://api.github.com/repos/cupy/cupy/branches{/branch}","tags_url":"https://api.github.com/repos/cupy/cupy/tags","blobs_url":"https://api.github.com/repos/cupy/cupy/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/cupy/cupy/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/cupy/cupy/git/refs{/sha}","trees_url":"https://api.github.com/repos/cupy/cupy/git/trees{/sha}","statuses_url":"https://api.github.com/repos/cupy/cupy/statuses/{sha}","languages_url":"https://api.github.com/repos/cupy/cupy/languages","stargazers_url":"https://api.github.com/repos/cupy/cupy/stargazers","contributors_url":"https://api.github.com/repos/cupy/cupy/contributors","subscribers_url":"https://api.github.com/repos/cupy/cupy/subscribers","subscription_url":"https://api.github.com/repos/cupy/cupy/subscription","commits_url":"https://api.github.com/repos/cupy/cupy/commits{/sha}","git_commits_url":"https://api.github.com/repos/cupy/cupy/git/commits{/sha}","comments_url":"https://api.github.com/repos/cupy/cupy/comments{/number}","issue_comment_url":"https://api.github.com/repos/cupy/cupy/issues/comments{/number}","contents_url":"https://api.github.com/repos/cupy/cupy/contents/{+path}","compare_url":"https://api.github.com/repos/cupy/cupy/compare/{base}...{head}","merges_url":"https://api.github.com/repos/cupy/cupy/merges","archive_url":"https://api.github.com/repos/cupy/cupy/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/cupy/cupy/downloads","issues_url":"https://api.github.com/repos/cupy/cupy/issues{/number}","pulls_url":"https://api.github.com/repos/cupy/cupy/pulls{/number}","milestones_url":"https://api.github.com/repos/cupy/cupy/milestones{/number}","notifications_url":"https://api.github.com/repos/cupy/cupy/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/cupy/cupy/labels{/name}","releases_url":"https://api.github.com/repos/cupy/cupy/releases{/id}","deployments_url":"https://api.github.com/repos/cupy/cupy/deployments","created_at":"2016-11-01T09:54:45Z","updated_at":"2018-09-03T04:21:26Z","pushed_at":"2018-09-03T04:23:28Z","git_url":"git://github.com/cupy/cupy.git","ssh_url":"git@github.com:cupy/cupy.git","clone_url":"https://github.com/cupy/cupy.git","svn_url":"https://github.com/cupy/cupy","homepage":"https://cupy.chainer.org","size":15296,"stargazers_count":2097,"watchers_count":2097,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":177,"mirror_url":null,"archived":false,"open_issues_count":177,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":177,"open_issues":177,"watchers":2097,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/cupy/cupy/pulls/719"},"html":{"href":"https://github.com/cupy/cupy/pull/719"},"issue":{"href":"https://api.github.com/repos/cupy/cupy/issues/719"},"comments":{"href":"https://api.github.com/repos/cupy/cupy/issues/719/comments"},"review_comments":{"href":"https://api.github.com/repos/cupy/cupy/pulls/719/comments"},"review_comment":{"href":"https://api.github.com/repos/cupy/cupy/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/cupy/cupy/pulls/719/commits"},"statuses":{"href":"https://api.github.com/repos/cupy/cupy/statuses/29a16f2aae32f1776f8b1ac3203489182dced0b9"}},"author_association":"MEMBER"}}
{"actor":{"display_login":"okuta"}}