If the given result is a NppStatus that indicates an error
and exceptions have been enabled, this method will throw a
CudaException with an error message that corresponds to the
given result code.
If the given result is null and exceptions are
enabled, then this method will throw a CudaException with
an error message stating that a memory allocation failed.