Skip to content

Commit

Permalink
fix cpu aligned_alloc size (#8569)
Browse files Browse the repository at this point in the history
Signed-off-by: daquexian <daquexian566@gmail.com>

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
  • Loading branch information
daquexian and mergify[bot] authored Jul 6, 2022
1 parent 51b9a1e commit 11e6278
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion oneflow/core/ep/cpu/cpu_device.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ Maybe<void> CpuDevice::Alloc(const AllocationOptions& options, void** ptr, size_
CHECK_OR_RETURN(device);
return device->AllocPinned(options, ptr, size);
} else {
*ptr = aligned_alloc(kMaxAlignmentRequirement, size);
*ptr = aligned_alloc(kMaxAlignmentRequirement, RoundUp(size, kMaxAlignmentRequirement));
if (*ptr == nullptr) {
return Error::RuntimeError() << "allocate failed";
} else {
Expand Down

0 comments on commit 11e6278

Please sign in to comment.