iree icon indicating copy to clipboard operation
iree copied to clipboard

Change fromDLPackCapsule params memory access to ALL

Open monorimet opened this issue 1 year ago • 2 comments

monorimet avatar May 20 '24 22:05 monorimet

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

google-cla[bot] avatar May 20 '24 22:05 google-cla[bot]

ahh think I found it: https://github.com/iree-org/iree/blob/9fe159d99d86f3292ae901427a159fb61898fa2c/runtime/src/iree/hal/allocator_heap.c#L269-L273

that's not quite right as here it takes the ALL which includes DISCARD and uses that to map... which then discards the existing contents as it was told to :P

I believe that should mask with allowed_access & (IREE_HAL_MEMORY_ACCESS_READ | IREE_HAL_MEMORY_ACCESS_WRITE). If you try that the change you made here should then work. I think this was only working previously because passing ANY just ignores validation and the DISCARD bit isn't set there so existing contents were not discarded.

benvanik avatar May 23 '24 00:05 benvanik

Do we still want this PR, or can we close it and delete the branch?

ScottTodd avatar Jan 21 '25 18:01 ScottTodd

Ended up landing in #20092.

benvanik avatar Mar 21 '25 16:03 benvanik