diff --git a/src/common/utils.h b/src/common/utils.h index f6d0aecbd207..aa0cb6b1b454 100644 --- a/src/common/utils.h +++ b/src/common/utils.h @@ -953,7 +953,7 @@ inline int GetDefaultDtype(int dtype) { inline bool AlignedMemAlloc(void** ptr, size_t size, size_t alignment) { #if _MSC_VER *ptr = _aligned_malloc(size, alignment); - if(*ptr == nullptr) + if (*ptr == nullptr) return false; #else int res = posix_memalign(ptr, alignment, size); diff --git a/src/storage/storage_manager_helpers.h b/src/storage/storage_manager_helpers.h index fdb32386a2dd..1fccb5a08f45 100644 --- a/src/storage/storage_manager_helpers.h +++ b/src/storage/storage_manager_helpers.h @@ -117,7 +117,7 @@ class ContextHelperCPU : public ContextHelper { void Free(void *dptr) const override { mxnet::common::AlignedMemFree(dptr); - } + } private: #if MXNET_USE_MKLDNN == 1 diff --git a/tests/cpp/storage/storage_test.cc b/tests/cpp/storage/storage_test.cc index 046eee5e9d26..497af35c83cd 100644 --- a/tests/cpp/storage/storage_test.cc +++ b/tests/cpp/storage/storage_test.cc @@ -59,7 +59,7 @@ TEST(Storage, CPU_MemAlign) { auto&& storage = mxnet::Storage::Get(); mxnet::Context context_cpu = mxnet::Context::CPU(0); - for(int i=0; i < 5; ++i) { + for (int i = 0; i < 5; ++i) { const size_t kSize = (std::rand() % 1024) + 1; auto&& handle = storage->Alloc(kSize, context_cpu); EXPECT_EQ(handle.ctx, context_cpu);