rocprofiler-sdk/hipfile/details/hipfile.h File Reference

rocprofiler-sdk/hipfile/details/hipfile.h File Reference#

ROCprofiler-SDK developer API: rocprofiler-sdk/hipfile/details/hipfile.h File Reference
ROCprofiler-SDK developer API 1.3.5
ROCm Profiling API and tools
hipfile.h File Reference
#include <hip/hip_runtime_api.h>
#include <stdbool.h>
#include <stdint.h>
#include <stdlib.h>
#include <sys/types.h>
#include <sys/socket.h>
+ Include dependency graph for hipfile.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  hipFileError_t
 Error status returned from hipFile API calls. More...
 
struct  hipFileDriverProps_t
 GPU IO configuration. More...
 
struct  hipFileRDMAInfo_t
 Userspace RDMA configuration. More...
 
struct  hipFileFSOps_t
 IO operations for RDMA filesystems. More...
 
struct  hipFileDescr_t
 Top-level structure for performing GPU IO. More...
 
struct  hipFileIOParams_t
 Input parameters for a batch IO request. More...
 
struct  hipFileIOEvents_t
 Status of a batch IO operation. More...
 
struct  hipFileDriverProps_t.nvfs
 GPU IO Driver Configuration. More...
 

Macros

#define HIPFILE_API
 
#define HIPFILE_VERSION_MAJOR   0
 hipFile major version number
 
#define HIPFILE_VERSION_MINOR   3
 hipFile minor version number
 
#define HIPFILE_VERSION_PATCH   0
 hipFile patch version number
 
#define HIPFILE_BASE_ERR   5000
 The base value for hipFile error codes.
 
#define __HIPFILE_NODISCARD
 
#define IS_HIPFILE_ERR(hip_op_err)
 Determine if an error code is a hipFile error.
 
#define HIPFILE_ERRSTR(hip_op_err)
 Get an error string for a hipFile error.
 
#define IS_HIP_DRV_ERR(hip_err)
 Determine if an error is a hipFile driver error.
 
#define HIP_DRV_ERR(hip_err)
 Get the driver error from a hipFileError_t.
 
#define HIPFILE_RDMA_REGISTER   1
 Flag for if the RDMA operation is registered.
 
#define HIPFILE_RDMA_RELAXED_ORDERING   (1 << 1)
 Flag for if the RDMA operation has relaxed ordering.
 
#define HIPFILE_STREAM_FIXED_BUF_OFFSET   1
 Buffer offset is fixed at time of submission.
 
#define HIPFILE_STREAM_FIXED_FILE_OFFSET   (1 << 1)
 File offset is fixed at time of submission.
 
#define HIPFILE_STREAM_FIXED_FILE_SIZE   (1 << 2)
 File size is fixed at time of submission.
 
#define HIPFILE_STREAM_PAGE_ALIGNED_INPUTS   (1 << 3)
 Offsets and size are 4k aligned.
 
#define HIPFILE_STREAM_FLAGS_MASK   0xf
 Mask for selecting flag bits.
 

Typedefs

typedef off_t hoff_t
 Platform-independent offset type.
 
typedef void * hipFileHandle_t
 Opaque file handle used by the GPU IO driver/library.
 
typedef void * hipFileBatchHandle_t
 Opaque batch operations handle.
 

Enumerations

