18 #include <sys/types.h>
20 #include <kvikio/shim/cuda_h_wrapper.hpp>
29 #ifdef KVIKIO_CUFILE_FOUND
36 using CUfileHandle_t =
void*;
37 using CUfileOpError = int;
38 #define CUFILE_ERRSTR(x) ("KvikIO not compiled with cuFile.h")
39 #define CUFILEOP_BASE_ERR 5000
40 #define CU_FILE_SUCCESS 0
41 #define CU_FILE_CUDA_DRIVER_ERROR 1
48 using CUfileDriverControlFlags_t =
enum CUfileDriverControlFlags {
49 CU_FILE_USE_POLL_MODE = 0,
50 CU_FILE_ALLOW_COMPAT_MODE = 1
53 enum CUfileFileHandleType { CU_FILE_HANDLE_TYPE_OPAQUE_FD = 1 };
56 enum CUfileFileHandleType type;
62 static inline const char* cufileop_status_error(CUfileOpError err) {
return CUFILE_ERRSTR(err); };
65 ssize_t cuFileRead(...);
66 ssize_t cuFileWrite(...);
82 #ifndef KVIKIO_CUFILE_BATCH_API_FOUND
83 typedef enum CUfileOpcode { CUFILE_READ = 0, CUFILE_WRITE } CUfileOpcode_t;
85 typedef enum CUFILEStatus_enum {
86 CUFILE_WAITING = 0x000001,
87 CUFILE_PENDING = 0x000002,
88 CUFILE_INVALID = 0x000004,
89 CUFILE_CANCELED = 0x000008,
90 CUFILE_COMPLETE = 0x0000010,
91 CUFILE_TIMEOUT = 0x0000020,
92 CUFILE_FAILED = 0x0000040
97 CUfileStatus_t status;
109 #ifndef KVIKIO_CUFILE_STREAM_API_FOUND