rocm.bindings.hipfile

Contents

rocm.bindings.hipfile#

2026-09-24

28 min read time

Applies to Linux and Windows

Advanced Micro Devices, Inc.

Attributes#

Classes#

hipFileOpError

hipFile function return codes

hipFileError

Error status returned from hipFile API calls

hipFileDriverStatusFlags

Filesystems/storage protocols supported by GPU IO on this system

hipFileDriverControlFlags

Control flags for passing to the GPU IO driver

hipFileFeatureFlags

GPU IO Transport & Features supported by the system

hipFileDriverProps_struct_0

GPU IO Driver Configuration

hipFileDriverProps

GPU IO configuration

hipFileRDMAInfo

Userspace RDMA configuration

hipFileFSOps_anon_funptr_0

Type of remote FS used. If NULL, use fstat to discover.

hipFileFSOps_anon_funptr_1

Get a list of host RDMA addresses. If NULL, use any address.

hipFileFSOps_anon_funptr_2

Get the assigned priority of a RDMA device. If -1, there is no preference.

hipFileFSOps_anon_funptr_3

Read from the remote filesystem. If NULL, use the Linux VFS.

hipFileFSOps_anon_funptr_4

Write to the remote filesystem. If NULL, use the Linux VFS.

hipFileFSOps

IO operations for RDMA filesystems

hipFileFileHandleType

Type of file handle being used

hipFileDescr_union_0

(No short description)

hipFileDescr

Top-level structure for performing GPU IO

hipFileOpcode

The direction of data movement in a batch IO request

hipFileStatus

The status of a batch IO operation

hipFileBatchMode

Mode of a batch IO operation

hipFileIOParams_union_0_struct_0

(No short description)

hipFileIOParams_union_0

(No short description)

hipFileIOParams

Input parameters for a batch IO request

hipFileIOEvents

Status of a batch IO operation

hipFileSizeTConfigParameter_t

size_t configuration parameters

hipFileBoolConfigParameter_t

Boolean configuration parameters

hipFileStringConfigParameter_t

String configuration parameters

Functions#

has_symbol(→ bool)

hipFileGetOpErrorString(status)

Return a descriptive string for a hipFile error

hipFileHandleRegister(descr)

Registers an open file for GPU IO

hipFileHandleDeregister(fh)

Deregisters a file from GPU IO

hipFileBufRegister(buffer_base, length, flags)

Registers a GPU memory region to be used with GPU IO

hipFileBufDeregister(buffer_base)

Deregisters a GPU memory region from being used with GPU IO

hipFileRead(fh, buffer_base, size, file_offset, ...)

Synchronously read data from a file into a GPU buffer.

hipFileWrite(fh, buffer_base, size, file_offset, ...)

Synchronously write data from a GPU buffer to a file.

hipFileDriverOpen()

Initialize the GPU IO driver for this process

hipFileDriverClose()

Close the GPU IO driver for this process

hipFileUseCount()

Obtain the current reference count for the library

hipFileDriverGetProperties(props)

Get a list of GPU IO driver properties

hipFileDriverSetPollMode(poll, poll_threshold_size)

Enable/disable polling mode for GPU IO

hipFileDriverSetMaxDirectIOSize(max_direct_io_size)

Set the maximum IO chunk size

hipFileDriverSetMaxCacheSize(max_cache_size)

Set the maximum amount of GPU memory that can be used for bounce buffers

hipFileDriverSetMaxPinnedMemSize(max_pinned_size)

Set the maximum amount of GPU memory that can be pinned

hipFileBatchIOSetUp(max_nr)

Prepare the system to perform a batch IO operation

hipFileBatchIOSubmit(batch_idp, nr, iocbp, flags)

Enqueue a batch of IO requests for the GPU to complete asynchronously

hipFileBatchIOGetStatus(batch_idp, min_nr, nr, iocbp, ...)

Poll for the status of completed batch IO operations

hipFileBatchIOCancel(batch_idp)

Cancels all pending batch IO operations

hipFileBatchIODestroy(batch_idp)

Destroys the batch IO handle and frees the associated resources

hipFileReadAsync(fh, buffer_base, size_p, ...)

Perform an asynchronous read from a stream

hipFileWriteAsync(fh, buffer_base, size_p, ...)

Perform an asynchronous write to a stream

hipFileStreamRegister(stream, flags)

