-
Notifications
You must be signed in to change notification settings - Fork 4k
GH-34971: [Format] Add non-CPU version of C Data Interface #34972
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
Merged
Merged
Changes from all commits
Commits
Show all changes
23 commits
Select commit
Hold shift + click to select a range
3f9519d
GH-34971: [Format] Enhance C-Data API to support non-cpu cases
zeroshade 63a65dc
clang-format
zeroshade fc16391
updates from feedback
zeroshade 26c9aa9
format/trim
zeroshade e85d307
newline at end of file
zeroshade 13e94a5
update based on feedback.
zeroshade 826390e
updates from feedback
zeroshade 09e5ee6
lint
zeroshade 564ce58
Update cpp/src/arrow/c/abi.h
zeroshade e74c286
add event type examples
zeroshade 1eb7ee9
add spec writeup and feedback
zeroshade 05f70f7
Update docs/source/format/CDeviceDataInterface.rst
zeroshade 43ce6c9
Update docs/source/format/CDeviceDataInterface.rst
zeroshade 2c9a7a6
updates from feedback
zeroshade 4f636a8
Update docs/source/format/CDeviceDataInterface.rst
zeroshade 4e1d1f6
Update cpp/src/arrow/c/abi.h
zeroshade 2b24a10
Update cpp/src/arrow/c/abi.h
zeroshade 451d3a3
Update cpp/src/arrow/c/abi.h
zeroshade e34746f
addressing review feedback
zeroshade b359239
Apply suggestions from code review
zeroshade 4845e19
linting
zeroshade fa8aab0
applying review feedback
zeroshade e068bc3
Update cpp/src/arrow/c/abi.h
zeroshade File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.
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.
Would you please help me understand the
void* sync_eventpointer a bit better in the context of CUDA/C++? Is this a function pointer that is expected to be called with acudaStream_tparameter provided by the application? Would there be a benefit from storing acudaStream_tinArrowDeviceArray(in thereservedbytes or elsewhere)?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.
In the case of CUDA, this would be a pointer to a
cudaEvent_t. It would be the producer's responsibility to create the event and callcudaEventRecordto ensure the relevant work in the stream(s) are captured in the event. The consumer can then callcudaStreamWaitEventwhich is typically a device-side more efficient stream synchronization mechanism thancudaStreamSynchronize(if they need to wait for host code they can still usecudaEventSynchronizeinstead).If both sides are on the same stream, then the
cudaStreamWaitEventcall should have negligible overhead.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.
Currently, in the context of CUDA/C++ the
void* sync_eventwould be expected to be acudaEvent_t*that the producer created and will trigger based on when the data is available.A consumer would then do something like:
As per the previous discussions, most frameworks for cuda don't actually make their internal streams easily externally available so we aren't expecting a
cudaStream_tto get passed. In the future if usage deems it necessary, we could absolutely leverage the reserved bytes to add a stream/queue pointer or something. But the initial pass here is intended to pass an event via thevoid* sync_eventthat a queue can wait on from the producer and then just operate on the data from there.