onnxruntime
a8fda2fe - Fix d3d12_file_buffer_loader so it can build with no exception and clang (#33408)

Commit
30 days ago
Fix d3d12_file_buffer_loader so it can build with no exception and clang (#33408) This change fixes the loader to ensure that it can build with no_exception. ### Description This pull request refactors exception handling in the `D3D12FileBufferLoader` class to use the `ORT_TRY`, `ORT_CATCH`, and `ORT_HANDLE_EXCEPTION` macros for improved consistency and error reporting. It also introduces overloads for the `Create` and `Load` methods that provide default arguments for easier usage. Additionally, minor code cleanups and variable initializations are included. **Exception handling improvements:** * Replaced manual `try`/`catch` blocks with `ORT_TRY`, `ORT_CATCH`, and `ORT_HANDLE_EXCEPTION` macros in `LoadInternal`, `Create`, and `Load` methods to standardize error handling and improve diagnostics. [[1]](diffhunk://#diff-f37e2cabb2669401f283bffae8747139a71f1e260960151e591da38ea33557deL312-R323) [[2]](diffhunk://#diff-f37e2cabb2669401f283bffae8747139a71f1e260960151e591da38ea33557deR1115-R1179) **API usability enhancements:** * Added overloads for `Create` and `Load` methods in `D3D12FileBufferLoader` to allow usage with default configuration and cancellation token, simplifying client code. [[1]](diffhunk://#diff-8978fdd7a77e204adbc45d1e28e98c529bfc09604ab29d65e50690c11306236aR58-R64) [[2]](diffhunk://#diff-8978fdd7a77e204adbc45d1e28e98c529bfc09604ab29d65e50690c11306236aR75-R81) [[3]](diffhunk://#diff-f37e2cabb2669401f283bffae8747139a71f1e260960151e591da38ea33557deR1115-R1179) **Code cleanup and initialization:** * Moved the declaration of `BufferCollection loaded_batch` to ensure proper initialization order and removed redundant declarations. [[1]](diffhunk://#diff-f37e2cabb2669401f283bffae8747139a71f1e260960151e591da38ea33557deR334) [[2]](diffhunk://#diff-f37e2cabb2669401f283bffae8747139a71f1e260960151e591da38ea33557deL355) * Simplified future handling in `LoadInternal` by replacing `get` with `wait`, as the result is not used.
Author
Parents
Loading