Skip to content

Commit 5ff953e

Browse files
Allow default alignment less then 16.
1 parent 2ea4ee9 commit 5ff953e

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/enqueue.cc

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1302,8 +1302,9 @@ static ncclResult_t uploadWork(struct ncclComm* comm, struct ncclKernelPlan* pla
13021302
plan->kernelArgs->workBuf = comm->workFifoBufDev;
13031303
break;
13041304
case ncclDevWorkStorageTypePersistent:
1305-
static_assert(16 <= alignof(max_align_t), "We rely on 16-byte alignment.");
1306-
fifoBufHost = malloc(workBytes);
1305+
const int alignment = 16;
1306+
size_t workBytesAlignedUp = ((workBytes + alignment - 1) / alignment) * alignment;
1307+
fifoBufHost = aligned_alloc(16, workBytesAlignedUp);
13071308
fifoCursor = 0;
13081309
fifoMask = ~0u;
13091310
break;

0 commit comments

Comments
 (0)