SWDEV-245532 - HIP - Vulkan interop semaphores

Change-Id: I89be5ee84d4728d76e1987d5016c944c0dbc9a96


[ROCm/hip commit: 86a5e82a4b]
Αυτή η υποβολή περιλαμβάνεται σε:
pghafari
2021-04-22 20:21:01 -04:00
υποβλήθηκε από Payam Ghafari
γονέας 68fdcc833b
υποβολή 8de2b45056
4 αρχεία άλλαξαν με 226 προσθήκες και 0 διαγραφές
@@ -365,6 +365,64 @@ typedef struct hipExternalMemoryBufferDesc_st {
typedef void* hipExternalMemory_t;
typedef enum hipExternalSemaphoreHandleType_enum {
hipExternalSemaphoreHandleTypeOpaqueFd = 1,
hipExternalSemaphoreHandleTypeOpaqueWin32 = 2,
hipExternalSemaphoreHandleTypeOpaqueWin32Kmt = 3,
hipExternalSemaphoreHandleTypeD3D12Fence = 4
} hipExternalSemaphoreHandleType;
typedef struct hipExternalSemaphoreHandleDesc_st {
hipExternalSemaphoreHandleType type;
union {
int fd;
struct {
void* handle;
const void* name;
} win32;
} handle;
unsigned int flags;
} hipExternalSemaphoreHandleDesc;
typedef void* hipExternalSemaphore_t;
typedef struct hipExternalSemaphoreSignalParams_st {
struct {
struct {
unsigned long long value;
} fence;
struct {
unsigned long long key;
} keyedMutex;
unsigned int reserved[12];
} params;
unsigned int flags;
unsigned int reserved[16];
} hipExternalSemaphoreSignalParams;
/**
* External semaphore wait parameters, compatible with driver type
*/
typedef struct hipExternalSemaphoreWaitParams_st {
struct {
struct {
unsigned long long value;
} fence;
struct {
unsigned long long key;
unsigned int timeoutMs;
} keyedMutex;
unsigned int reserved[10];
} params;
unsigned int flags;
unsigned int reserved[16];
} hipExternalSemaphoreWaitParams;
#if __HIP_HAS_GET_PCH
/**
* Internal use only. This API may change in the future
@@ -1587,6 +1645,74 @@ hipError_t hipEventQuery(hipEvent_t event);
*/
hipError_t hipPointerGetAttributes(hipPointerAttribute_t* attributes, const void* ptr);
/**
* @brief Imports an external semaphore.
*
* @param[out] extSem_out External semaphores to be waited on
* @param[in] semHandleDesc Semaphore import handle descriptor
*
* @return #hipSuccess, #hipErrorInvalidDevice, #hipErrorInvalidValue
*
* @see
*/
hipError_t hipImportExternalSemaphore(hipExternalSemaphore_t* extSem_out,
const hipExternalSemaphoreHandleDesc* semHandleDesc);
/**
* @brief Signals a set of external semaphore objects.
*
* @param[in] extSem_out External semaphores to be waited on
* @param[in] paramsArray Array of semaphore parameters
* @param[in] numExtSems Number of semaphores to wait on
* @param[in] stream Stream to enqueue the wait operations in
*
* @return #hipSuccess, #hipErrorInvalidDevice, #hipErrorInvalidValue
*
* @see
*/
hipError_t hipSignalExternalSemaphoresAsync(const hipExternalSemaphore_t* extSemArray,
const hipExternalSemaphoreSignalParams* paramsArray,
unsigned int numExtSems, hipStream_t stream);
/**
* @brief Waits on a set of external semaphore objects
*
* @param[in] extSem_out External semaphores to be waited on
* @param[in] paramsArray Array of semaphore parameters
* @param[in] numExtSems Number of semaphores to wait on
* @param[in] stream Stream to enqueue the wait operations in
*
* @return #hipSuccess, #hipErrorInvalidDevice, #hipErrorInvalidValue
*
* @see
*/
hipError_t hipWaitExternalSemaphoresAsync(const hipExternalSemaphore_t* extSemArray,
const hipExternalSemaphoreWaitParams* paramsArray,
unsigned int numExtSems, hipStream_t stream);
/**
* @brief Destroys an external semaphore object and releases any references to the underlying resource. Any outstanding signals or waits must have completed before the semaphore is destroyed.
*
* @param[in] extSem handle to an external memory object
*
* @return #hipSuccess, #hipErrorInvalidDevice, #hipErrorInvalidValue
*
* @see
*/
hipError_t hipDestroyExternalSemaphore(hipExternalSemaphore_t extSem);
/**
* @brief Imports an external memory object.
*