-
Notifications
You must be signed in to change notification settings - Fork 98
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: verify NTT size is a power of two #374
Conversation
4767111
to
0c083c0
Compare
icicle/appUtils/ntt/ntt.cu
Outdated
<< "NTT size is too large for the domain. Consider generating your domain with a higher order root of unity" | ||
<< '\n'; | ||
throw -1; | ||
std::cerr << "[ERROR] NTT size=" << size |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use THROW_ICICLE_ERR(
IcicleError_t::InvalidArgument, "error message
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was not sure since we don't catch it and there is no real reason to crash user app.
Do you think it's better to throw exceptions for wrong user input?
|
||
int logn = int(log2(size)); | ||
const bool is_size_power_of_two = size == (1 << logn); | ||
if (!is_size_power_of_two) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same here
afaa5a9
to
d37869e
Compare
d37869e
to
03e9057
Compare
No description provided.