Skip to content
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

Docs cleanup #480

Merged
merged 6 commits into from
Oct 3, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Minor tweaks
  • Loading branch information
wence- authored Oct 3, 2024
commit b4dd67a35ac27d9d1206347811b898b9c7876971
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ The C++ library is header-only making it easy to include in [existing projects](
* A Python [Zarr](https://zarr.readthedocs.io/en/stable/) backend for reading and writing GPU data to file seamlessly.
* Concurrent reads and writes using an internal thread pool.
* Non-blocking API.
* Read/write to both host and device memory seamlessly.
* Transparently handles reads and writes to/from memory on both host and device.
* Provides Python bindings to [nvCOMP](https://github.com/NVIDIA/nvcomp).


Expand Down Expand Up @@ -43,6 +43,7 @@ def main(path):
# Read whole array from file
f.read(b)
assert all(a == b)
f.close()

# Use contexmanager
c = cupy.empty_like(a)
Expand All @@ -55,6 +56,8 @@ def main(path):
with kvikio.CuFile(path, "r") as f:
future1 = f.pread(d[:50])
future2 = f.pread(d[50:], file_offset=d[:50].nbytes)
# Note: must wait for futures before exiting block
# at which point the file is closed.
future1.get() # Wait for first read
future2.get() # Wait for second read
assert all(a == d)
Expand Down Expand Up @@ -93,6 +96,7 @@ int main()
// Read file into `b` in parallel using 16 threads
kvikio::default_thread_pool::reset(16);
{
// FileHandles have RAII semantics
kvikio::FileHandle f("test-file", "r");
future<size_t> future = f.pread(b_dev, sizeof(a), 0); // Non-blocking
size_t read = future.get(); // Blocking
Expand Down