Skip to content

fix int overflow while compiling CLASS D,E#18

Open
yuxuan-z19 wants to merge 1 commit intoGMAP:masterfrom
yuxuan-z19:zyx-fix-class
Open

fix int overflow while compiling CLASS D,E#18
yuxuan-z19 wants to merge 1 commit intoGMAP:masterfrom
yuxuan-z19:zyx-fix-class

Conversation

@yuxuan-z19
Copy link
Copy Markdown

Large problem sizes in CLASS D/E can cause integer overflow in memory indexing and array size computations, leading to compiler warnings and potential runtime errors.

This PR fixes #17 by updating setparams.cpp to use 64-bit integer literals (LL/ULL) for all relevant integer constants. This ensures that:

  • Integer arithmetic in array size and memory allocation calculations does not overflow.
  • Compiler warnings about integer overflow and sign change are resolved.
  • Calculations are safe for large problem sizes on modern GPUs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Integer overflow in memory indexing for CLASS D/E leads to segmentation fault

1 participant