{"action":"created","comment":{"url":"https://api.github.com/repos/dotnet/machinelearning/pulls/comments/204075785","pull_request_review_id":139096311,"id":204075785,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIwNDA3NTc4NQ==","diff_hunk":"@@ -0,0 +1,536 @@\n+﻿// Licensed to the .NET Foundation under one or more agreements.\n+// The .NET Foundation licenses this file to you under the MIT license.\n+// See the LICENSE file in the project root for more information.\n+\n+using System.Runtime.Intrinsics;\n+using System.Runtime.Intrinsics.X86;\n+\n+namespace Microsoft.ML.Runtime.Internal.CpuMath\n+{\n+    internal static class SseIntrinsics\n+    {\n+        private static unsafe Vector128<float> Load1(float* src, int* idx)\n+        {\n+            return Sse.SetScalarVector128(src[idx[0]]);\n+        }\n+\n+        private static unsafe Vector128<float> Load4(float* src, int* idx)\n+        {\n+            return Sse.SetVector128(src[idx[3]], src[idx[2]], src[idx[1]], src[idx[0]]);\n+        }\n+\n+        private static Vector128<float> Rotate(Vector128<float> x)\n+        {\n+            return Sse.Shuffle(x, x, 0x39);\n+        }\n+\n+        private static Vector128<float> RotateReverse(Vector128<float> x)\n+        {\n+            return Sse.Shuffle(x, x, 0x93);\n+        }\n+\n+        // Warning: this operation changes the value of x => do not reuse x\n+        private static unsafe void Store4(Vector128<float> x, float* dst, int* idx)\n+        {\n+            Sse.StoreScalar(dst + idx[0], x);\n+            for (int i = 1; i <= 3; i++)","path":"src/Microsoft.ML.CpuMath/SseIntrinsics.cs","position":36,"original_position":36,"commit_id":"f0f81a5019a3c8cbd795a970e40d633e9e1770c1","original_commit_id":"f0f81a5019a3c8cbd795a970e40d633e9e1770c1","user":{"login":"tannergooding","id":10487869,"node_id":"MDQ6VXNlcjEwNDg3ODY5","avatar_url":"https://avatars3.githubusercontent.com/u/10487869?v=4","gravatar_id":"","url":"https://api.github.com/users/tannergooding","html_url":"https://github.com/tannergooding","followers_url":"https://api.github.com/users/tannergooding/followers","following_url":"https://api.github.com/users/tannergooding/following{/other_user}","gists_url":"https://api.github.com/users/tannergooding/gists{/gist_id}","starred_url":"https://api.github.com/users/tannergooding/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tannergooding/subscriptions","organizations_url":"https://api.github.com/users/tannergooding/orgs","repos_url":"https://api.github.com/users/tannergooding/repos","events_url":"https://api.github.com/users/tannergooding/events{/privacy}","received_events_url":"https://api.github.com/users/tannergooding/received_events","type":"User","site_admin":false},"body":"Unrolling this would likely be more performant.","created_at":"2018-07-20T15:07:26Z","updated_at":"2018-07-20T15:07:26Z","html_url":"https://github.com/dotnet/machinelearning/pull/562#discussion_r204075785","pull_request_url":"https://api.github.com/repos/dotnet/machinelearning/pulls/562","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/dotnet/machinelearning/pulls/comments/204075785"},"html":{"href":"https://github.com/dotnet/machinelearning/pull/562#discussion_r204075785"},"pull_request":{"href":"https://api.github.com/repos/dotnet/machinelearning/pulls/562"}}},"pull_request":{"url":"https://api.github.com/repos/dotnet/machinelearning/pulls/562","id":202766623,"node_id":"MDExOlB1bGxSZXF1ZXN0MjAyNzY2NjIz","html_url":"https://github.com/dotnet/machinelearning/pull/562","diff_url":"https://github.com/dotnet/machinelearning/pull/562.diff","patch_url":"https://github.com/dotnet/machinelearning/pull/562.patch","issue_url":"https://api.github.com/repos/dotnet/machinelearning/issues/562","number":562,"state":"open","locked":false,"title":"Port C# hardware intrinsics APIs for SSE from SIMD native algorithms","user":{"login":"briancylui","id":18178086,"node_id":"MDQ6VXNlcjE4MTc4MDg2","avatar_url":"https://avatars1.githubusercontent.com/u/18178086?v=4","gravatar_id":"","url":"https://api.github.com/users/briancylui","html_url":"https://github.com/briancylui","followers_url":"https://api.github.com/users/briancylui/followers","following_url":"https://api.github.com/users/briancylui/following{/other_user}","gists_url":"https://api.github.com/users/briancylui/gists{/gist_id}","starred_url":"https://api.github.com/users/briancylui/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/briancylui/subscriptions","organizations_url":"https://api.github.com/users/briancylui/orgs","repos_url":"https://api.github.com/users/briancylui/repos","events_url":"https://api.github.com/users/briancylui/events{/privacy}","received_events_url":"https://api.github.com/users/briancylui/received_events","type":"User","site_admin":false},"body":"- with unit tests and performance tests for two target frameworks: .NET Core App 3.0 and .NET Standard 2.0.\r\n- .NET Core App 3.0 gets the new C# hardware intrinsics APIs, while .NET Standard 2.0 gets the original native SIMD algorithms.\r\n- Several things have made this multi-targeting feature possible.\r\n   1. The new CpuMathUtils class that contains the new APIs is implemented as a partial class with method definitions split into two separate files (src\\Microsoft.ML.CpuMath\\CpuMathUtils.[target].cs), only one of which is compiled based on the target framework.\r\n   2. The Microsoft.ML.CpuMath.csproj file makes the switching decision to compile the right files based on the target framework.\r\n\r\n### Structure:\r\n1. All new hardware intrinsics APIs are contained in src\\Microsoft.ML.CpuMath.\r\n2. Unit tests for the two target frameworks live in test\\Microsoft.ML.CpuMath.UnitTests.[target], and contain the same content except for the target framework in .csproj.\r\n3. Performance tests live in test\\Microsoft.ML.CpuMath.PerformanceTests.\r\n\r\n### Changes to users:\r\n1. Originally, users call intrinsics APIs via the SseUtils class in src\\Microsoft.ML.CpuMath\\Sse.cs, but now they call them via the new CpuMathUtils class, which will handle switching between SSE and AVX in the future.\r\n2. CpuMathUtils methods and SseUtils methods share the same signature, but CpuMathUtils methods additionally call a new helper class (SseIntrinsics) for C# implementations of SSE operations.","created_at":"2018-07-20T07:22:05Z","updated_at":"2018-07-20T15:07:26Z","closed_at":null,"merged_at":null,"merge_commit_sha":"ec0301b5059f07de0050592c3653ee225be2f89d","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/dotnet/machinelearning/pulls/562/commits","review_comments_url":"https://api.github.com/repos/dotnet/machinelearning/pulls/562/comments","review_comment_url":"https://api.github.com/repos/dotnet/machinelearning/pulls/comments{/number}","comments_url":"https://api.github.com/repos/dotnet/machinelearning/issues/562/comments","statuses_url":"https://api.github.com/repos/dotnet/machinelearning/statuses/f0f81a5019a3c8cbd795a970e40d633e9e1770c1","head":{"label":"briancylui:SseKey","ref":"SseKey","sha":"f0f81a5019a3c8cbd795a970e40d633e9e1770c1","user":{"login":"briancylui","id":18178086,"node_id":"MDQ6VXNlcjE4MTc4MDg2","avatar_url":"https://avatars1.githubusercontent.com/u/18178086?v=4","gravatar_id":"","url":"https://api.github.com/users/briancylui","html_url":"https://github.com/briancylui","followers_url":"https://api.github.com/users/briancylui/followers","following_url":"https://api.github.com/users/briancylui/following{/other_user}","gists_url":"https://api.github.com/users/briancylui/gists{/gist_id}","starred_url":"https://api.github.com/users/briancylui/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/briancylui/subscriptions","organizations_url":"https://api.github.com/users/briancylui/orgs","repos_url":"https://api.github.com/users/briancylui/repos","events_url":"https://api.github.com/users/briancylui/events{/privacy}","received_events_url":"https://api.github.com/users/briancylui/received_events","type":"User","site_admin":false},"repo":{"id":137632092,"node_id":"MDEwOlJlcG9zaXRvcnkxMzc2MzIwOTI=","name":"machinelearning","full_name":"briancylui/machinelearning","owner":{"login":"briancylui","id":18178086,"node_id":"MDQ6VXNlcjE4MTc4MDg2","avatar_url":"https://avatars1.githubusercontent.com/u/18178086?v=4","gravatar_id":"","url":"https://api.github.com/users/briancylui","html_url":"https://github.com/briancylui","followers_url":"https://api.github.com/users/briancylui/followers","following_url":"https://api.github.com/users/briancylui/following{/other_user}","gists_url":"https://api.github.com/users/briancylui/gists{/gist_id}","starred_url":"https://api.github.com/users/briancylui/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/briancylui/subscriptions","organizations_url":"https://api.github.com/users/briancylui/orgs","repos_url":"https://api.github.com/users/briancylui/repos","events_url":"https://api.github.com/users/briancylui/events{/privacy}","received_events_url":"https://api.github.com/users/briancylui/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/briancylui/machinelearning","description":"ML.NET is an open source and cross-platform machine learning framework for .NET.","fork":true,"url":"https://api.github.com/repos/briancylui/machinelearning","forks_url":"https://api.github.com/repos/briancylui/machinelearning/forks","keys_url":"https://api.github.com/repos/briancylui/machinelearning/keys{/key_id}","collaborators_url":"https://api.github.com/repos/briancylui/machinelearning/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/briancylui/machinelearning/teams","hooks_url":"https://api.github.com/repos/briancylui/machinelearning/hooks","issue_events_url":"https://api.github.com/repos/briancylui/machinelearning/issues/events{/number}","events_url":"https://api.github.com/repos/briancylui/machinelearning/events","assignees_url":"https://api.github.com/repos/briancylui/machinelearning/assignees{/user}","branches_url":"https://api.github.com/repos/briancylui/machinelearning/branches{/branch}","tags_url":"https://api.github.com/repos/briancylui/machinelearning/tags","blobs_url":"https://api.github.com/repos/briancylui/machinelearning/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/briancylui/machinelearning/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/briancylui/machinelearning/git/refs{/sha}","trees_url":"https://api.github.com/repos/briancylui/machinelearning/git/trees{/sha}","statuses_url":"https://api.github.com/repos/briancylui/machinelearning/statuses/{sha}","languages_url":"https://api.github.com/repos/briancylui/machinelearning/languages","stargazers_url":"https://api.github.com/repos/briancylui/machinelearning/stargazers","contributors_url":"https://api.github.com/repos/briancylui/machinelearning/contributors","subscribers_url":"https://api.github.com/repos/briancylui/machinelearning/subscribers","subscription_url":"https://api.github.com/repos/briancylui/machinelearning/subscription","commits_url":"https://api.github.com/repos/briancylui/machinelearning/commits{/sha}","git_commits_url":"https://api.github.com/repos/briancylui/machinelearning/git/commits{/sha}","comments_url":"https://api.github.com/repos/briancylui/machinelearning/comments{/number}","issue_comment_url":"https://api.github.com/repos/briancylui/machinelearning/issues/comments{/number}","contents_url":"https://api.github.com/repos/briancylui/machinelearning/contents/{+path}","compare_url":"https://api.github.com/repos/briancylui/machinelearning/compare/{base}...{head}","merges_url":"https://api.github.com/repos/briancylui/machinelearning/merges","archive_url":"https://api.github.com/repos/briancylui/machinelearning/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/briancylui/machinelearning/downloads","issues_url":"https://api.github.com/repos/briancylui/machinelearning/issues{/number}","pulls_url":"https://api.github.com/repos/briancylui/machinelearning/pulls{/number}","milestones_url":"https://api.github.com/repos/briancylui/machinelearning/milestones{/number}","notifications_url":"https://api.github.com/repos/briancylui/machinelearning/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/briancylui/machinelearning/labels{/name}","releases_url":"https://api.github.com/repos/briancylui/machinelearning/releases{/id}","deployments_url":"https://api.github.com/repos/briancylui/machinelearning/deployments","created_at":"2018-06-17T05:47:45Z","updated_at":"2018-07-20T03:27:37Z","pushed_at":"2018-07-20T03:27:36Z","git_url":"git://github.com/briancylui/machinelearning.git","ssh_url":"git@github.com:briancylui/machinelearning.git","clone_url":"https://github.com/briancylui/machinelearning.git","svn_url":"https://github.com/briancylui/machinelearning","homepage":"http://dot.net/ml","size":19966,"stargazers_count":0,"watchers_count":0,"language":"C#","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":1,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"base":{"label":"dotnet:master","ref":"master","sha":"8ce2a232e907d518979e7105842ae575a7427377","user":{"login":"dotnet","id":9141961,"node_id":"MDEyOk9yZ2FuaXphdGlvbjkxNDE5NjE=","avatar_url":"https://avatars0.githubusercontent.com/u/9141961?v=4","gravatar_id":"","url":"https://api.github.com/users/dotnet","html_url":"https://github.com/dotnet","followers_url":"https://api.github.com/users/dotnet/followers","following_url":"https://api.github.com/users/dotnet/following{/other_user}","gists_url":"https://api.github.com/users/dotnet/gists{/gist_id}","starred_url":"https://api.github.com/users/dotnet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dotnet/subscriptions","organizations_url":"https://api.github.com/users/dotnet/orgs","repos_url":"https://api.github.com/users/dotnet/repos","events_url":"https://api.github.com/users/dotnet/events{/privacy}","received_events_url":"https://api.github.com/users/dotnet/received_events","type":"Organization","site_admin":false},"repo":{"id":132021166,"node_id":"MDEwOlJlcG9zaXRvcnkxMzIwMjExNjY=","name":"machinelearning","full_name":"dotnet/machinelearning","owner":{"login":"dotnet","id":9141961,"node_id":"MDEyOk9yZ2FuaXphdGlvbjkxNDE5NjE=","avatar_url":"https://avatars0.githubusercontent.com/u/9141961?v=4","gravatar_id":"","url":"https://api.github.com/users/dotnet","html_url":"https://github.com/dotnet","followers_url":"https://api.github.com/users/dotnet/followers","following_url":"https://api.github.com/users/dotnet/following{/other_user}","gists_url":"https://api.github.com/users/dotnet/gists{/gist_id}","starred_url":"https://api.github.com/users/dotnet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dotnet/subscriptions","organizations_url":"https://api.github.com/users/dotnet/orgs","repos_url":"https://api.github.com/users/dotnet/repos","events_url":"https://api.github.com/users/dotnet/events{/privacy}","received_events_url":"https://api.github.com/users/dotnet/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/dotnet/machinelearning","description":"ML.NET is an open source and cross-platform machine learning framework for .NET.","fork":false,"url":"https://api.github.com/repos/dotnet/machinelearning","forks_url":"https://api.github.com/repos/dotnet/machinelearning/forks","keys_url":"https://api.github.com/repos/dotnet/machinelearning/keys{/key_id}","collaborators_url":"https://api.github.com/repos/dotnet/machinelearning/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/dotnet/machinelearning/teams","hooks_url":"https://api.github.com/repos/dotnet/machinelearning/hooks","issue_events_url":"https://api.github.com/repos/dotnet/machinelearning/issues/events{/number}","events_url":"https://api.github.com/repos/dotnet/machinelearning/events","assignees_url":"https://api.github.com/repos/dotnet/machinelearning/assignees{/user}","branches_url":"https://api.github.com/repos/dotnet/machinelearning/branches{/branch}","tags_url":"https://api.github.com/repos/dotnet/machinelearning/tags","blobs_url":"https://api.github.com/repos/dotnet/machinelearning/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/dotnet/machinelearning/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/dotnet/machinelearning/git/refs{/sha}","trees_url":"https://api.github.com/repos/dotnet/machinelearning/git/trees{/sha}","statuses_url":"https://api.github.com/repos/dotnet/machinelearning/statuses/{sha}","languages_url":"https://api.github.com/repos/dotnet/machinelearning/languages","stargazers_url":"https://api.github.com/repos/dotnet/machinelearning/stargazers","contributors_url":"https://api.github.com/repos/dotnet/machinelearning/contributors","subscribers_url":"https://api.github.com/repos/dotnet/machinelearning/subscribers","subscription_url":"https://api.github.com/repos/dotnet/machinelearning/subscription","commits_url":"https://api.github.com/repos/dotnet/machinelearning/commits{/sha}","git_commits_url":"https://api.github.com/repos/dotnet/machinelearning/git/commits{/sha}","comments_url":"https://api.github.com/repos/dotnet/machinelearning/comments{/number}","issue_comment_url":"https://api.github.com/repos/dotnet/machinelearning/issues/comments{/number}","contents_url":"https://api.github.com/repos/dotnet/machinelearning/contents/{+path}","compare_url":"https://api.github.com/repos/dotnet/machinelearning/compare/{base}...{head}","merges_url":"https://api.github.com/repos/dotnet/machinelearning/merges","archive_url":"https://api.github.com/repos/dotnet/machinelearning/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/dotnet/machinelearning/downloads","issues_url":"https://api.github.com/repos/dotnet/machinelearning/issues{/number}","pulls_url":"https://api.github.com/repos/dotnet/machinelearning/pulls{/number}","milestones_url":"https://api.github.com/repos/dotnet/machinelearning/milestones{/number}","notifications_url":"https://api.github.com/repos/dotnet/machinelearning/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/dotnet/machinelearning/labels{/name}","releases_url":"https://api.github.com/repos/dotnet/machinelearning/releases{/id}","deployments_url":"https://api.github.com/repos/dotnet/machinelearning/deployments","created_at":"2018-05-03T16:20:42Z","updated_at":"2018-07-20T12:48:42Z","pushed_at":"2018-07-20T07:22:05Z","git_url":"git://github.com/dotnet/machinelearning.git","ssh_url":"git@github.com:dotnet/machinelearning.git","clone_url":"https://github.com/dotnet/machinelearning.git","svn_url":"https://github.com/dotnet/machinelearning","homepage":"https://dot.net/ml","size":19930,"stargazers_count":3174,"watchers_count":3174,"language":"C#","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":433,"mirror_url":null,"archived":false,"open_issues_count":193,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":433,"open_issues":193,"watchers":3174,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/dotnet/machinelearning/pulls/562"},"html":{"href":"https://github.com/dotnet/machinelearning/pull/562"},"issue":{"href":"https://api.github.com/repos/dotnet/machinelearning/issues/562"},"comments":{"href":"https://api.github.com/repos/dotnet/machinelearning/issues/562/comments"},"review_comments":{"href":"https://api.github.com/repos/dotnet/machinelearning/pulls/562/comments"},"review_comment":{"href":"https://api.github.com/repos/dotnet/machinelearning/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/dotnet/machinelearning/pulls/562/commits"},"statuses":{"href":"https://api.github.com/repos/dotnet/machinelearning/statuses/f0f81a5019a3c8cbd795a970e40d633e9e1770c1"}},"author_association":"MEMBER"}}
{"actor":{"display_login":"tannergooding"}}