When CUDA is not available at runtime, but cv-rs is built with the "cuda" feature enabled, then the program emits this message: OpenCV(3.4.1) Error: Gpu API call (no CUDA-capable device is detected) in allocate. Then an exception is thrown with that error which is not caught and blows up the stack. We need to catch exceptions for when CUDA is not available and either panic! on the Rust side, or give Result back via the API.
CResutlt has relevant method to catch it. We could just use it. Panic may be a bad thing since GPU may appear after (e.g. dynamic videocard switch on laptop).
When CUDA is not available at runtime, but
cv-rs
is built with the "cuda" feature enabled, then the program emits this message: OpenCV(3.4.1) Error: Gpu API call (no CUDA-capable device is detected) in allocate. Then an exception is thrown with that error which is not caught and blows up the stack. We need to catch exceptions for when CUDA is not available and eitherpanic!
on the Rust side, or giveResult
back via the API.