File handle, buffer, and RDMA API reference#
This page documents the hipFile functions and types for registering and deregistering file handles and GPU memory buffers with the hipFile driver.
For a walkthrough of synchronous reads and writes using registered handles and buffers, see Copy a file via GPU memory using hipFile. For the synchronous read and write function signatures, see Synchronous read and write API reference.
File handle and buffer types and functions#
File handle types, the filesystem operations structure, and the functions for registering and deregistering file handles and GPU memory buffers with the hipFile driver.
-
enum hipFileFileHandleType_t#
Type of file handle being used.
Values:
-
enumerator hipFileHandleTypeOpaqueFD#
POSIX file descriptor.
-
enumerator hipFileHandleTypeOpaqueWin32#
Win32 HANDLE file handle.
-
enumerator hipFileHandleTypeUserspaceFS#
Userspace RDMA filesystem.
-
enumerator hipFileHandleTypeOpaqueFD#
-
typedef void *hipFileHandle_t#
Opaque file handle used by the GPU IO driver/library.
-
HIPFILE_API hipFileError_t hipFileHandleRegister(hipFileHandle_t *fh, hipFileDescr_t *descr)#
Registers an open file for GPU IO.
Note
If the library has not already been initialized, the first call to
hipFileHandleRegister()will initialize the library and increment the reference count.- Parameters:
fh – [out] Opaque file handle for GPU I/O operations
descr – [in] Parameters for opening the file
- Returns:
A hipFileError_t struct that holds both hipFile and HIP error values
-
HIPFILE_API void hipFileHandleDeregister(hipFileHandle_t fh)#
Deregisters a file from GPU IO.
- Parameters:
fh – [in] Opaque file handle for GPU I/O operations
-
HIPFILE_API hipFileError_t hipFileBufRegister(const void *buffer_base, size_t length, int flags)#
Registers a GPU memory region to be used with GPU IO.
The memory region should be allocated by the user before being passed to the API call
Note
If the library has not already been initialized, the first call to
hipFileBufRegister()will initialize the library and increment the reference count.- Parameters:
buffer_base – [in] Base address of the GPU buffer
length – [in] Size of the allocated buffer in bytes
flags – [in] Control flags for this buffer
- Returns:
A hipFileError_t struct that holds both hipFile and HIP error values
-
HIPFILE_API hipFileError_t hipFileBufDeregister(const void *buffer_base)#
Deregisters a GPU memory region from being used with GPU IO.
- Parameters:
buffer_base – [in] Base address of the GPU buffer
- Returns:
A hipFileError_t struct that holds both hipFile and HIP error values
-
struct hipFileFSOps_t#
- #include <hipfile.h>
IO operations for RDMA filesystems.
-
struct hipFileDescr_t#
- #include <hipfile.h>
Top-level structure for performing GPU IO.
hipFileHandleTypeOpaqueFD -> handle.fd non-negative, fs_ops ignored hipFileHandleTypeOpaqueWin32 -> handle.hFile non-NULL, fs_ops ignored hipFileHandleTypeUserspaceFS -> handle.fd non-negative, fs_ops non-NULL