acts-project / vecmem

Vectorised data model base and helper classes.
https://acts-project.github.io/vecmem/
Mozilla Public License 2.0
19 stars 13 forks source link

Mark copy events as `nodiscard` #286

Closed stephenswat closed 1 month ago

stephenswat commented 4 months ago

Currently, there is no compile-time mechanism to ensure that copy objects are properly handled, i.e. either waited for or ignored. This commit adds the nodiscard attribute to methods of the copy objects which return events to ensure that the compiler will issue a warning if the object is ignored.

stephenswat commented 4 months ago

Hmm, not necessarily. I modified traccc using this PR and it only came to 20 files changed, 86 insertions(+), 69 deletions(-). So not that painful, really.

stephenswat commented 4 months ago

Since forgetting to add these calls is "only" a performance penalty in the current setup, I introduced VECMEM_FAIL_ON_ASYNC_ERRORS in https://github.com/acts-project/vecmem/pull/270.

Unfortunately, they can also be runtime errors in SYCL code if you use unordered streams.

krasznaa commented 2 months ago

Unfortunately there are some HIP issues after all. 😦 (Some missing return value handling was left in.)

stephenswat commented 1 month ago

Updated to pass the CI. @krasznaa