{"action":"created","comment":{"url":"https://api.github.com/repos/boostorg/compute/pulls/comments/64991044","id":64991044,"diff_hunk":"@@ -11,7 +11,9 @@\n //Code sample for calculating histogram using OpenCL and\n //displaying image histogram in OpenCV.\n \n-#define BOOST_COMPUTE_DEBUG_KERNEL_COMPILATION\n+#ifndef BOOST_COMPUTE_DEBUG_KERNEL_COMPILATION\n+    #define BOOST_COMPUTE_DEBUG_KERNEL_COMPILATION\n+#endif","path":"example/opencv_histogram.cpp","position":7,"original_position":7,"commit_id":"69e09f27d8337ae5f5ec26742efcc318ca42e90c","original_commit_id":"69e09f27d8337ae5f5ec26742efcc318ca42e90c","user":{"login":"haahh","id":2720260,"avatar_url":"https://avatars.githubusercontent.com/u/2720260?v=3","gravatar_id":"","url":"https://api.github.com/users/haahh","html_url":"https://github.com/haahh","followers_url":"https://api.github.com/users/haahh/followers","following_url":"https://api.github.com/users/haahh/following{/other_user}","gists_url":"https://api.github.com/users/haahh/gists{/gist_id}","starred_url":"https://api.github.com/users/haahh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/haahh/subscriptions","organizations_url":"https://api.github.com/users/haahh/orgs","repos_url":"https://api.github.com/users/haahh/repos","events_url":"https://api.github.com/users/haahh/events{/privacy}","received_events_url":"https://api.github.com/users/haahh/received_events","type":"User","site_admin":false},"body":"Will fix that later today.","created_at":"2016-05-28T16:33:27Z","updated_at":"2016-05-28T16:33:27Z","html_url":"https://github.com/boostorg/compute/pull/616#discussion_r64991044","pull_request_url":"https://api.github.com/repos/boostorg/compute/pulls/616","_links":{"self":{"href":"https://api.github.com/repos/boostorg/compute/pulls/comments/64991044"},"html":{"href":"https://github.com/boostorg/compute/pull/616#discussion_r64991044"},"pull_request":{"href":"https://api.github.com/repos/boostorg/compute/pulls/616"}}},"pull_request":{"url":"https://api.github.com/repos/boostorg/compute/pulls/616","id":71628392,"html_url":"https://github.com/boostorg/compute/pull/616","diff_url":"https://github.com/boostorg/compute/pull/616.diff","patch_url":"https://github.com/boostorg/compute/pull/616.patch","issue_url":"https://api.github.com/repos/boostorg/compute/issues/616","number":616,"state":"open","locked":false,"title":"Type-safe copying","user":{"login":"haahh","id":2720260,"avatar_url":"https://avatars.githubusercontent.com/u/2720260?v=3","gravatar_id":"","url":"https://api.github.com/users/haahh","html_url":"https://github.com/haahh","followers_url":"https://api.github.com/users/haahh/followers","following_url":"https://api.github.com/users/haahh/following{/other_user}","gists_url":"https://api.github.com/users/haahh/gists{/gist_id}","starred_url":"https://api.github.com/users/haahh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/haahh/subscriptions","organizations_url":"https://api.github.com/users/haahh/orgs","repos_url":"https://api.github.com/users/haahh/repos","events_url":"https://api.github.com/users/haahh/events{/privacy}","received_events_url":"https://api.github.com/users/haahh/received_events","type":"User","site_admin":false},"body":"Resolves https://github.com/boostorg/compute/issues/363.\r\n\r\n#### Sync. copying to/from device\r\n\r\nFor both coping data to and from device there are 3 `dispatch_copy()` functions and each function works in different scenario:\r\n\r\n1. Copying to device when value types (of `InputIterator` and `OutputIterator`) match and host iterator is contiguous\r\n2. Copying to device when value types mismatch and host iterator is contiguous\r\n3. Copying to device when host iterator is not contiguous (values types does not have to match)\r\n\r\n##### 1st option\r\nIt's straightforward copying using OpenCL functions for reading and writing a device memory.\r\n\r\n##### 2nd option has three sub-options\r\n1. Maping device memory to host and performing `std::copy` (casting/converting and copying on host)\r\n2. Using `std::vector<DeviceIterator::value_type>` as a intermediate memory  (casting/converting on host, copying using OpenCL function)\r\n3. Maping host memory to the device and using copy kernel to both convert and copy the data.\r\n\r\n##### 3rd option has two sub-options\r\n1. Maping device memory to host and performing `std::copy` (casting/converting and copying on host)\r\n2. Using `std::vector<DeviceIterator::value_type>` as a intermediate memory  (casting/converting on host, copying using OpenCL function)\r\n\r\n##### Additional info\r\nWhen copying to host memory we treat host iterators whose value type is `bool` as if they were non-contiguous.\r\n\r\n#### Async. copying to/from device\r\n\r\nThere is asynchronous copying with mismatching types works too. In both cases (to/from device) I used maping host memory to the device and using copy kernel to both convert and copy the data.\r\n\r\n####  Various fixes\r\n\r\n* Fix types in `perf_sort_by_key.cpp`\r\n* Fix return values in async coping `svm_ptr<>` from/to device\r\n* Fix test in test_functional_as.cpp","created_at":"2016-05-26T21:34:52Z","updated_at":"2016-05-28T16:33:27Z","closed_at":null,"merged_at":null,"merge_commit_sha":"3e4286f4937fd788984919c2edc2c2d62879b22a","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/boostorg/compute/pulls/616/commits","review_comments_url":"https://api.github.com/repos/boostorg/compute/pulls/616/comments","review_comment_url":"https://api.github.com/repos/boostorg/compute/pulls/comments{/number}","comments_url":"https://api.github.com/repos/boostorg/compute/issues/616/comments","statuses_url":"https://api.github.com/repos/boostorg/compute/statuses/69e09f27d8337ae5f5ec26742efcc318ca42e90c","head":{"label":"haahh:pr_typesafe_copy","ref":"pr_typesafe_copy","sha":"69e09f27d8337ae5f5ec26742efcc318ca42e90c","user":{"login":"haahh","id":2720260,"avatar_url":"https://avatars.githubusercontent.com/u/2720260?v=3","gravatar_id":"","url":"https://api.github.com/users/haahh","html_url":"https://github.com/haahh","followers_url":"https://api.github.com/users/haahh/followers","following_url":"https://api.github.com/users/haahh/following{/other_user}","gists_url":"https://api.github.com/users/haahh/gists{/gist_id}","starred_url":"https://api.github.com/users/haahh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/haahh/subscriptions","organizations_url":"https://api.github.com/users/haahh/orgs","repos_url":"https://api.github.com/users/haahh/repos","events_url":"https://api.github.com/users/haahh/events{/privacy}","received_events_url":"https://api.github.com/users/haahh/received_events","type":"User","site_admin":false},"repo":{"id":31648019,"name":"compute","full_name":"haahh/compute","owner":{"login":"haahh","id":2720260,"avatar_url":"https://avatars.githubusercontent.com/u/2720260?v=3","gravatar_id":"","url":"https://api.github.com/users/haahh","html_url":"https://github.com/haahh","followers_url":"https://api.github.com/users/haahh/followers","following_url":"https://api.github.com/users/haahh/following{/other_user}","gists_url":"https://api.github.com/users/haahh/gists{/gist_id}","starred_url":"https://api.github.com/users/haahh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/haahh/subscriptions","organizations_url":"https://api.github.com/users/haahh/orgs","repos_url":"https://api.github.com/users/haahh/repos","events_url":"https://api.github.com/users/haahh/events{/privacy}","received_events_url":"https://api.github.com/users/haahh/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/haahh/compute","description":"A C++ GPU Computing Library for OpenCL","fork":true,"url":"https://api.github.com/repos/haahh/compute","forks_url":"https://api.github.com/repos/haahh/compute/forks","keys_url":"https://api.github.com/repos/haahh/compute/keys{/key_id}","collaborators_url":"https://api.github.com/repos/haahh/compute/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/haahh/compute/teams","hooks_url":"https://api.github.com/repos/haahh/compute/hooks","issue_events_url":"https://api.github.com/repos/haahh/compute/issues/events{/number}","events_url":"https://api.github.com/repos/haahh/compute/events","assignees_url":"https://api.github.com/repos/haahh/compute/assignees{/user}","branches_url":"https://api.github.com/repos/haahh/compute/branches{/branch}","tags_url":"https://api.github.com/repos/haahh/compute/tags","blobs_url":"https://api.github.com/repos/haahh/compute/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/haahh/compute/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/haahh/compute/git/refs{/sha}","trees_url":"https://api.github.com/repos/haahh/compute/git/trees{/sha}","statuses_url":"https://api.github.com/repos/haahh/compute/statuses/{sha}","languages_url":"https://api.github.com/repos/haahh/compute/languages","stargazers_url":"https://api.github.com/repos/haahh/compute/stargazers","contributors_url":"https://api.github.com/repos/haahh/compute/contributors","subscribers_url":"https://api.github.com/repos/haahh/compute/subscribers","subscription_url":"https://api.github.com/repos/haahh/compute/subscription","commits_url":"https://api.github.com/repos/haahh/compute/commits{/sha}","git_commits_url":"https://api.github.com/repos/haahh/compute/git/commits{/sha}","comments_url":"https://api.github.com/repos/haahh/compute/comments{/number}","issue_comment_url":"https://api.github.com/repos/haahh/compute/issues/comments{/number}","contents_url":"https://api.github.com/repos/haahh/compute/contents/{+path}","compare_url":"https://api.github.com/repos/haahh/compute/compare/{base}...{head}","merges_url":"https://api.github.com/repos/haahh/compute/merges","archive_url":"https://api.github.com/repos/haahh/compute/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/haahh/compute/downloads","issues_url":"https://api.github.com/repos/haahh/compute/issues{/number}","pulls_url":"https://api.github.com/repos/haahh/compute/pulls{/number}","milestones_url":"https://api.github.com/repos/haahh/compute/milestones{/number}","notifications_url":"https://api.github.com/repos/haahh/compute/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/haahh/compute/labels{/name}","releases_url":"https://api.github.com/repos/haahh/compute/releases{/id}","deployments_url":"https://api.github.com/repos/haahh/compute/deployments","created_at":"2015-03-04T09:11:05Z","updated_at":"2016-03-09T14:14:39Z","pushed_at":"2016-05-28T14:47:45Z","git_url":"git://github.com/haahh/compute.git","ssh_url":"git@github.com:haahh/compute.git","clone_url":"https://github.com/haahh/compute.git","svn_url":"https://github.com/haahh/compute","homepage":"http://kylelutz.github.io/compute/","size":8374,"stargazers_count":0,"watchers_count":0,"language":"C++","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"boostorg:develop","ref":"develop","sha":"d41ff00c06945c927418395491c8ed82787c0a4b","user":{"login":"boostorg","id":3170529,"avatar_url":"https://avatars.githubusercontent.com/u/3170529?v=3","gravatar_id":"","url":"https://api.github.com/users/boostorg","html_url":"https://github.com/boostorg","followers_url":"https://api.github.com/users/boostorg/followers","following_url":"https://api.github.com/users/boostorg/following{/other_user}","gists_url":"https://api.github.com/users/boostorg/gists{/gist_id}","starred_url":"https://api.github.com/users/boostorg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/boostorg/subscriptions","organizations_url":"https://api.github.com/users/boostorg/orgs","repos_url":"https://api.github.com/users/boostorg/repos","events_url":"https://api.github.com/users/boostorg/events{/privacy}","received_events_url":"https://api.github.com/users/boostorg/received_events","type":"Organization","site_admin":false},"repo":{"id":8526347,"name":"compute","full_name":"boostorg/compute","owner":{"login":"boostorg","id":3170529,"avatar_url":"https://avatars.githubusercontent.com/u/3170529?v=3","gravatar_id":"","url":"https://api.github.com/users/boostorg","html_url":"https://github.com/boostorg","followers_url":"https://api.github.com/users/boostorg/followers","following_url":"https://api.github.com/users/boostorg/following{/other_user}","gists_url":"https://api.github.com/users/boostorg/gists{/gist_id}","starred_url":"https://api.github.com/users/boostorg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/boostorg/subscriptions","organizations_url":"https://api.github.com/users/boostorg/orgs","repos_url":"https://api.github.com/users/boostorg/repos","events_url":"https://api.github.com/users/boostorg/events{/privacy}","received_events_url":"https://api.github.com/users/boostorg/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/boostorg/compute","description":"A C++ GPU Computing Library for OpenCL","fork":false,"url":"https://api.github.com/repos/boostorg/compute","forks_url":"https://api.github.com/repos/boostorg/compute/forks","keys_url":"https://api.github.com/repos/boostorg/compute/keys{/key_id}","collaborators_url":"https://api.github.com/repos/boostorg/compute/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/boostorg/compute/teams","hooks_url":"https://api.github.com/repos/boostorg/compute/hooks","issue_events_url":"https://api.github.com/repos/boostorg/compute/issues/events{/number}","events_url":"https://api.github.com/repos/boostorg/compute/events","assignees_url":"https://api.github.com/repos/boostorg/compute/assignees{/user}","branches_url":"https://api.github.com/repos/boostorg/compute/branches{/branch}","tags_url":"https://api.github.com/repos/boostorg/compute/tags","blobs_url":"https://api.github.com/repos/boostorg/compute/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/boostorg/compute/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/boostorg/compute/git/refs{/sha}","trees_url":"https://api.github.com/repos/boostorg/compute/git/trees{/sha}","statuses_url":"https://api.github.com/repos/boostorg/compute/statuses/{sha}","languages_url":"https://api.github.com/repos/boostorg/compute/languages","stargazers_url":"https://api.github.com/repos/boostorg/compute/stargazers","contributors_url":"https://api.github.com/repos/boostorg/compute/contributors","subscribers_url":"https://api.github.com/repos/boostorg/compute/subscribers","subscription_url":"https://api.github.com/repos/boostorg/compute/subscription","commits_url":"https://api.github.com/repos/boostorg/compute/commits{/sha}","git_commits_url":"https://api.github.com/repos/boostorg/compute/git/commits{/sha}","comments_url":"https://api.github.com/repos/boostorg/compute/comments{/number}","issue_comment_url":"https://api.github.com/repos/boostorg/compute/issues/comments{/number}","contents_url":"https://api.github.com/repos/boostorg/compute/contents/{+path}","compare_url":"https://api.github.com/repos/boostorg/compute/compare/{base}...{head}","merges_url":"https://api.github.com/repos/boostorg/compute/merges","archive_url":"https://api.github.com/repos/boostorg/compute/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/boostorg/compute/downloads","issues_url":"https://api.github.com/repos/boostorg/compute/issues{/number}","pulls_url":"https://api.github.com/repos/boostorg/compute/pulls{/number}","milestones_url":"https://api.github.com/repos/boostorg/compute/milestones{/number}","notifications_url":"https://api.github.com/repos/boostorg/compute/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/boostorg/compute/labels{/name}","releases_url":"https://api.github.com/repos/boostorg/compute/releases{/id}","deployments_url":"https://api.github.com/repos/boostorg/compute/deployments","created_at":"2013-03-02T20:15:58Z","updated_at":"2016-05-28T06:28:39Z","pushed_at":"2016-05-28T14:47:45Z","git_url":"git://github.com/boostorg/compute.git","ssh_url":"git@github.com:boostorg/compute.git","clone_url":"https://github.com/boostorg/compute.git","svn_url":"https://github.com/boostorg/compute","homepage":"http://boostorg.github.io/compute/","size":9402,"stargazers_count":540,"watchers_count":540,"language":"C++","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":128,"mirror_url":null,"open_issues_count":102,"forks":128,"open_issues":102,"watchers":540,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/boostorg/compute/pulls/616"},"html":{"href":"https://github.com/boostorg/compute/pull/616"},"issue":{"href":"https://api.github.com/repos/boostorg/compute/issues/616"},"comments":{"href":"https://api.github.com/repos/boostorg/compute/issues/616/comments"},"review_comments":{"href":"https://api.github.com/repos/boostorg/compute/pulls/616/comments"},"review_comment":{"href":"https://api.github.com/repos/boostorg/compute/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/boostorg/compute/pulls/616/commits"},"statuses":{"href":"https://api.github.com/repos/boostorg/compute/statuses/69e09f27d8337ae5f5ec26742efcc318ca42e90c"}}}}
{"actor":{"display_login":"haahh"}}