Register a stream to be used by for asynchronous GPU IO

hipFileStreamDeregister(stream)

Deregister a stream and free the associated resources

hipFileGetVersion()

Get the version of the hipFile library

hipFileGetParameterSizeT(param)

Get the value of a size_t configuration parameter

hipFileGetParameterBool(param)

Get the value of a Boolean configuration parameter

hipFileGetParameterString(param, len)

Get the value of a string configuration parameter

hipFileSetParameterSizeT(param, value)

Set the value of a size_t configuration parameter

hipFileSetParameterBool(param, value)

Set the value of a Boolean configuration parameter

hipFileSetParameterString(param, desc_str)

Set the value of a string configuration parameter

Module Contents#

rocm.bindings.hipfile.has_symbol(name: str | bytes | bytearray) → bool#
rocm.bindings.hipfile.HIPFILE_VERSION_MAJOR: Any#
rocm.bindings.hipfile.HIPFILE_VERSION_MINOR: Any#
rocm.bindings.hipfile.HIPFILE_VERSION_PATCH: Any#
rocm.bindings.hipfile.HIPFILE_BASE_ERR: Any#
class rocm.bindings.hipfile.hipFileOpError#

Bases: enum.IntEnum

hipFile function return codes

An error code of -1 indicates a that a C or POSIX error has occurred and errno is likely to have been set.

Note:

HIPFILE_BASE_ERR + 21 and 32 are intentionally omitted.

hipFileSuccess: int#
hipFileDriverNotInitialized: int#
hipFileDriverInvalidProps: int#
hipFileDriverUnsupportedLimit: int#
hipFileDriverVersionMismatch: int#
hipFileDriverVersionReadError: int#
hipFileDriverClosing: int#
hipFilePlatformNotSupported: int#
hipFileIONotSupported: int#
hipFileDeviceNotSupported: int#
hipFileDriverError: int#
hipFileHipDriverError: int#
hipFileHipPointerInvalid: int#
hipFileHipMemoryTypeInvalid: int#
hipFileHipPointerRangeError: int#
hipFileHipContextMismatch: int#
hipFileInvalidMappingSize: int#
hipFileInvalidMappingRange: int#
hipFileInvalidFileType: int#
hipFileInvalidFileOpenFlag: int#
hipFileDIONotSet: int#
hipFileInvalidValue: int#
hipFileMemoryAlreadyRegistered: int#
hipFileMemoryNotRegistered: int#
hipFilePermissionDenied: int#
hipFileDriverAlreadyOpen: int#
hipFileHandleNotRegistered: int#
hipFileHandleAlreadyRegistered: int#
hipFileDeviceNotFound: int#
hipFileInternalError: int#
hipFileGetNewFDFailed: int#
hipFileDriverSetupError: int#
hipFileIODisabled: int#
hipFileBatchSubmitFailed: int#
hipFileGPUMemoryPinningFailed: int#
hipFileBatchFull: int#
hipFileAsyncNotSupported: int#
hipFileIOMaxError: int#
rocm.bindings.hipfile.hipFileOpError_t#
rocm.bindings.hipfile.hipFileGetOpErrorString(status)#

Return a descriptive string for a hipFile error

Args:
status (hipFileOpError) – IN:

Return code provided by hipFile

Returns:

A tuple of size 1 that contains (in that order):

  • bytes: Description of the error encountered

C signature

const char * hipFileGetOpErrorString(hipFileOpError_t status)
class rocm.bindings.hipfile.hipFileError(*args, **kwargs)#

Bases: rocm.bindings.util.types.Pointer

Error status returned from hipFile API calls

Note:

This struct has the [[nodiscard]] attribute in C++ >= 17 and C >= 23 so unhandled return values will generate warnings

err: Any#
hip_drv_err: Any#
static PROPERTIES() → list[str]#
static fromObj(pyobj) → Any#
static allocate(count: int = 1) → Any#
c_sizeof() → int#
as_c_void_p() → Any#
rocm.bindings.hipfile.hipFileError_t#
class rocm.bindings.hipfile.hipFileDriverStatusFlags#

Bases: enum.IntEnum

Filesystems/storage protocols supported by GPU IO on this system

Note:

Value 10 is reserved for YRCloudFile

