@@ -289,7 +289,7 @@ Return Value:
289
289
__cpuid (1 , Cpuid1[0 ], Cpuid1[1 ], Cpuid1[2 ], Cpuid1[3 ]);
290
290
#endif
291
291
292
- #if defined(_MSC_VER)
292
+ #if defined(_MSC_VER) && !defined(ORT_DISABLE_SSE4)
293
293
294
294
//
295
295
// Check if the processor supports SSE 4.1 instructions.
@@ -315,6 +315,7 @@ Return Value:
315
315
316
316
if ((xcr0 & 0x6 ) == 0x6 ) {
317
317
318
+ #if !defined(ORT_DISABLE_AVX)
318
319
this ->GemmFloatKernel = MlasGemmFloatKernelAvx;
319
320
320
321
#if defined(MLAS_TARGET_AMD64)
@@ -347,6 +348,7 @@ Return Value:
347
348
__cpuid_count (7 , 0 , Cpuid7[0 ], Cpuid7[1 ], Cpuid7[2 ], Cpuid7[3 ]);
348
349
#endif
349
350
351
+ #if !defined(ORT_DISABLE_AVX2)
350
352
if (((Cpuid1[2 ] & 0x1000 ) != 0 ) && ((Cpuid7[1 ] & 0x20 ) != 0 )) {
351
353
352
354
this ->GemmU8S8Dispatch = &MlasGemmU8S8DispatchAvx2;
@@ -403,6 +405,7 @@ Return Value:
403
405
404
406
#if !defined(ORT_MINIMAL_BUILD)
405
407
408
+ #if !defined(ORT_DISABLE_AVX512)
406
409
//
407
410
// Check if the processor supports AVX512F features and the
408
411
// operating system supports saving AVX512F state.
@@ -453,8 +456,9 @@ Return Value:
453
456
}
454
457
}
455
458
}
459
+ #endif // !defined(ORT_DISABLE_AVX512)
456
460
457
- #ifndef __APPLE__
461
+ #if !defined( __APPLE__) && !defined(ORT_DISABLE_AMX)
458
462
//
459
463
// Check if the processor supports AMX-TILE and AMX-INT8
460
464
// features.
@@ -467,13 +471,16 @@ Return Value:
467
471
this ->GemmU8S8Dispatch = &MlasGemmU8S8DispatchAmx;
468
472
}
469
473
}
470
- #endif // __APPLE__
474
+ #endif // !defined( __APPLE__) && !defined(ORT_DISABLE_AMX)
471
475
472
476
#endif // ORT_MINIMAL_BUILD
473
477
474
478
}
479
+ #endif // !defined(ORT_DISABLE_AVX2)
475
480
476
481
#endif // MLAS_TARGET_AMD64
482
+ #endif // !defined(ORT_DISABLE_AVX)
483
+
477
484
478
485
}
479
486
}
0 commit comments