Skip to content

Commit b02ab00

Browse files
Rename var
1 parent 8105aed commit b02ab00

File tree

2 files changed

+15
-10
lines changed

2 files changed

+15
-10
lines changed

cpp/include/kvikio/file_handle.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ class FileHandle {
5050
bool _initialized{false};
5151
CompatMode _compat_mode{CompatMode::AUTO};
5252
mutable std::size_t _nbytes{0}; // The size of the underlying file, zero means unknown.
53-
CUFileHandleWrapper _handle{};
53+
CUFileHandleWrapper _cufile_handle{};
5454

5555
/**
5656
* @brief Given a requested compatibility mode, whether it is expected to reduce to `ON` for

cpp/src/file_handle.cpp

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ FileHandle::FileHandle(FileHandle&& o) noexcept
7777
_initialized{std::exchange(o._initialized, false)},
7878
_compat_mode{std::exchange(o._compat_mode, CompatMode::AUTO)},
7979
_nbytes{std::exchange(o._nbytes, 0)},
80-
_handle{std::exchange(o._handle, {})}
80+
_cufile_handle{std::exchange(o._cufile_handle, {})}
8181
{
8282
}
8383

@@ -88,7 +88,7 @@ FileHandle& FileHandle::operator=(FileHandle&& o) noexcept
8888
_initialized = std::exchange(o._initialized, false);
8989
_compat_mode = std::exchange(o._compat_mode, CompatMode::AUTO);
9090
_nbytes = std::exchange(o._nbytes, 0);
91-
_handle = std::exchange(o._handle, {});
91+
_cufile_handle = std::exchange(o._cufile_handle, {});
9292
return *this;
9393
}
9494

@@ -101,7 +101,7 @@ void FileHandle::close() noexcept
101101
try {
102102
if (closed()) { return; }
103103

104-
_handle.unregister_handle();
104+
_cufile_handle.unregister_handle();
105105
_compat_mode = CompatMode::AUTO;
106106
_fd_direct_off.close();
107107
_fd_direct_on.close();
@@ -116,7 +116,7 @@ CUfileHandle_t FileHandle::handle()
116116
if (is_compat_mode_preferred()) {
117117
throw CUfileException("The underlying cuFile handle isn't available in compatibility mode");
118118
}
119-
return _handle.handle();
119+
return _cufile_handle.handle();
120120
}
121121

122122
int FileHandle::fd(bool o_direct) const noexcept
@@ -146,7 +146,7 @@ std::size_t FileHandle::read(void* devPtr_base,
146146
if (sync_default_stream) { CUDA_DRIVER_TRY(cudaAPI::instance().StreamSynchronize(nullptr)); }
147147

148148
KVIKIO_NVTX_SCOPED_RANGE("cufileRead()", size);
149-
ssize_t ret = cuFileAPI::instance().Read(_handle.handle(),
149+
ssize_t ret = cuFileAPI::instance().Read(_cufile_handle.handle(),
150150
devPtr_base,
151151
size,
152152
convert_size2off(file_offset),
@@ -170,7 +170,7 @@ std::size_t FileHandle::write(void const* devPtr_base,
170170
if (sync_default_stream) { CUDA_DRIVER_TRY(cudaAPI::instance().StreamSynchronize(nullptr)); }
171171

172172
KVIKIO_NVTX_SCOPED_RANGE("cufileWrite()", size);
173-
ssize_t ret = cuFileAPI::instance().Write(_handle.handle(),
173+
ssize_t ret = cuFileAPI::instance().Write(_cufile_handle.handle(),
174174
devPtr_base,
175175
size,
176176
convert_size2off(file_offset),
@@ -297,8 +297,13 @@ void FileHandle::read_async(void* devPtr_base,
297297
*bytes_read_p =
298298
static_cast<ssize_t>(read(devPtr_base, *size_p, *file_offset_p, *devPtr_offset_p));
299299
} else {
300-
CUFILE_TRY(cuFileAPI::instance().ReadAsync(
301-
_handle.handle(), devPtr_base, size_p, file_offset_p, devPtr_offset_p, bytes_read_p, stream));
300+
CUFILE_TRY(cuFileAPI::instance().ReadAsync(_cufile_handle.handle(),
301+
devPtr_base,
302+
size_p,
303+
file_offset_p,
304+
devPtr_offset_p,
305+
bytes_read_p,
306+
stream));
302307
}
303308
}
304309

@@ -324,7 +329,7 @@ void FileHandle::write_async(void* devPtr_base,
324329
*bytes_written_p =
325330
static_cast<ssize_t>(write(devPtr_base, *size_p, *file_offset_p, *devPtr_offset_p));
326331
} else {
327-
CUFILE_TRY(cuFileAPI::instance().WriteAsync(_handle.handle(),
332+
CUFILE_TRY(cuFileAPI::instance().WriteAsync(_cufile_handle.handle(),
328333
devPtr_base,
329334
size_p,
330335
file_offset_p,

0 commit comments

Comments
 (0)