Adding iree_io_file_handle_t placeholder. (#15101)
This replaces iree_hal_external_file_t for iree_hal_file_t interop and
will be used to replace existing file handle usage in the runtime. For
now it only supports memory files (in line with what iree_hal_file_t
supports) but it'll grow to support fd/FILE/HANDLE/etc in the future.
Also fixing some warnings/nits found during debugging/building on MSVC.
Progress on #14987.
diff --git a/experimental/cuda2/cuda_device.c b/experimental/cuda2/cuda_device.c
index 370b693..660fa1f 100644
--- a/experimental/cuda2/cuda_device.c
+++ b/experimental/cuda2/cuda_device.c
@@ -558,18 +558,16 @@
static iree_status_t iree_hal_cuda2_device_import_file(
iree_hal_device_t* base_device, iree_hal_queue_affinity_t queue_affinity,
- iree_hal_memory_access_t access,
- iree_hal_external_file_t* IREE_RESTRICT external_file,
- iree_hal_file_release_callback_t release_callback,
- iree_hal_file_t** out_file) {
- if (external_file->type != IREE_HAL_EXTERNAL_FILE_TYPE_HOST_ALLOCATION) {
+ iree_hal_memory_access_t access, iree_io_file_handle_t* handle,
+ iree_hal_external_file_flags_t flags, iree_hal_file_t** out_file) {
+ if (iree_io_file_handle_type(handle) !=
+ IREE_IO_FILE_HANDLE_TYPE_HOST_ALLOCATION) {
return iree_make_status(
IREE_STATUS_UNAVAILABLE,
"implementation does not support the external file type");
}
return iree_hal_memory_file_wrap(
- queue_affinity, access, external_file->handle.host_allocation,
- release_callback, iree_hal_device_allocator(base_device),
+ queue_affinity, access, handle, iree_hal_device_allocator(base_device),
iree_hal_device_host_allocator(base_device), out_file);
}