Skip to content

Commit 39901f2

Browse files
pytorchbotCaoE
andauthored
Fix lower precision check for MKLDNN on Windows (#122645)
Fixes #120788 Pull Request resolved: #121618 Approved by: https://github.com/xuhancn, https://github.com/jgong5, https://github.com/mingfeima, https://github.com/seemethere (cherry picked from commit 0371743) Co-authored-by: CaoE <e.cao@intel.com>
1 parent 9e6f42d commit 39901f2

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

aten/src/ATen/native/mkldnn/Utils.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ constexpr bool mkldnn_bf16_device_check_arm() {
9797

9898
#if AT_MKLDNN_ENABLED()
9999
inline bool mkldnn_bf16_device_check() {
100-
#if defined(__x86_64__)
100+
#if defined(__x86_64__) || (defined(_M_X64) && !defined(_M_ARM64EC))
101101
// Use ideep to check bf16 on X64 as cpuinfo has no avx_ne_convert check.
102102
return ideep::has_bf16_type_support();
103103
#else
@@ -106,7 +106,7 @@ inline bool mkldnn_bf16_device_check() {
106106
}
107107

108108
inline bool mkldnn_fp16_device_check() {
109-
#if defined(__x86_64__)
109+
#if defined(__x86_64__) || (defined(_M_X64) && !defined(_M_ARM64EC))
110110
return ideep::has_fp16_type_support();
111111
#else
112112
return false;

0 commit comments

Comments
 (0)