enum  hipFileOpError_t {
  hipFileSuccess = 0 ,
  hipFileDriverNotInitialized = 5000 + 1 ,
  hipFileDriverInvalidProps = 5000 + 2 ,
  hipFileDriverUnsupportedLimit = 5000 + 3 ,
  hipFileDriverVersionMismatch = 5000 + 4 ,
  hipFileDriverVersionReadError = 5000 + 5 ,
  hipFileDriverClosing = 5000 + 6 ,
  hipFilePlatformNotSupported = 5000 + 7 ,
  hipFileIONotSupported = 5000 + 8 ,
  hipFileDeviceNotSupported = 5000 + 9 ,
  hipFileDriverError = 5000 + 10 ,
  hipFileHipDriverError = 5000 + 11 ,
  hipFileHipPointerInvalid = 5000 + 12 ,
  hipFileHipMemoryTypeInvalid = 5000 + 13 ,
  hipFileHipPointerRangeError = 5000 + 14 ,
  hipFileHipContextMismatch = 5000 + 15 ,
  hipFileInvalidMappingSize = 5000 + 16 ,
  hipFileInvalidMappingRange = 5000 + 17 ,
  hipFileInvalidFileType = 5000 + 18 ,
  hipFileInvalidFileOpenFlag = 5000 + 19 ,
  hipFileDIONotSet = 5000 + 20 ,
  hipFileInvalidValue = 5000 + 22 ,
  hipFileMemoryAlreadyRegistered = 5000 + 23 ,
  hipFileMemoryNotRegistered = 5000 + 24 ,
  hipFilePermissionDenied = 5000 + 25 ,
  hipFileDriverAlreadyOpen = 5000 + 26 ,
  hipFileHandleNotRegistered = 5000 + 27 ,
  hipFileHandleAlreadyRegistered = 5000 + 28 ,
  hipFileDeviceNotFound = 5000 + 29 ,
  hipFileInternalError = 5000 + 30 ,
  hipFileGetNewFDFailed = 5000 + 31 ,
  hipFileDriverSetupError = 5000 + 33 ,
  hipFileIODisabled = 5000 + 34 ,
  hipFileBatchSubmitFailed = 5000 + 35 ,
  hipFileGPUMemoryPinningFailed = 5000 + 36 ,
  hipFileBatchFull = 5000 + 37 ,
  hipFileAsyncNotSupported = 5000 + 38 ,
  hipFileIOMaxError = 5000 + 39
}
 hipFile function return codes More...
 
enum  hipFileDriverStatusFlags_t {
  hipFileLustreSupported = 0 ,
  hipFileWekaFSSupported = 1 ,
  hipFileNFSSupported = 2 ,
  hipFileGPFSSupported = 3 ,
  hipFileNVMeSupported = 4 ,
  hipFileNVMeoFSupported = 5 ,
  hipFileSCSISupported = 6 ,
  hipFileScaleFluxCSDSupported = 7 ,
  hipFileNVMeshSupported = 8 ,
  hipFileBeeGFSSupported = 9 ,
  hipFileNVMeP2PSupported = 11 ,
  hipFileScatefsSupported = 12
}
 Filesystems/storage protocols supported by GPU IO on this system. More...
 
enum  hipFileDriverControlFlags_t {
  hipFileUsePollMode = 0 ,
  hipFileAllowCompatMode = 1
}
 Control flags for passing to the GPU IO driver. More...
 
enum  hipFileFeatureFlags_t {
  hipFileDynRoutingSupported = 0 ,
  hipFileBatchIOSupported = 1 ,
  hipFileStreamsSupported = 2 ,
  hipFileParallelIOSupported = 3
}
 GPU IO Transport & Features supported by the system. More...
 
enum  hipFileFileHandleType_t {
  hipFileHandleTypeOpaqueFD = 1 ,
  hipFileHandleTypeOpaqueWin32 = 2 ,
  hipFileHandleTypeUserspaceFS = 3
}
 Type of file handle being used. More...
 
enum  hipFileOpcode_t {
  hipFileBatchRead = 0 ,
  hipFileBatchWrite = 1
}
 The direction of data movement in a batch IO request. More...
 
enum  hipFileStatus_t {
  hipFileWaiting = 1 << 0 ,
  hipFilePending = 1 << 1 ,
  hipFileInvalid = 1 << 2 ,
  hipFileCanceled = 1 << 3 ,
  hipFileComplete = 1 << 4 ,
  hipFileTimeout = 1 << 5 ,
  hipFileFailed = 1 << 6
}
 The status of a batch IO operation. More...
 
enum  hipFileBatchMode_t { hipFileBatch = 1 }
 Mode of a batch IO operation. More...
 
