Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion src/mpc-cuda/main.cu
Original file line number Diff line number Diff line change
Expand Up @@ -383,7 +383,14 @@ int main(int argc, char *argv[])

if (argc == 3) {
dim = atoi(argv[2]);
outsize = insize + 1 + (insize + 63) / 64;
// Worst-case output size the compressor can emit: a header word, one bitmap
// word per 64 inputs, and up to one residual word per thread. Each of the
// ceil(insize/TPB) chunks launches TPB threads, so the residual region can
// grow to chunks*TPB words. Small inputs still transpose full 64-word
// bit-planes from the padded tail, so sizing residuals by insize alone
// under-allocates and lets MPCcompress write past d_out.
const int chunks = (insize + TPB - 1) / TPB;
outsize = 1 + (insize + 63) / 64 + chunks * TPB;
} else {
assert(((input[0] >> 8) & 0xffffff) == 0x43504d);
dim = (input[0] & 31) + 1;
Expand Down
9 changes: 8 additions & 1 deletion src/mpc-hip/main.cu
Original file line number Diff line number Diff line change
Expand Up @@ -389,7 +389,14 @@ int main(int argc, char *argv[])

if (argc == 3) {
dim = atoi(argv[2]);
outsize = insize + 1 + (insize + 63) / 64;
// Worst-case output size the compressor can emit: a header word, one bitmap
// word per 64 inputs, and up to one residual word per thread. Each of the
// ceil(insize/TPB) chunks launches TPB threads, so the residual region can
// grow to chunks*TPB words. Small inputs still transpose full 64-word
// bit-planes from the padded tail, so sizing residuals by insize alone
// under-allocates and lets MPCcompress write past d_out.
const int chunks = (insize + TPB - 1) / TPB;
outsize = 1 + (insize + 63) / 64 + chunks * TPB;
} else {
assert(((input[0] >> 8) & 0xffffff) == 0x43504d);
dim = (input[0] & 31) + 1;
Expand Down
9 changes: 8 additions & 1 deletion src/mpc-sycl/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -423,7 +423,14 @@ int main(int argc, char *argv[])

if (argc == 3) {
dim = atoi(argv[2]);
outsize = insize + 1 + (insize + 63) / 64;
// Worst-case output size the compressor can emit: a header word, one bitmap
// word per 64 inputs, and up to one residual word per thread. Each of the
// ceil(insize/TPB) chunks launches TPB threads, so the residual region can
// grow to chunks*TPB words. Small inputs still transpose full 64-word
// bit-planes from the padded tail, so sizing residuals by insize alone
// under-allocates and lets MPCcompress write past d_out.
const int chunks = (insize + TPB - 1) / TPB;
outsize = 1 + (insize + 63) / 64 + chunks * TPB;
} else {
assert(((input[0] >> 8) & 0xffffff) == 0x43504d);
dim = (input[0] & 31) + 1;
Expand Down