···11+diff --git a/caffe2/perfkernels/cvtsh_ss_bugfix.h b/caffe2/perfkernels/cvtsh_ss_bugfix.h
22+index bd06681..00172b7 100644
33+--- a/caffe2/perfkernels/cvtsh_ss_bugfix.h
44++++ b/caffe2/perfkernels/cvtsh_ss_bugfix.h
55+@@ -1,10 +1,36 @@
66++/**
77++ * Copyright (c) 2016-present, Facebook, Inc.
88++ *
99++ * Licensed under the Apache License, Version 2.0 (the "License");
1010++ * you may not use this file except in compliance with the License.
1111++ * You may obtain a copy of the License at
1212++ *
1313++ * http://www.apache.org/licenses/LICENSE-2.0
1414++ *
1515++ * Unless required by applicable law or agreed to in writing, software
1616++ * distributed under the License is distributed on an "AS IS" BASIS,
1717++ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1818++ * See the License for the specific language governing permissions and
1919++ * limitations under the License.
2020++ */
2121++
2222+ #pragma once
2323+2424+-#if defined(__APPLE__) && (__clang_major__ < 8)
2525++// Apple clang was fixed in 8.1
2626++#if defined(__apple_build_version__) && ((__clang_major__ < 8) || ((__clang_major__ == 8) && (__clang_minor__ < 1)))
2727++#define __APPLE_NEED_FIX 1
2828++#endif
2929++
3030++// Regular clang was fixed in 3.9
3131++#if defined(__clang__) && (__clang_major__ < 4) && (__clang_minor__ < 9)
3232++#define __CLANG_NEED_FIX 1
3333++#endif
3434++
3535++#if __APPLE_NEED_FIX || __CLANG_NEED_FIX
3636+3737+ #include <emmintrin.h>
3838+3939+-// This version of apple clang has a bug that _cvtsh_ss is not defined, see
4040++// This version of clang has a bug that _cvtsh_ss is not defined, see
4141+ // https://reviews.llvm.org/D16177
4242+ static __inline float
4343+ __attribute__((__always_inline__, __nodebug__, __target__("f16c")))
4444+@@ -15,7 +41,10 @@ _cvtsh_ss(unsigned short a)
4545+ return r[0];
4646+ }
4747+4848+-#endif // defined(__APPLE__) && (__clang_major__ < 8)
4949++#endif // __APPLE_NEED_FIX || __CLANG_NEED_FIX
5050++
5151++#undef __APPLE_NEED_FIX
5252++#undef __CLANG_NEED_FIX
5353+5454+ #ifdef _MSC_VER
5555+