You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
What's the proper way to report the error back to the caller?
return an error code and leave it up to the caller?
call halide_error (knowing that the default handler will terminate the process)?
You must do both in runtime code, since you don't know if the caller has overridden halide_error() or not (it may be relying on it to abort, or it may be relying on it not to abort so that it can check the eventual error code)
t looks like we don't check the "validity" of the native buffer in the various wrap-native implementations:
Halide/src/runtime/vulkan.cpp
Lines 1337 to 1347 in 9864bd4
Halide/src/runtime/metal.cpp
Lines 1230 to 1247 in 9864bd4
Halide/src/runtime/cuda.cpp
Lines 1227 to 1246 in 9864bd4
Halide/src/runtime/opencl.cpp
Lines 1231 to 1257 in 9864bd4
In D3D12 there's a check (a rather overkill one):
Halide/src/runtime/d3d12compute.cpp
Lines 3476 to 3477 in 9864bd4
In fact, some of the interface comments even mention the call can fail if an invalid device pointer is passed:
Halide/src/runtime/HalideRuntimeCuda.h
Lines 40 to 47 in 9864bd4
Halide/src/runtime/HalideRuntimeMetal.h
Lines 41 to 48 in 9864bd4
Halide/src/runtime/HalideRuntimeOpenCL.h
Lines 82 to 89 in 9864bd4
(Vulkan does not expose the wrap/unwrap symbols in
HalideRuntimeVulkan.h
)The text was updated successfully, but these errors were encountered: