Skip to content

Commit

Permalink
doc
Browse files Browse the repository at this point in the history
  • Loading branch information
madsbk committed Sep 6, 2023
1 parent 0bb1669 commit 6a6341f
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions cpp/include/kvikio/stream.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,18 @@ namespace kvikio {
* `FileHandle.read_async` and `FileHandle.write_async` returns an instance of this class. Use
* `.check_bytes_done()` to synchronize the associated CUDA stream and return the number of bytes
* read or written by the operation.
*
* The goal of this class is twofold:
* - Have `read_async` and `write_async` return an object that clearly associates the function
* arguments with the CUDA stream used. This is useful because the current validity of the
* arguments depends on the stream.
* - Support of by-value arguments. In many cases, a user will use `read_async` and `write_async`
* like most other asynchronous CUDA functions that take by-value arguments.
*
* To support by-value arguments, we allocate the arguments on the heap (malloc `ArgByVal`) and have
* the by-reference arguments (`ArgByRef`) points into `ArgByVal`. This way, the `read_async` and
* `write_async` can call `.get_args()` to get the by-reference arguments required by cuFile's
* stream API.
*/
class StreamFuture {
public:
Expand Down

0 comments on commit 6a6341f

Please sign in to comment.