In order to export buffers the IREE_HAL_BUFFER_USAGE_SHARING_EXPORT bit must be set upon allocation. For CPU interop the IREE_HAL_BUFFER_USAGE_MAPPING_PERSISTENT bit is required as well. The compiler needs to ensure that any allocations it requests have these bits when they are used on multiple devices that either need export or mapping. TargetDevice will need to provide a query for the required support but doing so in a decentralized way is still an open design question. The initial version will always return that the mapping bit is required when any device other than itself is requesting usage of the buffer. Future refinement can have devices agree on compatibility based on supported import/export or transparent usage paths.
In order to export buffers the
IREE_HAL_BUFFER_USAGE_SHARING_EXPORTbit must be set upon allocation. For CPU interop theIREE_HAL_BUFFER_USAGE_MAPPING_PERSISTENTbit is required as well. The compiler needs to ensure that any allocations it requests have these bits when they are used on multiple devices that either need export or mapping.TargetDevicewill need to provide a query for the required support but doing so in a decentralized way is still an open design question. The initial version will always return that the mapping bit is required when any device other than itself is requesting usage of the buffer. Future refinement can have devices agree on compatibility based on supported import/export or transparent usage paths.