Graphics Interoperability#
Collaboration diagram for Graphics Interoperability:
| Functions | |
| hipError_t | hipGraphicsMapResources (int count, hipGraphicsResource_t *resources, hipStream_t stream) | 
| Maps a graphics resource for access.  More... | |
| hipError_t | hipGraphicsSubResourceGetMappedArray (hipArray_t *array, hipGraphicsResource_t resource, unsigned int arrayIndex, unsigned int mipLevel) | 
| Get an array through which to access a subresource of a mapped graphics resource.  More... | |
| hipError_t | hipGraphicsResourceGetMappedPointer (void **devPtr, size_t *size, hipGraphicsResource_t resource) | 
| Gets device accessible address of a graphics resource.  More... | |
| hipError_t | hipGraphicsUnmapResources (int count, hipGraphicsResource_t *resources, hipStream_t stream) | 
| Unmaps graphics resources.  More... | |
| hipError_t | hipGraphicsUnregisterResource (hipGraphicsResource_t resource) | 
| Unregisters a graphics resource.  More... | |
Detailed Description
This section describes graphics interoperability functions of HIP runtime API.
Function Documentation
◆ hipGraphicsMapResources()
| hipError_t hipGraphicsMapResources | ( | int | count, | 
| hipGraphicsResource_t * | resources, | ||
| hipStream_t | stream | ||
| ) | 
Maps a graphics resource for access.
- Parameters
- 
  [in] count - Number of resources to map. [in] resources - Pointer of resources to map. [in] stream - Stream for synchronization. 
◆ hipGraphicsResourceGetMappedPointer()
| hipError_t hipGraphicsResourceGetMappedPointer | ( | void ** | devPtr, | 
| size_t * | size, | ||
| hipGraphicsResource_t | resource | ||
| ) | 
Gets device accessible address of a graphics resource.
- Parameters
- 
  [out] devPtr - Pointer of device through which graphic resource may be accessed. [out] size - Size of the buffer accessible from devPtr. [in] resource - Mapped resource to access. 
- Returns
- hipSuccess, hipErrorInvalidValue
◆ hipGraphicsSubResourceGetMappedArray()
| hipError_t hipGraphicsSubResourceGetMappedArray | ( | hipArray_t * | array, | 
| hipGraphicsResource_t | resource, | ||
| unsigned int | arrayIndex, | ||
| unsigned int | mipLevel | ||
| ) | 
Get an array through which to access a subresource of a mapped graphics resource.
- Parameters
- 
  [out] array - Pointer of array through which a subresource of resource may be accessed. [in] resource - Mapped resource to access. [in] arrayIndex - Array index for the subresource to access. [in] mipLevel - Mipmap level for the subresource to access. 
- Returns
- hipSuccess, hipErrorInvalidValue
- Note
- In this API, the value of arrayIndex higher than zero is currently not supported.
◆ hipGraphicsUnmapResources()
| hipError_t hipGraphicsUnmapResources | ( | int | count, | 
| hipGraphicsResource_t * | resources, | ||
| hipStream_t | stream | ||
| ) | 
Unmaps graphics resources.
- Parameters
- 
  [in] count - Number of resources to unmap. [in] resources - Pointer of resources to unmap. [in] stream - Stream for synchronization. 
◆ hipGraphicsUnregisterResource()
| hipError_t hipGraphicsUnregisterResource | ( | hipGraphicsResource_t | resource | ) | 
Unregisters a graphics resource.
- Parameters
- 
  [in] resource - Graphics resources to unregister. 
- Returns
- hipSuccess