Skip to content

Commit 3f73c0a

Browse files
committed
fix the build issue on windows
1 parent 3a72a63 commit 3f73c0a

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

paddle/fluid/memory/allocation/cpu_allocator.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,11 @@
1515
#pragma once
1616
#include "paddle/fluid/memory/allocation/allocator.h"
1717

18+
#ifdef _WIN32
19+
#define posix_memalign_free _aligned_free
20+
#define posix_memalign(p, a, s) (((*(p)) = _aligned_malloc((s), (a))), *(p) ? 0 : errno)
21+
#endif
22+
1823
namespace paddle {
1924
namespace memory {
2025
namespace allocation {

0 commit comments

Comments
 (0)