enum  hipFileSizeTConfigParameter_t {
  hipFileParamProfileStats ,
  hipFileParamExecutionMaxIOQueueDepth ,
  hipFileParamExecutionMaxIOThreads ,
  hipFileParamExecutionMinIOThresholdSizeKB ,
  hipFileParamExecutionMaxRequestParallelism ,
  hipFileParamPropertiesMaxDirectIOSizeKB ,
  hipFileParamPropertiesMaxDeviceCacheSizeKB ,
  hipFileParamPropertiesPerBufferCacheSizeKB ,
  hipFileParamPropertiesMaxDevicePinnedMemSizeKB ,
  hipFileParamPropertiesIOBatchsize ,
  hipFileParamPollthresholdSizeKB ,
  hipFileParamPropertiesBatchIOTimeoutMs
}
 size_t configuration parameters More...
 
enum  hipFileBoolConfigParameter_t {
  hipFileParamPropertiesUsePollMode ,
  hipFileParamPropertiesAllowCompatMode ,
  hipFileParamForceCompatMode ,
  hipFileParamFsMiscApiCheckAggressive ,
  hipFileParamExecutionParallelIO ,
  hipFileParamProfileNvtx ,
  hipFileParamPropertiesAllowSystemMemory ,
  hipFileParamUsePcip2pdma ,
  hipFileParamPreferIOUring ,
  hipFileParamForceOdirectMode ,
  hipFileParamSkipTopologyDetection ,
  hipFileParamStreamMemopsBypass
}
 Boolean configuration parameters. More...
 
enum  hipFileStringConfigParameter_t {
  hipFileParamLoggingLevel ,
  hipFileParamEnvLogfilePath ,
  hipFileParamLogDir
}
 String configuration parameters. More...
 

Functions

const char * hipFileGetOpErrorString (hipFileOpError_t status)
 Return a descriptive string for a hipFile error.
 
hipFileError_t hipFileHandleRegister (hipFileHandle_t *fh, hipFileDescr_t *descr)
 Registers an open file for 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 hipFileBufDeregister (const void *buffer_base)
 Deregisters a GPU memory region from being used with 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.
 
hipFileError_t hipFileDriverOpen (void)
 Initialize the GPU IO driver for this process.
 
hipFileError_t hipFileDriverClose (void)
 Close the GPU IO driver for this process.
 
int64_t hipFileUseCount (void)
 Obtain the current reference count for the library.
 
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 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.
 
hipFileError_t hipFileBatchIOSetUp (hipFileBatchHandle_t *batch_idp, unsigned max_nr)
 Prepare the system to perform a batch IO operation.
 
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.
 
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 hipFileBatchIOCancel (hipFileBatchHandle_t batch_idp)
 Cancels all pending batch IO operations.
 
void hipFileBatchIODestroy (hipFileBatchHandle_t batch_idp)
 Destroys the batch IO handle and frees 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.
 
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 hipFileGetVersion (unsigned *major, unsigned *minor, unsigned *patch)
 Get the version of the hipFile library.
 
hipFileError_t hipFileGetParameterSizeT (hipFileSizeTConfigParameter_t param, unsigned long *value)
 Get the value of a size_t configuration parameter.
 
hipFileError_t hipFileGetParameterBool (hipFileBoolConfigParameter_t param, bool *value)
 Get the value of a Boolean configuration parameter.
 
hipFileError_t hipFileGetParameterString (hipFileStringConfigParameter_t param, char *desc_str, int len)
 Get the value of a string configuration parameter.
 
hipFileError_t hipFileSetParameterSizeT (hipFileSizeTConfigParameter_t param, unsigned long value)
 Set the value of a size_t configuration parameter.
 
hipFileError_t hipFileSetParameterBool (hipFileBoolConfigParameter_t param, bool value)
 Set the value of a Boolean configuration parameter.
 
hipFileError_t hipFileSetParameterString (hipFileStringConfigParameter_t param, const char *desc_str)
 Set the value of a string configuration parameter.
 

Macro Definition Documentation

◆ __HIPFILE_NODISCARD

#define __HIPFILE_NODISCARD

Definition at line 197 of file hipfile.h.

◆ HIPFILE_API

#define HIPFILE_API

Definition at line 26 of file hipfile.h.