-
Notifications
You must be signed in to change notification settings - Fork 124
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
[CUDA] Add support for multiple active mappings #1220
Conversation
Codecov ReportAttention:
❗ Your organization needs to install the Codecov GitHub app to enable full functionality. Additional details and impacted files@@ Coverage Diff @@
## main #1220 +/- ##
==========================================
- Coverage 15.46% 15.46% -0.01%
==========================================
Files 238 238
Lines 33883 33883
Branches 3747 3747
==========================================
- Hits 5240 5239 -1
Misses 28593 28593
- Partials 50 51 +1 ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As a general comment, a wee explanation of what the PR does wouldn't go amiss.
@oneapi-src/unified-runtime-maintain would be great if someone could review these changes |
43325e6
to
834e643
Compare
Issue was introduced in oneapi-src#1220 where a new allocation is created in a `std::unique_ptr` to enable buffer mapping. The `.get()` member function is called before the `std::unique_ptr` is passed into the `BufferMem` constructor. However, move semantics were not being explicitly followed. The `BufferMem` constructor was taking the `std::unique_ptr` by l-value refernece, then calling `std::move()` on it. This triggered a wrapper-escape, use-after-free defect in Coverity. This fix is to explicitly `std::move()` the `std::unique_ptr` into the `BufferMem` constructor, and also update the `BufferMem` constructor to take an r-value reference instead of an l-value reference.
This patch adds support for mapping the same buffer multiple times with urEnqueueMemBufferMap. This is mostly a straight port of oneapi-src#1220.
This patch adds support for mapping the same buffer multiple times with urEnqueueMemBufferMap. This is mostly a straight port of oneapi-src#1220. It brings the HIP adapter's functionality in line with that of the CUDA adapter.
This patch adds support for mapping the same buffer multiple times with urEnqueueMemBufferMap. This is mostly a straight port of oneapi-src#1220. It brings the HIP adapter's functionality in line with that of the CUDA adapter.
The CUDA adapter currently does not support multiple active mappings on the same buffer when using urEnqueueMemBufferMap. This change aims to add support for that feature.
However, the unsupported scenario of overlapping maps that were both created with the
UR_MAP_FLAG_WRITE
is not currently being checked. That's better done using validation layers for which I have created an issue: #1221intel/llvm: intel/llvm#12285