diff --git a/onnxruntime/core/mlas/lib/mlasi.h b/onnxruntime/core/mlas/lib/mlasi.h index ea620877ed..7155a9dd27 100644 --- a/onnxruntime/core/mlas/lib/mlasi.h +++ b/onnxruntime/core/mlas/lib/mlasi.h @@ -782,7 +782,7 @@ extern "C" { // value. // -#define MLAS_DEFAULT_PREFERRED_BUFFER_ALIGNMENT 32 +#define MLAS_DEFAULT_PREFERRED_BUFFER_ALIGNMENT 64 // // Define the target number of per-thread multiplies before using another diff --git a/onnxruntime/core/providers/dml/DmlExecutionProvider/src/BucketizedBufferAllocator.cpp b/onnxruntime/core/providers/dml/DmlExecutionProvider/src/BucketizedBufferAllocator.cpp index f5abeb5d7b..aae73dca46 100644 --- a/onnxruntime/core/providers/dml/DmlExecutionProvider/src/BucketizedBufferAllocator.cpp +++ b/onnxruntime/core/providers/dml/DmlExecutionProvider/src/BucketizedBufferAllocator.cpp @@ -244,17 +244,12 @@ namespace Dml void* CPUAllocator::Alloc(size_t size) { - if (size <= 0) - { - return nullptr; - } - void* p = malloc(size); - return p; + return onnxruntime::AllocatorDefaultAlloc(size); } void CPUAllocator::Free(void* p) { - free(p); + return onnxruntime::AllocatorDefaultFree(p); } } // namespace Dml