lambdaworks
lambdaworks copied to clipboard
Fix Metal operations panicking/failing when issuing too big inputs
There are some problems with CUDA and possibly Metal operations panicking or failing with inputs which order are close to 32.
For example, as noticed by @Juan-M-V and @daphneherlambda, CUDA's gen_twiddles() panics with a attempt to shift left with overflow when calling withorder >= 32.
If order == 31, the program stops with a DriverError(CUDA_ERROR_ILLEGAL_ADDRESS, "an illegal memory access was encountered".
Metal may have similar issues because of it analogous implementation. These errors should be handled in Rust and make sure that variables in the kernels don't overflow with too big inputs. These big orders imply inputs of hundreds of gigabytes of data so they probably won't be used in practice, but still the user should be able to handle these cases with errors.
Our cuda implementation is being removed