Functions for Host-Target Data Read/Write

Writes data from host to target, or reads data from target to host. This topic only applies to Intel® 64 and IA-32 architectures targeting Intel® Graphics Technology.


C++ Interface

int GfxImage2D::read();

int GfxImage2D::write();

int GfxSharedImage2D::read();

int GfxSharedImage2D::write();

C Interface

int _GFX_read_image_2d(GfxResourceHandle handle);

int _GFX_write_image_2d(GfxResourceHandle handle);



A handle to the internal image object returned by _GFX_create_image_2d.


These functions write image data from the host to the target, or read image data from the target to the host. They do nothing for shared 2D images.

For convenience and to enable similar usage patterns for shared and target images, creation of the internal image object for a target image also copies data from the host to the target, while destruction of the internal image object for target images copies data back from the target to the host, if it is not yet copied. This copy is safe because the destruction of an image object is possible only if the runtime shows that no offload task is using that image.

Return Values


The function succeeded.

A non-zero error code

An error has occurred. Use the function _GFX_get_last_error() to get the specific error code. Additonally, gfx_rt.h defines various error status values.

For more complete information about compiler optimizations, see our Optimization Notice.