-
Couldn't load subscription status.
- Fork 217
Add Handwritten Bindings for CuFileRead and CuFileWrite #1182
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
Changes from all commits
836f6dd
90c2dfb
3a89bc4
580d3f5
a2f5635
34e9190
43bae32
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2281,40 +2281,6 @@ cpdef buf_deregister(intptr_t buf_ptr_base): | |
| check_status(__status__) | ||
|
|
||
|
|
||
| cpdef read(intptr_t fh, intptr_t buf_ptr_base, size_t size, off_t file_offset, off_t buf_ptr_offset): | ||
| """read data from a registered file handle to a specified device or host memory. | ||
|
|
||
| Args: | ||
| fh (intptr_t): ``CUfileHandle_t`` opaque file handle. | ||
| buf_ptr_base (intptr_t): base address of buffer in device or host memory. | ||
| size (size_t): size bytes to read. | ||
| file_offset (off_t): file-offset from begining of the file. | ||
| buf_ptr_offset (off_t): offset relative to the buf_ptr_base pointer to read into. | ||
|
|
||
| .. seealso:: `cuFileRead` | ||
| """ | ||
| with nogil: | ||
| __status__ = cuFileRead(<Handle>fh, <void*>buf_ptr_base, size, file_offset, buf_ptr_offset) | ||
| check_status(__status__) | ||
|
|
||
|
|
||
| cpdef write(intptr_t fh, intptr_t buf_ptr_base, size_t size, off_t file_offset, off_t buf_ptr_offset): | ||
| """write data from a specified device or host memory to a registered file handle. | ||
|
|
||
| Args: | ||
| fh (intptr_t): ``CUfileHandle_t`` opaque file handle. | ||
| buf_ptr_base (intptr_t): base address of buffer in device or host memory. | ||
| size (size_t): size bytes to write. | ||
| file_offset (off_t): file-offset from begining of the file. | ||
| buf_ptr_offset (off_t): offset relative to the buf_ptr_base pointer to write from. | ||
|
|
||
| .. seealso:: `cuFileWrite` | ||
| """ | ||
| with nogil: | ||
| __status__ = cuFileWrite(<Handle>fh, <const void*>buf_ptr_base, size, file_offset, buf_ptr_offset) | ||
| check_status(__status__) | ||
|
|
||
|
|
||
| cpdef driver_open(): | ||
| """Initialize the cuFile library and open the nvidia-fs driver. | ||
|
|
||
|
|
@@ -2689,3 +2655,44 @@ cpdef driver_close(): | |
| with nogil: | ||
| status = cuFileDriverClose_v2() | ||
| check_status(status) | ||
|
|
||
| cpdef read(intptr_t fh, intptr_t buf_ptr_base, size_t size, off_t file_offset, off_t buf_ptr_offset): | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Read should also have similar documentation as Write. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Sorry, I missed that this docstring was different when I approved the related cybind MR. We will also need to file another MR to update this over there. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Oh yes whoops added to this repo and corresponding cybind MR :) |
||
| """read data from a registered file handle to a specified device or host memory. | ||
|
|
||
| Args: | ||
| fh (intptr_t): ``CUfileHandle_t`` opaque file handle. | ||
| buf_ptr_base (intptr_t): base address of buffer in device or host memory. | ||
| size (size_t): size bytes to read. | ||
| file_offset (off_t): file-offset from begining of the file. | ||
| buf_ptr_offset (off_t): offset relative to the buf_ptr_base pointer to read into. | ||
|
|
||
| Returns: | ||
| ssize_t: number of bytes read on success. | ||
|
|
||
| .. seealso:: `cuFileRead` | ||
| """ | ||
| with nogil: | ||
| status = cuFileRead(<Handle>fh, <void*>buf_ptr_base, size, file_offset, buf_ptr_offset) | ||
| check_status(status) | ||
| return status | ||
|
|
||
|
|
||
| cpdef write(intptr_t fh, intptr_t buf_ptr_base, size_t size, off_t file_offset, off_t buf_ptr_offset): | ||
| """write data from a specified device or host memory to a registered file handle. | ||
|
|
||
| Args: | ||
| fh (intptr_t): ``CUfileHandle_t`` opaque file handle. | ||
| buf_ptr_base (intptr_t): base address of buffer in device or host memory. | ||
| size (size_t): size bytes to write. | ||
| file_offset (off_t): file-offset from begining of the file. | ||
| buf_ptr_offset (off_t): offset relative to the buf_ptr_base pointer to write from. | ||
|
|
||
| Returns: | ||
| ssize_t: number of bytes written on success. | ||
|
|
||
| .. seealso:: `cuFileWrite` | ||
| """ | ||
| with nogil: | ||
| status = cuFileWrite(<Handle>fh, <const void*>buf_ptr_base, size, file_offset, buf_ptr_offset) | ||
| check_status(status) | ||
| return status | ||
Uh oh!
There was an error while loading. Please reload this page.