hipFileLustreSupported: int#
hipFileWekaFSSupported: int#
hipFileNFSSupported: int#
hipFileGPFSSupported: int#
hipFileNVMeSupported: int#
hipFileNVMeoFSupported: int#
hipFileSCSISupported: int#
hipFileScaleFluxCSDSupported: int#
hipFileNVMeshSupported: int#
hipFileBeeGFSSupported: int#
hipFileNVMeP2PSupported: int#
hipFileScatefsSupported: int#
rocm.bindings.hipfile.hipFileDriverStatusFlags_t#
class rocm.bindings.hipfile.hipFileDriverControlFlags#

Bases: enum.IntEnum

Control flags for passing to the GPU IO driver

hipFileUsePollMode: int#
hipFileAllowCompatMode: int#
rocm.bindings.hipfile.hipFileDriverControlFlags_t#
class rocm.bindings.hipfile.hipFileFeatureFlags#

Bases: enum.IntEnum

GPU IO Transport & Features supported by the system

hipFileDynRoutingSupported: int#
hipFileBatchIOSupported: int#
hipFileStreamsSupported: int#
hipFileParallelIOSupported: int#
rocm.bindings.hipfile.hipFileFeatureFlags_t#
class rocm.bindings.hipfile.hipFileDriverProps_struct_0(*args, **kwargs)#

Bases: rocm.bindings.util.types.Pointer

GPU IO Driver Configuration

major_version: Any#
minor_version: Any#
poll_thresh_size: Any#
max_direct_io_size: Any#
driver_status_flags: Any#
driver_control_flags: Any#
static PROPERTIES() → list[str]#
static fromObj(pyobj) → Any#
static allocate(count: int = 1) → Any#
c_sizeof() → int#
as_c_void_p() → Any#
class rocm.bindings.hipfile.hipFileDriverProps(*args, **kwargs)#

Bases: rocm.bindings.util.types.Pointer

GPU IO configuration

nvfs: Any#
feature_flags: Any#
max_device_cache_size: Any#
per_buffer_cache_size: Any#
max_device_pinned_mem_size: Any#
max_batch_io_count: Any#
max_batch_io_timeout_msecs: Any#
static PROPERTIES() → list[str]#
static fromObj(pyobj) → Any#
static allocate(count: int = 1) → Any#
c_sizeof() → int#
as_c_void_p() → Any#
rocm.bindings.hipfile.hipFileDriverProps_t#
class rocm.bindings.hipfile.hipFileRDMAInfo(*args, **kwargs)#

Bases: rocm.bindings.util.types.Pointer

Userspace RDMA configuration

version: Any#
desc_len: Any#
desc_str: Any#
static PROPERTIES() → list[str]#
static fromObj(pyobj) → Any#
static allocate(count: int = 1) → Any#
c_sizeof() → int#
as_c_void_p() → Any#
rocm.bindings.hipfile.hipFileRDMAInfo_t#
class rocm.bindings.hipfile.hipFileFSOps_anon_funptr_0(*args, **kwargs)#

Bases: rocm.bindings.util.types.Pointer

Type of remote FS used. If NULL, use fstat to discover.

class rocm.bindings.hipfile.hipFileFSOps_anon_funptr_1(*args, **kwargs)#

Bases: rocm.bindings.util.types.Pointer

Get a list of host RDMA addresses. If NULL, use any address.

class rocm.bindings.hipfile.hipFileFSOps_anon_funptr_2(*args, **kwargs)#

Bases: rocm.bindings.util.types.Pointer

Get the assigned priority of a RDMA device. If -1, there is no preference.

class rocm.bindings.hipfile.hipFileFSOps_anon_funptr_3(*args, **kwargs)#

Bases: rocm.bindings.util.types.Pointer

Read from the remote filesystem. If NULL, use the Linux VFS.

class rocm.bindings.hipfile.hipFileFSOps_anon_funptr_4(*args, **kwargs)#

Bases: rocm.bindings.util.types.Pointer

Write to the remote filesystem. If NULL, use the Linux VFS.

class rocm.bindings.hipfile.hipFileFSOps(*args, **kwargs)#

Bases: rocm.bindings.util.types.Pointer

IO operations for RDMA filesystems

fs_type: Any#
getRDMADeviceList: Any#
getRDMADevicePriority: Any#
read: Any#
write: Any#
static PROPERTIES() → list[str]#
static fromObj(pyobj) → Any#
static allocate(count: int = 1) → Any#
c_sizeof() → int#
as_c_void_p() → Any#
rocm.bindings.hipfile.hipFileFSOps_t#
class rocm.bindings.hipfile.hipFileFileHandleType#

