@@ -2281,40 +2281,6 @@ cpdef buf_deregister(intptr_t buf_ptr_base):
22812281 check_status(__status__)
22822282
22832283
2284- cpdef read(intptr_t fh, intptr_t buf_ptr_base, size_t size, off_t file_offset, off_t buf_ptr_offset):
2285- """ read data from a registered file handle to a specified device or host memory.
2286-
2287- Args:
2288- fh (intptr_t): ``CUfileHandle_t`` opaque file handle.
2289- buf_ptr_base (intptr_t): base address of buffer in device or host memory.
2290- size (size_t): size bytes to read.
2291- file_offset (off_t): file-offset from begining of the file.
2292- buf_ptr_offset (off_t): offset relative to the buf_ptr_base pointer to read into.
2293-
2294- .. seealso:: `cuFileRead`
2295- """
2296- with nogil:
2297- __status__ = cuFileRead(< Handle> fh, < void * > buf_ptr_base, size, file_offset, buf_ptr_offset)
2298- check_status(__status__)
2299-
2300-
2301- cpdef write(intptr_t fh, intptr_t buf_ptr_base, size_t size, off_t file_offset, off_t buf_ptr_offset):
2302- """ write data from a specified device or host memory to a registered file handle.
2303-
2304- Args:
2305- fh (intptr_t): ``CUfileHandle_t`` opaque file handle.
2306- buf_ptr_base (intptr_t): base address of buffer in device or host memory.
2307- size (size_t): size bytes to write.
2308- file_offset (off_t): file-offset from begining of the file.
2309- buf_ptr_offset (off_t): offset relative to the buf_ptr_base pointer to write from.
2310-
2311- .. seealso:: `cuFileWrite`
2312- """
2313- with nogil:
2314- __status__ = cuFileWrite(< Handle> fh, < const void * > buf_ptr_base, size, file_offset, buf_ptr_offset)
2315- check_status(__status__)
2316-
2317-
23182284cpdef driver_open():
23192285 """ Initialize the cuFile library and open the nvidia-fs driver.
23202286
@@ -2689,3 +2655,29 @@ cpdef driver_close():
26892655 with nogil:
26902656 status = cuFileDriverClose_v2()
26912657 check_status(status)
2658+
2659+ cpdef read(intptr_t fh, intptr_t buf_ptr_base, size_t size, off_t file_offset, off_t buf_ptr_offset):
2660+ """ read data from a registered file handle to a specified device or host memory.
2661+ """
2662+ with nogil:
2663+ status = cuFileRead(< Handle> fh, < void * > buf_ptr_base, size, file_offset, buf_ptr_offset)
2664+ check_status(status)
2665+ return status
2666+
2667+
2668+ cpdef write(intptr_t fh, intptr_t buf_ptr_base, size_t size, off_t file_offset, off_t buf_ptr_offset):
2669+ """ write data from a specified device or host memory to a registered file handle.
2670+
2671+ Args:
2672+ fh (intptr_t): ``CUfileHandle_t`` opaque file handle.
2673+ buf_ptr_base (intptr_t): base address of buffer in device or host memory.
2674+ size (size_t): size bytes to write.
2675+ file_offset (off_t): file-offset from begining of the file.
2676+ buf_ptr_offset (off_t): offset relative to the buf_ptr_base pointer to write from.
2677+
2678+ .. seealso:: `cuFileWrite`
2679+ """
2680+ with nogil:
2681+ status = cuFileWrite(< Handle> fh, < const void * > buf_ptr_base, size, file_offset, buf_ptr_offset)
2682+ check_status(status)
2683+ return status
0 commit comments