Skip to content

Commit fc856f0

Browse files
Dmytro Dzhulgakovfacebook-github-bot
Dmytro Dzhulgakov
authored andcommitted
Fix type and disable warning about cpu arch
Reviewed By: Yangqing Differential Revision: D6908986 fbshipit-source-id: 42bba410ea772999717353b749c411bd8484af6b
1 parent 28f42cc commit fc856f0

File tree

1 file changed

+12
-5
lines changed

1 file changed

+12
-5
lines changed

caffe2/core/init_intrinsics_check.cc

+12-5
Original file line numberDiff line numberDiff line change
@@ -51,19 +51,26 @@ static void WarnIfFeatureUnused(
5151
const bool cpu_has_feature, const string& feature) {
5252
VLOG(1) << "Caffe2 not built with " << feature << ".";
5353
if (cpu_has_feature) {
54+
#ifdef CAFFE2_NO_CROSS_ARCH_WARNING
55+
// When cross-compiling single binary for multiple archs - turns off the
56+
// annoying warning
57+
VLOG(1)
58+
#else
5459
LOG(ERROR)
55-
<< "CPU feature " << feature << " is present on your machine, "
56-
"but the Caffe2 binary is not compiled with it. It means you "
57-
"may not get the full speed of your CPU.";
60+
#endif
61+
<< "CPU feature " << feature
62+
<< " is present on your machine, "
63+
"but the Caffe2 binary is not compiled with it. It means you "
64+
"may not get the full speed of your CPU.";
5865
}
5966
}
6067

6168
bool Caffe2CheckIntrinsicsFeatures(int*, char***) {
6269

6370
#ifdef __AVX__
64-
QuitIfFeatureUnsupported(GetCpuId().avx2(), "avx");
71+
QuitIfFeatureUnsupported(GetCpuId().avx(), "avx");
6572
#else
66-
WarnIfFeatureUnused(GetCpuId().avx2(), "avx");
73+
WarnIfFeatureUnused(GetCpuId().avx(), "avx");
6774
#endif
6875

6976
#ifdef __AVX2__

0 commit comments

Comments
 (0)