Bases: enum.IntEnum

Type of file handle being used

hipFileHandleTypeOpaqueFD: int#
hipFileHandleTypeOpaqueWin32: int#
hipFileHandleTypeUserspaceFS: int#
rocm.bindings.hipfile.hipFileFileHandleType_t#
class rocm.bindings.hipfile.hipFileDescr_union_0(*args, **kwargs)#

Bases: rocm.bindings.util.types.Pointer

(No short description)

fd: Any#
hFile: Any#
static PROPERTIES() → list[str]#
static fromObj(pyobj) → Any#
static allocate(count: int = 1) → Any#
c_sizeof() → int#
as_c_void_p() → Any#
class rocm.bindings.hipfile.hipFileDescr(*args, **kwargs)#

Bases: rocm.bindings.util.types.Pointer

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

type: Any#
handle: Any#
fs_ops: Any#
static PROPERTIES() → list[str]#
static fromObj(pyobj) → Any#
static allocate(count: int = 1) → Any#
c_sizeof() → int#
as_c_void_p() → Any#
rocm.bindings.hipfile.hipFileDescr_t#
rocm.bindings.hipfile.hipFileHandleRegister(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.

Args:
descr (hipFileDescr/object) – IN:

Parameters for opening the file

Returns:

A tuple of size 2 that contains (in that order):

C signature

hipFileError_t hipFileHandleRegister(hipFileHandle_t * fh, hipFileDescr_t * descr)
rocm.bindings.hipfile.hipFileHandleDeregister(fh)#

Deregisters a file from GPU IO

Args:
fh (Pointer/object) – IN:

hipfile_handle_param

C signature

void hipFileHandleDeregister(hipFileHandle_t fh)
rocm.bindings.hipfile.hipFileBufRegister(buffer_base, length, 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.

Args:
buffer_base (Pointer/object) – IN:

buffer_base_param

length (int) – IN:

Size of the allocated buffer in bytes

flags (int) – IN:

Control flags for this buffer

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipFileError_t hipFileBufRegister(const void * buffer_base, size_t length, int flags)
rocm.bindings.hipfile.hipFileBufDeregister(buffer_base)#

Deregisters a GPU memory region from being used with GPU IO

Args:
buffer_base (Pointer/object) – IN:

buffer_base_param

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipFileError_t hipFileBufDeregister(const void * buffer_base)
rocm.bindings.hipfile.hipFileRead(fh, buffer_base, size, file_offset, buffer_offset)#

Synchronously read data from a file into a GPU buffer.

Args:
fh (Pointer/object) – IN:

hipFile handle for the target file.

buffer_base (Pointer/object) – IN:

Base pointer of the registered GPU buffer.

size (int) – IN:

Number of bytes to read.

file_offset (int) – IN:

Offset into the file.

buffer_offset (int) – IN:

Offset into the GPU buffer.

Returns:

A tuple of size 3 that contains (in that order):

  • int: The raw ssize_t result. One of:
    • if >= 0: Number of bytes transferred

    • if -1: POSIX system error (see the errno element)

    • else: Negated hipFileOpError_t; when it equals

      -hipFileHipDriverError the HIP driver error is carried in the hip_drv_err element

  • int: errno, snapshotted inside the with nogil block

    right after the call (meaningful only when the result is -1).

  • int: the hipError_t value from

    hipPeekAtLastError(), snapshotted inside the same with nogil block (meaningful only when the result is -hipFileHipDriverError).

rocm.bindings.hipfile.hipFileWrite(fh, buffer_base, size, file_offset, buffer_offset)#

Synchronously write data from a GPU buffer to a file.

Args:
fh (Pointer/object) – IN:

hipFile handle for the target file.

buffer_base (Pointer/object) – IN:

Base pointer of the registered GPU buffer.

size (int) – IN:

Number of bytes to write.

file_offset (int) – IN:

Offset into the file.

buffer_offset (int) – IN:

Offset into the GPU buffer.

Returns:

A tuple of size 3 that contains (in that order):

  • int: The raw ssize_t result. One of:
    • if >= 0: Number of bytes transferred

    • if -1: POSIX system error (see the errno element)

    • else: Negated hipFileOpError_t; when it equals

      -hipFileHipDriverError the HIP driver error is carried in the hip_drv_err element

  • int: errno, snapshotted inside the with nogil block

    right after the call (meaningful only when the result is -1).

  • int: the hipError_t value from

    hipPeekAtLastError(), snapshotted inside the same with nogil block (meaningful only when the result is -hipFileHipDriverError).

rocm.bindings.hipfile.hipFileDriverOpen()#

Initialize the GPU IO driver for this process

Each call to hipFileDriverOpen() increments the library’s reference count. If a call to hipFileDriverOpen() results in the reference count transitioning from zero to one, the library’s state will be initialized.

Calling hipFileDriverOpen() is optional. The first call to hipFileBufRegister() or hipFileHandleRegister() will trigger library initialization and increment the library’s reference count.

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipFileError_t hipFileDriverOpen()
rocm.bindings.hipfile.hipFileDriverClose()#

Close the GPU IO driver for this process

Each call to hipFileDriverClose() decrements the library’s reference count. If a call to hipFileDriverClose() results in the reference count transitioning from one to zero, the library’s state will be destroyed.

Explicitly closing the library is not required; the library’s state will be destroyed automatically at program exit.

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipFileError_t hipFileDriverClose()
rocm.bindings.hipfile.hipFileUseCount()#

Obtain the current reference count for the library

See:

hipFileDriverOpen

See:

hipFileDriverClose

Returns:

A tuple of size 1 that contains (in that order):

  • int: The library’s reference count

C signature

int64_t hipFileUseCount()
rocm.bindings.hipfile.hipFileDriverGetProperties(props)#

Get a list of GPU IO driver properties

warn_not_implemented

Args:
props (hipFileDriverProps/object) – OUT:

See hipFileDriverProps_t for what properties are reported

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipFileError_t hipFileDriverGetProperties(hipFileDriverProps_t * props)
rocm.bindings.hipfile.hipFileDriverSetPollMode(poll, poll_threshold_size)#

Enable/disable polling mode for GPU IO

warn_not_implemented

Args:
poll (bint) – IN:

true to enable polling, false to disable

poll_threshold_size (int) – IN:

Maximum IO size (in KiB) for which polling is used when enabled

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipFileError_t hipFileDriverSetPollMode(_Bool poll, size_t poll_threshold_size)
rocm.bindings.hipfile.hipFileDriverSetMaxDirectIOSize(max_direct_io_size)#

Set the maximum IO chunk size

warn_not_implemented

Args:
max_direct_io_size (int) – IN:

Maximum IO chunk size (in KiB) for each IO request

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipFileError_t hipFileDriverSetMaxDirectIOSize(size_t max_direct_io_size)
rocm.bindings.hipfile.hipFileDriverSetMaxCacheSize(max_cache_size)#

Set the maximum amount of GPU memory that can be used for bounce buffers

warn_not_implemented

Args:
max_cache_size (int) – IN:

Maximum GPU memory (in KiB) that can be reserved for bounce buffers

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipFileError_t hipFileDriverSetMaxCacheSize(size_t max_cache_size)
rocm.bindings.hipfile.hipFileDriverSetMaxPinnedMemSize(max_pinned_size)#

Set the maximum amount of GPU memory that can be pinned

warn_not_implemented

Args:
max_pinned_size (int) – IN:

Maximum GPU memory (in KiB) that can be pinned

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipFileError_t hipFileDriverSetMaxPinnedMemSize(size_t max_pinned_size)
class rocm.bindings.hipfile.hipFileOpcode#

Bases: enum.IntEnum

The direction of data movement in a batch IO request

hipFileBatchRead: int#
hipFileBatchWrite: int#
rocm.bindings.hipfile.hipFileOpcode_t#
class rocm.bindings.hipfile.hipFileStatus#

Bases: enum.IntEnum

The status of a batch IO operation

hipFileWaiting: int#
hipFilePending: int#
hipFileInvalid: int#
hipFileCanceled: int#
hipFileComplete: int#
hipFileTimeout: int#
hipFileFailed: int#
rocm.bindings.hipfile.hipFileStatus_t#
class rocm.bindings.hipfile.hipFileBatchMode#

Bases: enum.IntEnum

Mode of a batch IO operation

hipFileBatch: int#
rocm.bindings.hipfile.hipFileBatchMode_t#
class rocm.bindings.hipfile.hipFileIOParams_union_0_struct_0(*args, **kwargs)#

Bases: rocm.bindings.util.types.Pointer

(No short description)

devPtr_base: Any#
file_offset: Any#
devPtr_offset: Any#
size: Any#
static PROPERTIES() → list[str]#
static fromObj(pyobj) → Any#
static allocate(count: int = 1) → Any#
c_sizeof() → int#
as_c_void_p() → Any#
class rocm.bindings.hipfile.hipFileIOParams_union_0(*args, **kwargs)#

Bases: rocm.bindings.util.types.Pointer

(No short description)

batch: Any#
static PROPERTIES() → list[str]#
static fromObj(pyobj) → Any#
static allocate(count: int = 1) → Any#
c_sizeof() → int#
as_c_void_p() → Any#
class rocm.bindings.hipfile.hipFileIOParams(*args, **kwargs)#

Bases: rocm.bindings.util.types.Pointer

Input parameters for a batch IO request

mode: Any#
u: Any#
fh: Any#
opcode: Any#
cookie: Any#
static PROPERTIES() → list[str]#
static fromObj(pyobj) → Any#
static allocate(count: int = 1) → Any#
c_sizeof() → int#
as_c_void_p() → Any#
rocm.bindings.hipfile.hipFileIOParams_t#
class rocm.bindings.hipfile.hipFileIOEvents(*args, **kwargs)#

Bases: rocm.bindings.util.types.Pointer

Status of a batch IO operation

cookie: Any#
status: Any#
ret: Any#
static PROPERTIES() → list[str]#
static fromObj(pyobj) → Any#
static allocate(count: int = 1) → Any#
c_sizeof() → int#
as_c_void_p() → Any#
rocm.bindings.hipfile.hipFileIOEvents_t#
rocm.bindings.hipfile.hipFileBatchIOSetUp(max_nr)#

Prepare the system to perform a batch IO operation

Args:
max_nr (int) – IN:

Maximum number of requests that can be submitted to this batch handle

Returns:

A tuple of size 2 that contains (in that order):

C signature

hipFileError_t hipFileBatchIOSetUp(hipFileBatchHandle_t * batch_idp, unsigned int max_nr)
rocm.bindings.hipfile.hipFileBatchIOSubmit(batch_idp, nr, iocbp, flags)#

Enqueue a batch of IO requests for the GPU to complete asynchronously

Args:
batch_idp (Pointer/object) – IN:

batch_handle_param

nr (int) – IN:

Number of batch IO requests to submit

iocbp (hipFileIOParams/object) – IN:

An array of nr batch IO requests to submit to the GPU. Data will be read into or written from the buffer specified in each request.

flags (int) – IN:

Control Flags for the batch IO. Currently unused.

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipFileError_t hipFileBatchIOSubmit(hipFileBatchHandle_t batch_idp, unsigned int nr, hipFileIOParams_t * iocbp, unsigned int flags)
rocm.bindings.hipfile.hipFileBatchIOGetStatus(batch_idp, min_nr, nr, iocbp, timeout)#

Poll for the status of completed batch IO operations

warn_not_implemented

Args:
batch_idp (Pointer/object) – IN:

batch_handle_param

min_nr (int) – IN:

Minimum number of batch operation statuses that should be returned. If timeout is exceeded, fewer statuses may be returned.

nr (PointerToUnsigned/object) – IN,OUT:

Maximum number of batch operation statuses that can be returned. This is parameter is modified to return the number of statuses returned in iocbp.

iocbp (hipFileIOEvents/object) – OUT:

An array containing up to nr statuses from the overall batch operation

timeout (Pointer/object) – IN:

Maximum amount of time this function should poll for status updates

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipFileError_t hipFileBatchIOGetStatus(hipFileBatchHandle_t batch_idp, unsigned int min_nr, unsigned int * nr, hipFileIOEvents_t * iocbp, struct timespec * timeout)
rocm.bindings.hipfile.hipFileBatchIOCancel(batch_idp)#

Cancels all pending batch IO operations

warn_not_implemented

Args:
batch_idp (Pointer/object) – IN:

batch_handle_param

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipFileError_t hipFileBatchIOCancel(hipFileBatchHandle_t batch_idp)
rocm.bindings.hipfile.hipFileBatchIODestroy(batch_idp)#

Destroys the batch IO handle and frees the associated resources

warn_not_implemented_void

Args:
batch_idp (Pointer/object) – IN:

batch_handle_param

C signature

void hipFileBatchIODestroy(hipFileBatchHandle_t batch_idp)
rocm.bindings.hipfile.hipFileReadAsync(fh, buffer_base, size_p, file_offset_p, buffer_offset_p, bytes_read_p, stream)#

Perform an asynchronous read from a stream

max_io_size_note

Args:
fh (Pointer/object) – IN:

hipfile_handle_param

buffer_base (Pointer/object) – IN:

buffer_base_param

size_p (PointerToUInt64/object) – IN:

Number of bytes that should be read

file_offset_p (PointerToInt64/object) – IN:

Offset into the file that should be read from

buffer_offset_p (PointerToInt64/object) – IN:

Offset of the GPU buffer that that the data should be written to

bytes_read_p (PointerToInt64/object) – OUT:

Number of bytes read

stream (Pointer/object) – IN:

hipstream_param. hipstream_if_null.

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipFileError_t hipFileReadAsync(hipFileHandle_t fh, void * buffer_base, size_t * size_p, hoff_t * file_offset_p, hoff_t * buffer_offset_p, ssize_t * bytes_read_p, hipStream_t stream)
rocm.bindings.hipfile.hipFileWriteAsync(fh, buffer_base, size_p, file_offset_p, buffer_offset_p, bytes_written_p, stream)#

Perform an asynchronous write to a stream

max_io_size_note

Args:
fh (Pointer/object) – IN:

hipfile_handle_param

buffer_base (Pointer/object) – IN:

buffer_base_param

size_p (PointerToUInt64/object) – IN:

Number of bytes that should be written

file_offset_p (PointerToInt64/object) – IN:

Offset into the file that should be written to

buffer_offset_p (PointerToInt64/object) – IN:

Offset of the GPU buffer that that the data should be read from

bytes_written_p (PointerToInt64/object) – OUT:

Number of bytes written

stream (Pointer/object) – IN:

hipstream_param. hipstream_if_null.

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipFileError_t hipFileWriteAsync(hipFileHandle_t fh, void * buffer_base, size_t * size_p, hoff_t * file_offset_p, hoff_t * buffer_offset_p, ssize_t * bytes_written_p, hipStream_t stream)
rocm.bindings.hipfile.hipFileStreamRegister(stream, flags)#

Register a stream to be used by for asynchronous GPU IO

Args:
stream (Pointer/object) – IN:

hipstream_param

flags (int) – IN:

Flags that can optimize stream processing if parameters are known/are aligned at time of request submission

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipFileError_t hipFileStreamRegister(hipStream_t stream, unsigned int flags)
rocm.bindings.hipfile.hipFileStreamDeregister(stream)#

Deregister a stream and free the associated resources

Args:
stream (Pointer/object) – IN:

hipstream_param

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipFileError_t hipFileStreamDeregister(hipStream_t stream)
rocm.bindings.hipfile.hipFileGetVersion()#

Get the version of the hipFile library

Note:

Parameters can be set to NULL to ignore that part of the version

Returns:

A tuple of size 4 that contains (in that order):

C signature

hipFileError_t hipFileGetVersion(unsigned int * major, unsigned int * minor, unsigned int * patch)
class rocm.bindings.hipfile.hipFileSizeTConfigParameter_t#

Bases: enum.IntEnum

size_t configuration parameters

hipFileParamProfileStats: int#
hipFileParamExecutionMaxIOQueueDepth: int#
hipFileParamExecutionMaxIOThreads: int#
hipFileParamExecutionMinIOThresholdSizeKB: int#
hipFileParamExecutionMaxRequestParallelism: int#
hipFileParamPropertiesMaxDirectIOSizeKB: int#
hipFileParamPropertiesMaxDeviceCacheSizeKB: int#
hipFileParamPropertiesPerBufferCacheSizeKB: int#
hipFileParamPropertiesMaxDevicePinnedMemSizeKB: int#
hipFileParamPropertiesIOBatchsize: int#
hipFileParamPollthresholdSizeKB: int#
hipFileParamPropertiesBatchIOTimeoutMs: int#
class rocm.bindings.hipfile.hipFileBoolConfigParameter_t#

Bases: enum.IntEnum

Boolean configuration parameters

hipFileParamPropertiesUsePollMode: int#
hipFileParamPropertiesAllowCompatMode: int#
hipFileParamForceCompatMode: int#
hipFileParamFsMiscApiCheckAggressive: int#
hipFileParamExecutionParallelIO: int#
hipFileParamProfileNvtx: int#
hipFileParamPropertiesAllowSystemMemory: int#
hipFileParamUsePcip2pdma: int#
hipFileParamPreferIOUring: int#
hipFileParamForceOdirectMode: int#
hipFileParamSkipTopologyDetection: int#
hipFileParamStreamMemopsBypass: int#
class rocm.bindings.hipfile.hipFileStringConfigParameter_t#

Bases: enum.IntEnum

String configuration parameters

hipFileParamLoggingLevel: int#
hipFileParamEnvLogfilePath: int#
hipFileParamLogDir: int#
rocm.bindings.hipfile.hipFileGetParameterSizeT(param)#

Get the value of a size_t configuration parameter

warn_not_implemented

Note:

If the driver is open, the value returned is the value currently in use by the driver.

Note:

If the driver is closed, the value returned is the value that was last set by hipFileSetParameter*.

Args:
param (hipFileSizeTConfigParameter_t):

The configuration parameter

Returns:

A tuple of size 2 that contains (in that order):

  • hipFileError: hipfile_error_return

  • int:

    The location to store the value of the configuration parameter

C signature

hipFileError_t hipFileGetParameterSizeT(hipFileSizeTConfigParameter_t param, size_t * value)
rocm.bindings.hipfile.hipFileGetParameterBool(param)#

Get the value of a Boolean configuration parameter

warn_not_implemented

Note:

If the driver is open, the value returned is the value currently in use by the driver.

Note:

If the driver is closed, the value returned is the value that was last set by hipFileSetParameter*.

Args:
param (hipFileBoolConfigParameter_t):

The configuration parameter

Returns:

A tuple of size 2 that contains (in that order):

  • hipFileError: hipfile_error_return

  • bool:

    The location to store the value of the configuration parameter

C signature

hipFileError_t hipFileGetParameterBool(hipFileBoolConfigParameter_t param, _Bool * value)
rocm.bindings.hipfile.hipFileGetParameterString(param, len)#

Get the value of a string configuration parameter

warn_not_implemented

Note:

If the driver is open, the value returned is the value currently in use by the driver.

Note:

If the driver is closed, the value returned is the value that was last set by hipFileSetParameter*.

Args:
param (hipFileStringConfigParameter_t):

The configuration parameter

len (int):

The length of the desc_str parameter

Returns:

A tuple of size 2 that contains (in that order):

  • hipFileError: hipfile_error_return

  • CStr/object:

    The location to store the value of the configuration parameter

C signature

hipFileError_t hipFileGetParameterString(hipFileStringConfigParameter_t param, char * desc_str, int len)
rocm.bindings.hipfile.hipFileSetParameterSizeT(param, value)#

Set the value of a size_t configuration parameter

warn_not_implemented

Note:

Configuration parameter values may only be set when the driver is closed. Values are applied when the driver is opened.

Args:
param (hipFileSizeTConfigParameter_t):

The configuration parameter

value (int):

The value of the configuration parameter

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipFileError_t hipFileSetParameterSizeT(hipFileSizeTConfigParameter_t param, size_t value)
rocm.bindings.hipfile.hipFileSetParameterBool(param, value)#

Set the value of a Boolean configuration parameter

warn_not_implemented

Note:

Configuration parameter values may only be set when the driver is closed. Values are applied when the driver is opened.

Args:
param (hipFileBoolConfigParameter_t):

The configuration parameter

value (bint):

The value of the configuration parameter

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipFileError_t hipFileSetParameterBool(hipFileBoolConfigParameter_t param, _Bool value)
rocm.bindings.hipfile.hipFileSetParameterString(param, desc_str)#

Set the value of a string configuration parameter

warn_not_implemented

Note:

Configuration parameter values may only be set when the driver is closed. Values are applied when the driver is opened.

Args:
param (hipFileStringConfigParameter_t):

The configuration parameter

desc_str (CStr/object):

The value of the configuration parameter

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipFileError_t hipFileSetParameterString(hipFileStringConfigParameter_t param, const char * desc_str)