unified-runtime icon indicating copy to clipboard operation
unified-runtime copied to clipboard

[Cuda] Reintroduce catching and reporting of bad_alloc for event object creation

Open GeorgeWeb opened this issue 1 year ago • 2 comments

Reintroduces the changes from commit https://github.com/oneapi-src/unified-runtime/commit/c4ae460f779021aa6840ea47a373f6ac336bc589, which were reverted in related merged commit https://github.com/oneapi-src/unified-runtime/commit/1b4a8b852c6b86545b42a71927f88c4fed107217 due to being mistakenly deleted and omitted on rebasing.

This happened because the former changes got split out from PR https://github.com/oneapi-src/unified-runtime/pull/1399 to independent changes in PR https://github.com/oneapi-src/unified-runtime/pull/1397.

GeorgeWeb avatar Aug 12 '24 12:08 GeorgeWeb

Just FYI, handling this exception here is fine but not necessary. We already catch all exceptions in ur_libapi.cpp, e.g. : https://github.com/oneapi-src/unified-runtime/blob/main/source/loader/ur_libapi.cpp#L4831 and that includes handling bad_alloc: https://github.com/oneapi-src/unified-runtime/blob/main/source/common/ur_util.hpp#L280

igchor avatar Aug 12 '24 16:08 igchor

We already catch all exceptions in ur_libapi.cpp

That is great, thanks a bunch for pointing it out! I admit I didn't know the loader already did that. I am keeping it in mind for future code because this certainly bloates the adapter source unnecessary if appropriate exception handling already exists in the libapi caller.

GeorgeWeb avatar Aug 13 '24 09:08 GeorgeWeb

@GeorgeWeb Could you please create an intel/llvm PR for this? Thanks!

omarahmed1111 avatar Aug 22 '24 13:08 omarahmed1111

@GeorgeWeb Could you please create an intel/llvm PR for this? Thanks!

@omarahmed1111 I can certainly add one. As a historical info, this has previously already been tested in a DPC++ PR and has made it in main alongside that PR. However, this UR change was mistakenly removed/deleted due to a rebase on another PR deleting it that was merged later on. Anyways, I can totally add a intel/llvm PR to ensure it still passes the pre-commit CI.

GeorgeWeb avatar Aug 22 '24 14:08 GeorgeWeb

@GeorgeWeb Could you please create an intel/llvm PR for this? Thanks!

@omarahmed1111 I can certainly add one. As a historical info, this has previously already been tested in a DPC++ PR and has made it in main alongside that PR. However, this UR change was mistakenly removed/deleted due to a rebase on another PR deleting it that was merged later on. Anyways, I can totally add a intel/llvm PR to ensure it still passes the pre-commit CI.

Thanks for updating me! an Intel/llvm PR will be needed not only for testing purpose but to bump UR to the commit of merging this PR.

omarahmed1111 avatar Aug 22 '24 15:08 omarahmed1111