{"action":"created","comment":{"url":"https://api.github.com/repos/fireice-uk/xmr-stak-cpu/pulls/comments/117639093","pull_request_review_id":39362257,"id":117639093,"diff_hunk":"@@ -0,0 +1,211 @@\n+#pragma once\n+\n+#include \"console.h\"\n+#include <hwloc.h>\n+\n+/*\n+ * compat_popcnt is adapted from public domain code by:\n+ * Portable Snippets - https://gitub.com/nemequ/portable-snippets\n+ * Created by Evan Nemerson <evan@nemerson.com>\n+ */\n+int compat_popcnt(size_t x) \n+{\n+\tx = x - ((x >> 1) & (size_t)~(size_t)0/3);","path":"autoAdjustHwloc.hpp","position":13,"original_position":13,"commit_id":"b8061d80410e05f306e13063ec0f12a2c8eb80b4","original_commit_id":"b8061d80410e05f306e13063ec0f12a2c8eb80b4","user":{"login":"psychocrypt","id":25899446,"avatar_url":"https://avatars3.githubusercontent.com/u/25899446?v=3","gravatar_id":"","url":"https://api.github.com/users/psychocrypt","html_url":"https://github.com/psychocrypt","followers_url":"https://api.github.com/users/psychocrypt/followers","following_url":"https://api.github.com/users/psychocrypt/following{/other_user}","gists_url":"https://api.github.com/users/psychocrypt/gists{/gist_id}","starred_url":"https://api.github.com/users/psychocrypt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/psychocrypt/subscriptions","organizations_url":"https://api.github.com/users/psychocrypt/orgs","repos_url":"https://api.github.com/users/psychocrypt/repos","events_url":"https://api.github.com/users/psychocrypt/events{/privacy}","received_events_url":"https://api.github.com/users/psychocrypt/received_events","type":"User","site_admin":false},"body":"Instead of adding this little magic code we can also add a for loop what is human readable.\r\nThe code part is not time critical.\r\n```C++\r\ntemplate< typename T >\r\nint compat_popcnt( T x ) \r\n{\r\n  size_t count = 0;\r\n  for( int i=0; i < sizeof(T) - 1; ++i )\r\n    if( ((x>>i) & 1) == 1 )\r\n      ++count;\r\n}\r\n```","created_at":"2017-05-21T18:27:45Z","updated_at":"2017-05-21T18:27:45Z","html_url":"https://github.com/fireice-uk/xmr-stak-cpu/pull/108#discussion_r117639093","pull_request_url":"https://api.github.com/repos/fireice-uk/xmr-stak-cpu/pulls/108","_links":{"self":{"href":"https://api.github.com/repos/fireice-uk/xmr-stak-cpu/pulls/comments/117639093"},"html":{"href":"https://github.com/fireice-uk/xmr-stak-cpu/pull/108#discussion_r117639093"},"pull_request":{"href":"https://api.github.com/repos/fireice-uk/xmr-stak-cpu/pulls/108"}}},"pull_request":{"url":"https://api.github.com/repos/fireice-uk/xmr-stak-cpu/pulls/108","id":120460481,"html_url":"https://github.com/fireice-uk/xmr-stak-cpu/pull/108","diff_url":"https://github.com/fireice-uk/xmr-stak-cpu/pull/108.diff","patch_url":"https://github.com/fireice-uk/xmr-stak-cpu/pull/108.patch","issue_url":"https://api.github.com/repos/fireice-uk/xmr-stak-cpu/issues/108","number":108,"state":"open","locked":false,"title":"hwloc autoadjust","user":{"login":"psychocrypt","id":25899446,"avatar_url":"https://avatars3.githubusercontent.com/u/25899446?v=3","gravatar_id":"","url":"https://api.github.com/users/psychocrypt","html_url":"https://github.com/psychocrypt","followers_url":"https://api.github.com/users/psychocrypt/followers","following_url":"https://api.github.com/users/psychocrypt/following{/other_user}","gists_url":"https://api.github.com/users/psychocrypt/gists{/gist_id}","starred_url":"https://api.github.com/users/psychocrypt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/psychocrypt/subscriptions","organizations_url":"https://api.github.com/users/psychocrypt/orgs","repos_url":"https://api.github.com/users/psychocrypt/repos","events_url":"https://api.github.com/users/psychocrypt/events{/privacy}","received_events_url":"https://api.github.com/users/psychocrypt/received_events","type":"User","site_admin":false},"body":"- `CMakeLists.txt` add find code to search for `hwloc`\r\n- `autoAdjustHwloc.hpp` search optimal config based on hwloc topology\r\n- update `README.txt`\r\n\r\nIf hwloc is disabled with the cmake flag `-DHWLOC_ENABLE=OFF` than the old auto adjust implementation is used.\r\n \r\n## Tests\r\n\r\n-  [x] linux with L3 cache\r\n  - AMD Opteron 62766 4 Socket\r\n  - Intel i7 4600U\r\n  - E5 2630 v3 2 Socket\r\n  - ...\r\n- [x] linux without L3 cache\r\n- [x] windows (tested by @fireice-uk)","created_at":"2017-05-13T19:31:18Z","updated_at":"2017-05-21T18:27:45Z","closed_at":null,"merged_at":null,"merge_commit_sha":"1d3cf21f3c4da0ec5e8dca2a9646e6d9a6603821","assignee":{"login":"fireice-uk","id":5392418,"avatar_url":"https://avatars0.githubusercontent.com/u/5392418?v=3","gravatar_id":"","url":"https://api.github.com/users/fireice-uk","html_url":"https://github.com/fireice-uk","followers_url":"https://api.github.com/users/fireice-uk/followers","following_url":"https://api.github.com/users/fireice-uk/following{/other_user}","gists_url":"https://api.github.com/users/fireice-uk/gists{/gist_id}","starred_url":"https://api.github.com/users/fireice-uk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fireice-uk/subscriptions","organizations_url":"https://api.github.com/users/fireice-uk/orgs","repos_url":"https://api.github.com/users/fireice-uk/repos","events_url":"https://api.github.com/users/fireice-uk/events{/privacy}","received_events_url":"https://api.github.com/users/fireice-uk/received_events","type":"User","site_admin":false},"assignees":[{"login":"fireice-uk","id":5392418,"avatar_url":"https://avatars0.githubusercontent.com/u/5392418?v=3","gravatar_id":"","url":"https://api.github.com/users/fireice-uk","html_url":"https://github.com/fireice-uk","followers_url":"https://api.github.com/users/fireice-uk/followers","following_url":"https://api.github.com/users/fireice-uk/following{/other_user}","gists_url":"https://api.github.com/users/fireice-uk/gists{/gist_id}","starred_url":"https://api.github.com/users/fireice-uk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fireice-uk/subscriptions","organizations_url":"https://api.github.com/users/fireice-uk/orgs","repos_url":"https://api.github.com/users/fireice-uk/repos","events_url":"https://api.github.com/users/fireice-uk/events{/privacy}","received_events_url":"https://api.github.com/users/fireice-uk/received_events","type":"User","site_admin":false}],"requested_reviewers":[{"login":"fireice-uk","id":5392418,"avatar_url":"https://avatars0.githubusercontent.com/u/5392418?v=3","gravatar_id":"","url":"https://api.github.com/users/fireice-uk","html_url":"https://github.com/fireice-uk","followers_url":"https://api.github.com/users/fireice-uk/followers","following_url":"https://api.github.com/users/fireice-uk/following{/other_user}","gists_url":"https://api.github.com/users/fireice-uk/gists{/gist_id}","starred_url":"https://api.github.com/users/fireice-uk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fireice-uk/subscriptions","organizations_url":"https://api.github.com/users/fireice-uk/orgs","repos_url":"https://api.github.com/users/fireice-uk/repos","events_url":"https://api.github.com/users/fireice-uk/events{/privacy}","received_events_url":"https://api.github.com/users/fireice-uk/received_events","type":"User","site_admin":false}],"milestone":null,"commits_url":"https://api.github.com/repos/fireice-uk/xmr-stak-cpu/pulls/108/commits","review_comments_url":"https://api.github.com/repos/fireice-uk/xmr-stak-cpu/pulls/108/comments","review_comment_url":"https://api.github.com/repos/fireice-uk/xmr-stak-cpu/pulls/comments{/number}","comments_url":"https://api.github.com/repos/fireice-uk/xmr-stak-cpu/issues/108/comments","statuses_url":"https://api.github.com/repos/fireice-uk/xmr-stak-cpu/statuses/b8061d80410e05f306e13063ec0f12a2c8eb80b4","head":{"label":"psychocrypt:topic-hwloc","ref":"topic-hwloc","sha":"b8061d80410e05f306e13063ec0f12a2c8eb80b4","user":{"login":"psychocrypt","id":25899446,"avatar_url":"https://avatars3.githubusercontent.com/u/25899446?v=3","gravatar_id":"","url":"https://api.github.com/users/psychocrypt","html_url":"https://github.com/psychocrypt","followers_url":"https://api.github.com/users/psychocrypt/followers","following_url":"https://api.github.com/users/psychocrypt/following{/other_user}","gists_url":"https://api.github.com/users/psychocrypt/gists{/gist_id}","starred_url":"https://api.github.com/users/psychocrypt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/psychocrypt/subscriptions","organizations_url":"https://api.github.com/users/psychocrypt/orgs","repos_url":"https://api.github.com/users/psychocrypt/repos","events_url":"https://api.github.com/users/psychocrypt/events{/privacy}","received_events_url":"https://api.github.com/users/psychocrypt/received_events","type":"User","site_admin":false},"repo":{"id":88085779,"name":"xmr-stak-cpu","full_name":"psychocrypt/xmr-stak-cpu","owner":{"login":"psychocrypt","id":25899446,"avatar_url":"https://avatars3.githubusercontent.com/u/25899446?v=3","gravatar_id":"","url":"https://api.github.com/users/psychocrypt","html_url":"https://github.com/psychocrypt","followers_url":"https://api.github.com/users/psychocrypt/followers","following_url":"https://api.github.com/users/psychocrypt/following{/other_user}","gists_url":"https://api.github.com/users/psychocrypt/gists{/gist_id}","starred_url":"https://api.github.com/users/psychocrypt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/psychocrypt/subscriptions","organizations_url":"https://api.github.com/users/psychocrypt/orgs","repos_url":"https://api.github.com/users/psychocrypt/repos","events_url":"https://api.github.com/users/psychocrypt/events{/privacy}","received_events_url":"https://api.github.com/users/psychocrypt/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/psychocrypt/xmr-stak-cpu","description":"Monero CPU miner","fork":true,"url":"https://api.github.com/repos/psychocrypt/xmr-stak-cpu","forks_url":"https://api.github.com/repos/psychocrypt/xmr-stak-cpu/forks","keys_url":"https://api.github.com/repos/psychocrypt/xmr-stak-cpu/keys{/key_id}","collaborators_url":"https://api.github.com/repos/psychocrypt/xmr-stak-cpu/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/psychocrypt/xmr-stak-cpu/teams","hooks_url":"https://api.github.com/repos/psychocrypt/xmr-stak-cpu/hooks","issue_events_url":"https://api.github.com/repos/psychocrypt/xmr-stak-cpu/issues/events{/number}","events_url":"https://api.github.com/repos/psychocrypt/xmr-stak-cpu/events","assignees_url":"https://api.github.com/repos/psychocrypt/xmr-stak-cpu/assignees{/user}","branches_url":"https://api.github.com/repos/psychocrypt/xmr-stak-cpu/branches{/branch}","tags_url":"https://api.github.com/repos/psychocrypt/xmr-stak-cpu/tags","blobs_url":"https://api.github.com/repos/psychocrypt/xmr-stak-cpu/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/psychocrypt/xmr-stak-cpu/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/psychocrypt/xmr-stak-cpu/git/refs{/sha}","trees_url":"https://api.github.com/repos/psychocrypt/xmr-stak-cpu/git/trees{/sha}","statuses_url":"https://api.github.com/repos/psychocrypt/xmr-stak-cpu/statuses/{sha}","languages_url":"https://api.github.com/repos/psychocrypt/xmr-stak-cpu/languages","stargazers_url":"https://api.github.com/repos/psychocrypt/xmr-stak-cpu/stargazers","contributors_url":"https://api.github.com/repos/psychocrypt/xmr-stak-cpu/contributors","subscribers_url":"https://api.github.com/repos/psychocrypt/xmr-stak-cpu/subscribers","subscription_url":"https://api.github.com/repos/psychocrypt/xmr-stak-cpu/subscription","commits_url":"https://api.github.com/repos/psychocrypt/xmr-stak-cpu/commits{/sha}","git_commits_url":"https://api.github.com/repos/psychocrypt/xmr-stak-cpu/git/commits{/sha}","comments_url":"https://api.github.com/repos/psychocrypt/xmr-stak-cpu/comments{/number}","issue_comment_url":"https://api.github.com/repos/psychocrypt/xmr-stak-cpu/issues/comments{/number}","contents_url":"https://api.github.com/repos/psychocrypt/xmr-stak-cpu/contents/{+path}","compare_url":"https://api.github.com/repos/psychocrypt/xmr-stak-cpu/compare/{base}...{head}","merges_url":"https://api.github.com/repos/psychocrypt/xmr-stak-cpu/merges","archive_url":"https://api.github.com/repos/psychocrypt/xmr-stak-cpu/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/psychocrypt/xmr-stak-cpu/downloads","issues_url":"https://api.github.com/repos/psychocrypt/xmr-stak-cpu/issues{/number}","pulls_url":"https://api.github.com/repos/psychocrypt/xmr-stak-cpu/pulls{/number}","milestones_url":"https://api.github.com/repos/psychocrypt/xmr-stak-cpu/milestones{/number}","notifications_url":"https://api.github.com/repos/psychocrypt/xmr-stak-cpu/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/psychocrypt/xmr-stak-cpu/labels{/name}","releases_url":"https://api.github.com/repos/psychocrypt/xmr-stak-cpu/releases{/id}","deployments_url":"https://api.github.com/repos/psychocrypt/xmr-stak-cpu/deployments","created_at":"2017-04-12T18:52:24Z","updated_at":"2017-04-12T18:52:26Z","pushed_at":"2017-05-21T10:11:12Z","git_url":"git://github.com/psychocrypt/xmr-stak-cpu.git","ssh_url":"git@github.com:psychocrypt/xmr-stak-cpu.git","clone_url":"https://github.com/psychocrypt/xmr-stak-cpu.git","svn_url":"https://github.com/psychocrypt/xmr-stak-cpu","homepage":null,"size":395,"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,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"fireice-uk:dev","ref":"dev","sha":"8f51236e6743849bd3737d633f9716607b7427d1","user":{"login":"fireice-uk","id":5392418,"avatar_url":"https://avatars0.githubusercontent.com/u/5392418?v=3","gravatar_id":"","url":"https://api.github.com/users/fireice-uk","html_url":"https://github.com/fireice-uk","followers_url":"https://api.github.com/users/fireice-uk/followers","following_url":"https://api.github.com/users/fireice-uk/following{/other_user}","gists_url":"https://api.github.com/users/fireice-uk/gists{/gist_id}","starred_url":"https://api.github.com/users/fireice-uk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fireice-uk/subscriptions","organizations_url":"https://api.github.com/users/fireice-uk/orgs","repos_url":"https://api.github.com/users/fireice-uk/repos","events_url":"https://api.github.com/users/fireice-uk/events{/privacy}","received_events_url":"https://api.github.com/users/fireice-uk/received_events","type":"User","site_admin":false},"repo":{"id":77832701,"name":"xmr-stak-cpu","full_name":"fireice-uk/xmr-stak-cpu","owner":{"login":"fireice-uk","id":5392418,"avatar_url":"https://avatars0.githubusercontent.com/u/5392418?v=3","gravatar_id":"","url":"https://api.github.com/users/fireice-uk","html_url":"https://github.com/fireice-uk","followers_url":"https://api.github.com/users/fireice-uk/followers","following_url":"https://api.github.com/users/fireice-uk/following{/other_user}","gists_url":"https://api.github.com/users/fireice-uk/gists{/gist_id}","starred_url":"https://api.github.com/users/fireice-uk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fireice-uk/subscriptions","organizations_url":"https://api.github.com/users/fireice-uk/orgs","repos_url":"https://api.github.com/users/fireice-uk/repos","events_url":"https://api.github.com/users/fireice-uk/events{/privacy}","received_events_url":"https://api.github.com/users/fireice-uk/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/fireice-uk/xmr-stak-cpu","description":"Monero CPU miner","fork":false,"url":"https://api.github.com/repos/fireice-uk/xmr-stak-cpu","forks_url":"https://api.github.com/repos/fireice-uk/xmr-stak-cpu/forks","keys_url":"https://api.github.com/repos/fireice-uk/xmr-stak-cpu/keys{/key_id}","collaborators_url":"https://api.github.com/repos/fireice-uk/xmr-stak-cpu/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/fireice-uk/xmr-stak-cpu/teams","hooks_url":"https://api.github.com/repos/fireice-uk/xmr-stak-cpu/hooks","issue_events_url":"https://api.github.com/repos/fireice-uk/xmr-stak-cpu/issues/events{/number}","events_url":"https://api.github.com/repos/fireice-uk/xmr-stak-cpu/events","assignees_url":"https://api.github.com/repos/fireice-uk/xmr-stak-cpu/assignees{/user}","branches_url":"https://api.github.com/repos/fireice-uk/xmr-stak-cpu/branches{/branch}","tags_url":"https://api.github.com/repos/fireice-uk/xmr-stak-cpu/tags","blobs_url":"https://api.github.com/repos/fireice-uk/xmr-stak-cpu/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/fireice-uk/xmr-stak-cpu/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/fireice-uk/xmr-stak-cpu/git/refs{/sha}","trees_url":"https://api.github.com/repos/fireice-uk/xmr-stak-cpu/git/trees{/sha}","statuses_url":"https://api.github.com/repos/fireice-uk/xmr-stak-cpu/statuses/{sha}","languages_url":"https://api.github.com/repos/fireice-uk/xmr-stak-cpu/languages","stargazers_url":"https://api.github.com/repos/fireice-uk/xmr-stak-cpu/stargazers","contributors_url":"https://api.github.com/repos/fireice-uk/xmr-stak-cpu/contributors","subscribers_url":"https://api.github.com/repos/fireice-uk/xmr-stak-cpu/subscribers","subscription_url":"https://api.github.com/repos/fireice-uk/xmr-stak-cpu/subscription","commits_url":"https://api.github.com/repos/fireice-uk/xmr-stak-cpu/commits{/sha}","git_commits_url":"https://api.github.com/repos/fireice-uk/xmr-stak-cpu/git/commits{/sha}","comments_url":"https://api.github.com/repos/fireice-uk/xmr-stak-cpu/comments{/number}","issue_comment_url":"https://api.github.com/repos/fireice-uk/xmr-stak-cpu/issues/comments{/number}","contents_url":"https://api.github.com/repos/fireice-uk/xmr-stak-cpu/contents/{+path}","compare_url":"https://api.github.com/repos/fireice-uk/xmr-stak-cpu/compare/{base}...{head}","merges_url":"https://api.github.com/repos/fireice-uk/xmr-stak-cpu/merges","archive_url":"https://api.github.com/repos/fireice-uk/xmr-stak-cpu/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/fireice-uk/xmr-stak-cpu/downloads","issues_url":"https://api.github.com/repos/fireice-uk/xmr-stak-cpu/issues{/number}","pulls_url":"https://api.github.com/repos/fireice-uk/xmr-stak-cpu/pulls{/number}","milestones_url":"https://api.github.com/repos/fireice-uk/xmr-stak-cpu/milestones{/number}","notifications_url":"https://api.github.com/repos/fireice-uk/xmr-stak-cpu/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/fireice-uk/xmr-stak-cpu/labels{/name}","releases_url":"https://api.github.com/repos/fireice-uk/xmr-stak-cpu/releases{/id}","deployments_url":"https://api.github.com/repos/fireice-uk/xmr-stak-cpu/deployments","created_at":"2017-01-02T12:43:41Z","updated_at":"2017-05-21T17:24:48Z","pushed_at":"2017-05-21T10:11:13Z","git_url":"git://github.com/fireice-uk/xmr-stak-cpu.git","ssh_url":"git@github.com:fireice-uk/xmr-stak-cpu.git","clone_url":"https://github.com/fireice-uk/xmr-stak-cpu.git","svn_url":"https://github.com/fireice-uk/xmr-stak-cpu","homepage":null,"size":378,"stargazers_count":118,"watchers_count":118,"language":"C++","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":68,"mirror_url":null,"open_issues_count":13,"forks":68,"open_issues":13,"watchers":118,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/fireice-uk/xmr-stak-cpu/pulls/108"},"html":{"href":"https://github.com/fireice-uk/xmr-stak-cpu/pull/108"},"issue":{"href":"https://api.github.com/repos/fireice-uk/xmr-stak-cpu/issues/108"},"comments":{"href":"https://api.github.com/repos/fireice-uk/xmr-stak-cpu/issues/108/comments"},"review_comments":{"href":"https://api.github.com/repos/fireice-uk/xmr-stak-cpu/pulls/108/comments"},"review_comment":{"href":"https://api.github.com/repos/fireice-uk/xmr-stak-cpu/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/fireice-uk/xmr-stak-cpu/pulls/108/commits"},"statuses":{"href":"https://api.github.com/repos/fireice-uk/xmr-stak-cpu/statuses/b8061d80410e05f306e13063ec0f12a2c8eb80b4"}}}}
{"actor":{"display_login":"psychocrypt"}}