public class CuFile extends Object
Using this wrapper requires GPUDirect Storage (GDS)/cuFile to be installed in the target environment, and the jar to be built with `USE_GDS=ON`. Otherwise it will throw an exception when loading.
The Java APIs are experimental and subject to change.
Constructor and Description |
---|
CuFile() |
Modifier and Type | Method and Description |
---|---|
static long |
appendDeviceBufferToFile(File path,
BaseDeviceMemoryBuffer buffer)
Append a device buffer to a given file path synchronously.
|
static long |
appendDeviceMemoryToFile(File path,
long address,
long length)
Append device memory to a given file path synchronously.
|
static boolean |
libraryLoaded()
Check if the libcufilejni library is loaded.
|
static void |
readFileToDeviceBuffer(BaseDeviceMemoryBuffer buffer,
File path,
long fileOffset)
Read a file into a device buffer synchronously.
|
static void |
readFileToDeviceMemory(long address,
long length,
File path,
long fileOffset)
Read a file into device memory synchronously.
|
static void |
writeDeviceBufferToFile(File path,
long file_offset,
BaseDeviceMemoryBuffer buffer)
Write a device buffer to a given file path synchronously.
|
static void |
writeDeviceMemoryToFile(File path,
long file_offset,
long address,
long length)
Write device memory to a given file path synchronously.
|
public static boolean libraryLoaded()
public static void writeDeviceBufferToFile(File path, long file_offset, BaseDeviceMemoryBuffer buffer)
This method is NOT thread safe if the path points to the same file on disk.
path
- The file path to copy to.file_offset
- The file offset from which to write the buffer.buffer
- The device buffer to copy from.public static void writeDeviceMemoryToFile(File path, long file_offset, long address, long length)
This method is NOT thread safe if the path points to the same file on disk.
path
- The file path to copy to.file_offset
- The file offset from which to write the buffer.address
- The device memory address to copy from.length
- The length to copy.public static long appendDeviceBufferToFile(File path, BaseDeviceMemoryBuffer buffer)
This method is NOT thread safe if the path points to the same file on disk.
path
- The file path to copy to.buffer
- The device buffer to copy from.public static long appendDeviceMemoryToFile(File path, long address, long length)
This method is NOT thread safe if the path points to the same file on disk.
path
- The file path to copy to.address
- The device memory address to copy from.length
- The length to copy.public static void readFileToDeviceBuffer(BaseDeviceMemoryBuffer buffer, File path, long fileOffset)
This method is NOT thread safe if the path points to the same file on disk.
buffer
- The device buffer to copy into.path
- The file path to copy from.fileOffset
- The file offset from which to copy the content.public static void readFileToDeviceMemory(long address, long length, File path, long fileOffset)
This method is NOT thread safe if the path points to the same file on disk.
address
- The device memory address to read into.length
- The length to read.path
- The file path to copy from.fileOffset
- The file offset from which to copy the content.Copyright © 2024. All rights reserved.