Skip to content
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

_halide_buffer_crop() needs to check for runtime failures (v2) #6403

Merged
merged 2 commits into from
Nov 11, 2021

Commits on Nov 9, 2021

  1. _halide_buffer_crop() needs to check for runtime failures (v2)

    (Alternate to #6402)
    
    We currently assume that _halide_buffer_crop() will never fail. This is a bad assumption, as it can call device_crop(), which can fail due to unexpected runtime errors, or from a backend simply leaving the device_crop field at the default (unimplemented) case (as is currently the case for the OGLC backend).
    
    When this happens, the dst buffer was left in an inconsistent, invalid state (which was what led to the crashes fixed by #6401).
    
    This change modifies _halide_buffer_crop() to return nullptr in the event of an error, and ensure that all cropped buffers are checked for null at the right point. (This is not optimal, of course, since the specific error returned by device_crop is getting dropped on the floor, but the existence of an error is no longer ignored.)
    
    This addresses at least some of the failure issues we are seeing in performance_async_gpu with the OpenGLCompute backend.
    
    (Also: drive-by whitespace fix in CodegenC)
    steven-johnson committed Nov 9, 2021
    Configuration menu
    Copy the full SHA
    21e65ef View commit details
    Browse the repository at this point in the history
  2. Oops

    steven-johnson committed Nov 9, 2021
    Configuration menu
    Copy the full SHA
    92ba5f2 View commit details
    Browse the repository at this point in the history