@@ -312,11 +312,12 @@ IREE_API_EXPORT iree_status_t iree_hal_device_queue_dealloca(
312312 iree_hal_buffer_t * buffer );
313313
314314// Enqueues a single queue-ordered fill operation.
315+ // The |target_buffer| must be visible to the device queue performing the fill.
315316//
316317// WARNING: individual fills have a high overhead and batching should be
317318// performed by the caller instead of calling this multiple times. The
318319// iree_hal_create_transfer_command_buffer utility makes it easy to create
319- // batches of transfer operations (fill, copy, update ) and is only a few lines
320+ // batches of transfer operations (fill, update, copy ) and is only a few lines
320321// more code.
321322IREE_API_EXPORT iree_status_t iree_hal_device_queue_fill (
322323 iree_hal_device_t * device , iree_hal_queue_affinity_t queue_affinity ,
@@ -326,12 +327,36 @@ IREE_API_EXPORT iree_status_t iree_hal_device_queue_fill(
326327 iree_device_size_t length , const void * pattern ,
327328 iree_host_size_t pattern_length , iree_hal_fill_flags_t flags );
328329
330+ // Enqueues a single queue-ordered buffer update operation.
331+ // The provided |source_buffer| will be captured and need not remain live or
332+ // unchanged while the operation is queued. The |target_buffer| must be visible
333+ // to the device queue performing the update.
334+ //
335+ // Some implementations may have limits on the size of the update or may perform
336+ // poorly if the size is larger than an implementation-defined limit. Updates
337+ // should be kept as small and infrequent as possible.
338+ //
339+ // WARNING: individual copies have a high overhead and batching should be
340+ // performed by the caller instead of calling this multiple times. The
341+ // iree_hal_create_transfer_command_buffer utility makes it easy to create
342+ // batches of transfer operations (fill, update, copy) and is only a few lines
343+ // more code.
344+ IREE_API_EXPORT iree_status_t iree_hal_device_queue_update (
345+ iree_hal_device_t * device , iree_hal_queue_affinity_t queue_affinity ,
346+ const iree_hal_semaphore_list_t wait_semaphore_list ,
347+ const iree_hal_semaphore_list_t signal_semaphore_list ,
348+ const void * source_buffer , iree_host_size_t source_offset ,
349+ iree_hal_buffer_t * target_buffer , iree_device_size_t target_offset ,
350+ iree_device_size_t length , iree_hal_update_flags_t flags );
351+
329352// Enqueues a single queue-ordered copy operation.
353+ // The |source_buffer| and |target_buffer| must both be visible to the device
354+ // queue performing the copy.
330355//
331356// WARNING: individual copies have a high overhead and batching should be
332357// performed by the caller instead of calling this multiple times. The
333358// iree_hal_create_transfer_command_buffer utility makes it easy to create
334- // batches of transfer operations (fill, copy, update ) and is only a few lines
359+ // batches of transfer operations (fill, update, copy ) and is only a few lines
335360// more code.
336361IREE_API_EXPORT iree_status_t iree_hal_device_queue_copy (
337362 iree_hal_device_t * device , iree_hal_queue_affinity_t queue_affinity ,
@@ -578,6 +603,14 @@ typedef struct iree_hal_device_vtable_t {
578603 iree_device_size_t length , const void * pattern ,
579604 iree_host_size_t pattern_length , iree_hal_fill_flags_t flags );
580605
606+ iree_status_t (IREE_API_PTR * queue_update )(
607+ iree_hal_device_t * device , iree_hal_queue_affinity_t queue_affinity ,
608+ const iree_hal_semaphore_list_t wait_semaphore_list ,
609+ const iree_hal_semaphore_list_t signal_semaphore_list ,
610+ const void * source_buffer , iree_host_size_t source_offset ,
611+ iree_hal_buffer_t * target_buffer , iree_device_size_t target_offset ,
612+ iree_device_size_t length , iree_hal_update_flags_t flags );
613+
581614 iree_status_t (IREE_API_PTR * queue_copy )(
582615 iree_hal_device_t * device , iree_hal_queue_affinity_t queue_affinity ,
583616 const iree_hal_semaphore_list_t wait_semaphore_list ,
@@ -634,6 +667,14 @@ IREE_API_EXPORT iree_status_t iree_hal_device_queue_emulated_fill(
634667 iree_device_size_t length , const void * pattern ,
635668 iree_host_size_t pattern_length , iree_hal_fill_flags_t flags );
636669
670+ IREE_API_EXPORT iree_status_t iree_hal_device_queue_emulated_update (
671+ iree_hal_device_t * device , iree_hal_queue_affinity_t queue_affinity ,
672+ const iree_hal_semaphore_list_t wait_semaphore_list ,
673+ const iree_hal_semaphore_list_t signal_semaphore_list ,
674+ const void * source_buffer , iree_host_size_t source_offset ,
675+ iree_hal_buffer_t * target_buffer , iree_device_size_t target_offset ,
676+ iree_device_size_t length , iree_hal_update_flags_t flags );
677+
637678IREE_API_EXPORT iree_status_t iree_hal_device_queue_emulated_copy (
638679 iree_hal_device_t * device , iree_hal_queue_affinity_t queue_affinity ,
639680 const iree_hal_semaphore_list_t wait_semaphore_list ,
0 commit comments