rocprofiler-sdk/hipfile/details/hipfile.h Source File#
|
ROCprofiler-SDK developer API 1.4.1
ROCm Profiling API and tools
|
hipfile.h
Go to the documentation of this file.
140 hipFileDriverUnsupportedLimit = HIPFILE_BASE_ERR + 3, //!< GPU IO Driver property value is unsupported
141 hipFileDriverVersionMismatch = HIPFILE_BASE_ERR + 4, //!< hipFile version does not match GPU IO driver version
142 hipFileDriverVersionReadError = HIPFILE_BASE_ERR + 5, //!< Unable to read the GPU IO driver version
143 hipFileDriverClosing = HIPFILE_BASE_ERR + 6, //!< GPU IO driver is closing and not accepting new requests
144 hipFilePlatformNotSupported = HIPFILE_BASE_ERR + 7, //!< hipFile is not supported on the current platform
145 hipFileIONotSupported = HIPFILE_BASE_ERR + 8, //!< hipFile is not supported on the selected file
146 hipFileDeviceNotSupported = HIPFILE_BASE_ERR + 9, //!< The selected GPU does not support hipFile
148 hipFileHipDriverError = HIPFILE_BASE_ERR + 11, //!< GPU driver error: Inspect the hipError_t value for additional information
150 hipFileHipMemoryTypeInvalid = HIPFILE_BASE_ERR + 13, //!< Memory type backing pointer is incompatible with hipFile
151 hipFileHipPointerRangeError = HIPFILE_BASE_ERR + 14, //!< Pointer range exceeds allocated memory region
153 hipFileInvalidMappingSize = HIPFILE_BASE_ERR + 16, //!< Accessing memory beyond pinned memory buffer
154 hipFileInvalidMappingRange = HIPFILE_BASE_ERR + 17, //!< Accessing memory beyond mapped memory region
160 hipFileMemoryAlreadyRegistered = HIPFILE_BASE_ERR + 23, //!< Device pointer is already registered
164 hipFileHandleNotRegistered = HIPFILE_BASE_ERR + 27, //!< File handle for GPU IO is not registered
165 hipFileHandleAlreadyRegistered = HIPFILE_BASE_ERR + 28, //!< File handle for GPU IO is already registered
171 hipFileIODisabled = HIPFILE_BASE_ERR + 34, //!< GPU IO config file prohibits GPU IO on specified file
172 hipFileBatchSubmitFailed = HIPFILE_BASE_ERR + 35, //!< Failed to submit request for batch operation
173 hipFileGPUMemoryPinningFailed = HIPFILE_BASE_ERR + 36, //!< Failed to allocated pinned device memory
176 hipFileIOMaxError = HIPFILE_BASE_ERR + 39, //!< Internal flag to mark largest hipFile error code
342 uint64_t poll_thresh_size; //!< Maximum IO size (in KiB) for which polling is used when poll mode is
348 } nvfs;
352 uint64_t max_device_cache_size; //!< Maximum amount of GPU memory (in KiB) that can be used for bounce
354 uint64_t per_buffer_cache_size; //!< Amount of GPU memory (in KiB) allocated for each bounce buffer
355 uint64_t max_device_pinned_mem_size; //!< Maximum amount of GPU memory (in KiB) that can be pinned
357 unsigned max_batch_io_count; //!< Maximum number of batch operations that can be submitted at once
546ssize_t hipFileWrite(hipFileHandle_t fh, const void *buffer_base, size_t size, hoff_t file_offset,
645 * @param [in] max_cache_size Maximum GPU memory (in KiB) that can be reserved for bounce buffers
685 hipFileInvalid = 1 << 2, //!< Batch IO operation was rejected for being invalid or could not be queued
761hipFileError_t hipFileBatchIOSubmit(hipFileBatchHandle_t batch_idp, unsigned nr, hipFileIOParams_t *iocbp,
782hipFileError_t hipFileBatchIOGetStatus(hipFileBatchHandle_t batch_idp, unsigned min_nr, unsigned *nr,
854hipFileError_t hipFileReadAsync(hipFileHandle_t fh, void *buffer_base, size_t *size_p, hoff_t *file_offset_p,
874hipFileError_t hipFileWriteAsync(hipFileHandle_t fh, void *buffer_base, size_t *size_p, hoff_t *file_offset_p,
984 * @note If the driver is closed, the value returned is the value that was last set by hipFileSetParameter*.
1001 * @note If the driver is closed, the value returned is the value that was last set by hipFileSetParameter*.
1019 * @note If the driver is closed, the value returned is the value that was last set by hipFileSetParameter*.
1022hipFileError_t hipFileGetParameterString(hipFileStringConfigParameter_t param, char *desc_str, int len);
1035 * @note Configuration parameter values may only be set when the driver is closed. Values are applied when the
1052 * @note Configuration parameter values may only be set when the driver is closed. Values are applied when the
1069 * @note Configuration parameter values may only be set when the driver is closed. Values are applied when the
1073hipFileError_t hipFileSetParameterString(hipFileStringConfigParameter_t param, const char *desc_str);
1107 hipFileOpCounter_t hdl_deregister_ops; //!< File handle deregister operation counters (zero-filled)
1113 uint64_t read_bw_bytes_per_sec; //!< Read bandwidth (bytes/sec), derived from bytes and latency sum
1114 uint64_t write_bw_bytes_per_sec; //!< Write bandwidth (bytes/sec), derived from bytes and latency sum
1115 uint64_t read_lat_avg_us; //!< Average read latency (us), derived from latency sum and op count
1116 uint64_t write_lat_avg_us; //!< Average write latency (us), derived from latency sum and op count
1130 hipFileOpCounter_t batch_posix_enqueued_ops; //!< POSIX batch enqueue operation counters (zero-filled)
1132 hipFileOpCounter_t batch_posix_processed_ops; //!< POSIX batch process operation counters (zero-filled)
1133 hipFileOpCounter_t batch_nvfs_submit_ops; //!< NVFS batch submit operation counters (zero-filled)
1134 hipFileOpCounter_t batch_p2p_submit_ops; //!< P2P batch submit operation counters (zero-filled)
1135 hipFileOpCounter_t batch_aio_submit_ops; //!< AIO batch submit operation counters (zero-filled)
1136 hipFileOpCounter_t batch_iouring_submit_ops; //!< io_uring batch submit operation counters (zero-filled)
1137 hipFileOpCounter_t batch_mixed_io_submit_ops; //!< Mixed IO batch submit operation counters (zero-filled)
1138 hipFileOpCounter_t batch_total_submit_ops; //!< Total batch submit operation counters (zero-filled)
1179 uint64_t read_bw_bytes_per_sec; //!< Read bandwidth (bytes/sec), derived from bytes and duration
1193 uint64_t write_bw_bytes_per_sec; //!< Write bandwidth (bytes/sec), derived from bytes and duration
1223 hipFilePerGpuStats_t per_gpu_stats[HIPFILE_MAX_GPUS]; //!< Per-GPU statistics, indexed by GPU ordinal
hipFileError_t hipFileWriteAsync(hipFileHandle_t fh, void *buffer_base, unsigned long *size_p, hoff_t *file_offset_p, hoff_t *buffer_offset_p, ssize_t *bytes_written_p, hipStream_t stream)
Perform an asynchronous write to a stream.
hipFileError_t hipFileStreamRegister(hipStream_t stream, unsigned flags)
Register a stream to be used by for asynchronous GPU IO.
hipFileError_t hipFileStreamDeregister(hipStream_t stream)
Deregister a stream and free the associated resources.
hipFileError_t hipFileReadAsync(hipFileHandle_t fh, void *buffer_base, unsigned long *size_p, hoff_t *file_offset_p, hoff_t *buffer_offset_p, ssize_t *bytes_read_p, hipStream_t stream)
Perform an asynchronous read from a stream.
void * cookie
Optionally used to track IO operations (e.g. self-reference pointer)
Definition hipfile.h:716
unsigned long ret
Number of bytes transferred or POSIX error code if negative.
Definition hipfile.h:726
void * cookie
Optionally used to track IO operations (e.g. pointer to corresponding hipFileIOParams)
Definition hipfile.h:724
hipFileError_t hipFileBatchIOCancel(hipFileBatchHandle_t batch_idp)
Cancels all pending batch IO operations.
hipFileError_t hipFileBatchIOGetStatus(hipFileBatchHandle_t batch_idp, unsigned min_nr, unsigned *nr, hipFileIOEvents_t *iocbp, struct timespec *timeout)
Poll for the status of completed batch IO operations.
hipFileError_t hipFileBatchIOSetUp(hipFileBatchHandle_t *batch_idp, unsigned max_nr)
Prepare the system to perform a batch IO operation.
void hipFileBatchIODestroy(hipFileBatchHandle_t batch_idp)
Destroys the batch IO handle and frees the associated resources.
hipFileError_t hipFileBatchIOSubmit(hipFileBatchHandle_t batch_idp, unsigned nr, hipFileIOParams_t *iocbp, unsigned flags)
Enqueue a batch of IO requests for the GPU to complete asynchronously.
@ hipFileInvalid
Batch IO operation was rejected for being invalid or could not be queued.
Definition hipfile.h:685
hipFileError_t hipFileGetParameterString(hipFileStringConfigParameter_t param, char *desc_str, int len)
Get the value of a string configuration parameter.
hipFileError_t hipFileGetParameterBool(hipFileBoolConfigParameter_t param, bool *value)
Get the value of a Boolean configuration parameter.
hipFileError_t hipFileSetParameterSizeT(hipFileSizeTConfigParameter_t param, unsigned long value)
Set the value of a size_t configuration parameter.
hipFileError_t hipFileSetParameterString(hipFileStringConfigParameter_t param, const char *desc_str)
Set the value of a string configuration parameter.
hipFileError_t hipFileSetParameterBool(hipFileBoolConfigParameter_t param, bool value)
Set the value of a Boolean configuration parameter.
hipFileError_t hipFileGetParameterSizeT(hipFileSizeTConfigParameter_t param, unsigned long *value)
Get the value of a size_t configuration parameter.
hipFileError_t hipFileGetVersion(unsigned *major, unsigned *minor, unsigned *patch)
Get the version of the hipFile library.
@ hipFileParamPropertiesMaxDevicePinnedMemSizeKB
Max device pinned memory size (KiB)
Definition hipfile.h:937
uint64_t max_device_cache_size
Maximum amount of GPU memory (in KiB) that can be used for bounce buffers.
Definition hipfile.h:352
uint64_t per_buffer_cache_size
Amount of GPU memory (in KiB) allocated for each bounce buffer.
Definition hipfile.h:354
uint64_t max_device_pinned_mem_size
Maximum amount of GPU memory (in KiB) that can be pinned.
Definition hipfile.h:355
unsigned max_batch_io_count
Maximum number of batch operations that can be submitted at once.
Definition hipfile.h:357
unsigned max_batch_io_timeout_msecs
Timeout (in msec) for a batch operation to complete.
Definition hipfile.h:358
hipFileError_t hipFileDriverGetProperties(hipFileDriverProps_t *props)
Get a list of GPU IO driver properties.
hipFileError_t hipFileDriverSetPollMode(bool poll, unsigned long poll_threshold_size)
Enable/disable polling mode for GPU IO.
hipFileError_t hipFileDriverOpen(void)
Initialize the GPU IO driver for this process.
hipFileDriverStatusFlags_t
Filesystems/storage protocols supported by GPU IO on this system.
Definition hipfile.h:294
hipFileError_t hipFileDriverSetMaxDirectIOSize(unsigned long max_direct_io_size)
Set the maximum IO chunk size.
hipFileError_t hipFileDriverSetMaxCacheSize(unsigned long max_cache_size)
Set the maximum amount of GPU memory that can be used for bounce buffers.
hipFileError_t hipFileDriverSetMaxPinnedMemSize(unsigned long max_pinned_size)
Set the maximum amount of GPU memory that can be pinned.
const char * hipFileGetOpErrorString(hipFileOpError_t status)
Return a descriptive string for a hipFile error.
@ hipFilePlatformNotSupported
hipFile is not supported on the current platform
Definition hipfile.h:144
@ hipFileHandleAlreadyRegistered
File handle for GPU IO is already registered.
Definition hipfile.h:165
@ hipFileDriverVersionMismatch
hipFile version does not match GPU IO driver version
Definition hipfile.h:141
@ hipFileHipDriverError
GPU driver error: Inspect the hipError_t value for additional information.
Definition hipfile.h:148
@ hipFileDriverClosing
GPU IO driver is closing and not accepting new requests.
Definition hipfile.h:143
@ hipFileHipMemoryTypeInvalid
Memory type backing pointer is incompatible with hipFile.
Definition hipfile.h:150
hipFileError_t hipFileBufDeregister(const void *buffer_base)
Deregisters a GPU memory region from being used with GPU IO.
void hipFileHandleDeregister(hipFileHandle_t fh)
Deregisters a file from GPU IO.
hipFileError_t hipFileBufRegister(const void *buffer_base, unsigned long length, int flags)
Registers a GPU memory region to be used with GPU IO.
hipFileError_t hipFileHandleRegister(hipFileHandle_t *fh, hipFileDescr_t *descr)
Registers an open file for GPU IO.
ssize_t hipFileRead(hipFileHandle_t fh, void *buffer_base, unsigned long size, hoff_t file_offset, hoff_t buffer_offset)
Synchronously read data from a file into a GPU buffer.
ssize_t hipFileWrite(hipFileHandle_t fh, const void *buffer_base, unsigned long size, hoff_t file_offset, hoff_t buffer_offset)
Synchronously write data from a GPU buffer to a file.
uint64_t read_bw_bytes_per_sec
Read bandwidth (bytes/sec), derived from bytes and duration.
Definition hipfile.h:1179
uint64_t read_bw_bytes_per_sec
Read bandwidth (bytes/sec), derived from bytes and latency sum.
Definition hipfile.h:1113
hipFileOpCounter_t batch_posix_processed_ops
POSIX batch process operation counters (zero-filled)
Definition hipfile.h:1132
hipFileError_t hipFileGetStatsL2(hipFileStatsLevel2_t *stats)
Get Level 2 hipFile statistics.
hipFileOpCounter_t batch_posix_enqueued_ops
POSIX batch enqueue operation counters (zero-filled)
Definition hipfile.h:1130
hipFileError_t hipFileGetStatsL1(hipFileStatsLevel1_t *stats)
Get Level 1 hipFile statistics.
uint64_t write_bw_bytes_per_sec
Write bandwidth (bytes/sec), derived from bytes and duration.
Definition hipfile.h:1193
hipFileOpCounter_t batch_p2p_submit_ops
P2P batch submit operation counters (zero-filled)
Definition hipfile.h:1134
hipFileOpCounter_t batch_iouring_submit_ops
io_uring batch submit operation counters (zero-filled)
Definition hipfile.h:1136
uint64_t batch_complete_ops_per_sec
Batch complete operations per second (zero-filled)
Definition hipfile.h:1147
uint64_t n_mmap
Number of buffer registrations (global counter, not per-GPU)
Definition hipfile.h:1204
uint64_t write_bw_bytes_per_sec
Write bandwidth (bytes/sec), derived from bytes and latency sum.
Definition hipfile.h:1114
hipFileOpCounter_t batch_processed_ops
Batch process operation counters (zero-filled)
Definition hipfile.h:1131
uint64_t batch_submit_ops_per_sec
Batch submit operations per second (zero-filled)
Definition hipfile.h:1146
hipFileOpCounter_t batch_submit_ops
Batch submit operation counters (zero-filled)
Definition hipfile.h:1124
hipFileOpCounter_t batch_destroy_ops
Batch destroy operation counters (zero-filled)
Definition hipfile.h:1128
uint64_t read_lat_avg_us
Average read latency (us), derived from latency sum and op count.
Definition hipfile.h:1115
#define HIPFILE_GPU_UUID_LEN
Length of the GPU UUID field in hipFilePerGpuStats_t.
Definition hipfile.h:1085
uint64_t batch_submit_lat_sum_us
Sum of batch submit latencies (zero-filled)
Definition hipfile.h:1148
hipFileOpCounter_t buf_deregister_ops
Buffer deregister operation counters (zero-filled)
Definition hipfile.h:1109
hipFileOpCounter_t batch_aio_submit_ops
AIO batch submit operation counters (zero-filled)
Definition hipfile.h:1135
hipFileOpCounter_t hdl_deregister_ops
File handle deregister operation counters (zero-filled)
Definition hipfile.h:1107
uint64_t batch_completion_lat_avg_us
Average batch completion latency (zero-filled)
Definition hipfile.h:1145
hipFileOpCounter_t batch_nvfs_submit_ops
NVFS batch submit operation counters (zero-filled)
Definition hipfile.h:1133
hipFileOpCounter_t hdl_register_ops
File handle register operation counters.
Definition hipfile.h:1106
uint64_t write_lat_avg_us
Average write latency (us), derived from latency sum and op count.
Definition hipfile.h:1116
hipFileOpCounter_t batch_total_submit_ops
Total batch submit operation counters (zero-filled)
Definition hipfile.h:1138
hipFileOpCounter_t batch_enqueued_ops
Batch enqueue operation counters (zero-filled)
Definition hipfile.h:1129
hipFileError_t hipFileGetStatsL3(hipFileStatsLevel3_t *stats)
Get Level 3 hipFile statistics.
hipFileOpCounter_t batch_complete_ops
Batch complete operation counters (zero-filled)
Definition hipfile.h:1125
hipFileOpCounter_t batch_mixed_io_submit_ops
Mixed IO batch submit operation counters (zero-filled)
Definition hipfile.h:1137
uint64_t batch_completion_lat_sum_us
Sum of batch completion latencies (zero-filled)
Definition hipfile.h:1149
hipFileOpCounter_t batch_cancel_ops
Batch cancel operation counters (zero-filled)
Definition hipfile.h:1127
hipFileOpCounter_t batch_setup_ops
Batch setup operation counters (zero-filled)
Definition hipfile.h:1126
Counter tracking successful and failed occurrences of an operation.
Definition hipfile.h:1091
Level 2 statistics: includes Level 1 plus I/O size histograms.
Definition hipfile.h:1161
Level 3 statistics: includes Level 2 plus per-GPU statistics.
Definition hipfile.h:1220
Generated by