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

Initial changes to support cufile stream I/O. #259

Merged
merged 8 commits into from
Aug 22, 2023
Merged
Show file tree
Hide file tree
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
Next Next commit
Removed stream_handle object from this check-in.
Will be added as part of a separate check-in.
  • Loading branch information
tell-rebanta committed Aug 16, 2023
commit 9cca6ceb4cb083239daf535b564ae0c2ad6c0557
36 changes: 0 additions & 36 deletions cpp/examples/basic_io.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
#include <kvikio/driver.hpp>
#include <kvikio/error.hpp>
#include <kvikio/file_handle.hpp>
#include <kvikio/stream.hpp>

using namespace std;

Expand Down Expand Up @@ -200,41 +199,6 @@ int main()

cout << "stream : " << kvikio::is_stream_available() << endl;
if (kvikio::is_stream_available()) {
{
CUstream stream;
ssize_t bytes_done;
cout << "Performing stream I/O using stream handle" << endl;
off_t f_off = 0, d_off = 0;
check(cudaStreamCreate(&stream) == cudaSuccess);
kvikio::StreamHandle s_handle_wr(
"/data/test-file", stream, "w", kvikio::StreamHandle::m644, false);
check(cudaMemcpy(a_dev, a, SIZE, cudaMemcpyHostToDevice) == cudaSuccess);

/*
* For stream based I/Os, buffer registration is not mandatory. However,
* it gives a better performance.
*/

kvikio::buffer_register(a_dev, SIZE);
s_handle_wr.write_async(a_dev, &io_size, &f_off, &d_off, &bytes_done, stream);
check(cudaStreamSynchronize(stream) == cudaSuccess);
check(bytes_done == SIZE);
cout << "Stream Write : " << bytes_done << endl;
kvikio::buffer_deregister(a_dev);

/* Read */
bytes_done = 0;
CUstream stream_rd;
check(cudaStreamCreate(&stream_rd) == cudaSuccess);
kvikio::StreamHandle s_rd_handle(
"/data/test-file", stream_rd, "r", kvikio::StreamHandle::m644, false);
kvikio::buffer_register(c_dev, SIZE);
s_rd_handle.read_async(c_dev, &io_size, &f_off, &d_off, &bytes_done, stream_rd);
check(cudaStreamSynchronize(stream_rd) == cudaSuccess);
check(bytes_done == SIZE);
cout << "Stream Read : " << bytes_done << endl;
kvikio::buffer_deregister(c_dev);
}
{
cout << "Performing stream I/O using file handle" << endl;
off_t f_off = 0, d_off = 0;
Expand Down
147 changes: 0 additions & 147 deletions cpp/include/kvikio/stream.hpp
madsbk marked this conversation as resolved.
Outdated
Show resolved Hide resolved

This file was deleted.