[iOS][GPU] Fix the clamp shader function for x86_64 (#63062)
authorTao Xu <taox@fb.com>
Thu, 12 Aug 2021 20:18:42 +0000 (13:18 -0700)
committerFacebook GitHub Bot <facebook-github-bot@users.noreply.github.com>
Thu, 12 Aug 2021 20:20:27 +0000 (13:20 -0700)
commitba25527ffc82158c439c2de73a80aa216f5bd4b5
treea24713a46cf027797122214ab9c4261036850046
parented7ece389daa980a03a2f09848a6439a90af9782
[iOS][GPU] Fix the clamp shader function for x86_64 (#63062)

Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/63062

Pervasively, due to the need of supporting 10.0, we used a fp16 version of the clamp kernel on Metal, which didn't work well on x86_64. Since we don't need to support 10.0 anymore, we can use the fp32 version, which works both on arm64 and x86_64.
ghstack-source-id: 135536785

Test Plan:
- `buck test pp-macos`
- Op tests in the playground app

{F641013793}

Reviewed By: husthyc

Differential Revision: D30239931

fbshipit-source-id: 6ad1bf71422b537e052fbd7b7465ba8deb7ca0cf
aten/src/ATen/native/metal/MetalShaders.h
aten/src/ATen/native/metal/mpscnn/MPSCNNClampOp.mm
aten/src/ATen/native/metal/mpscnn/tests/MPSCNNTests.h
aten/src/ATen/native/metal/mpscnn/tests/MPSCNNTests.mm
aten/src/ATen/native/metal/mpscnn/tests/MetalOpTestRunner.mm