SWDEV-245532 - HIP - Vulkan interop semaphores

Change-Id: Ib79328ce4ec2f8ac3aade59fde4fd30e2d6e5cba


[ROCm/clr commit: 582d12b32f]
This commit is contained in:
pghafari
2021-04-22 19:24:30 -04:00
committed by Payam Ghafari
parent 8c157207c7
commit dbb9c74540
8 changed files with 91 additions and 0 deletions
+25
View File
@@ -956,6 +956,31 @@ class NativeFnCommand : public Command {
int32_t invoke();
};
class ExternalSemaphoreCmd : public Command {
public:
enum ExternalSemaphoreCmdType { COMMAND_WAIT_EXTSEMAPHORE, COMMAND_SIGNAL_EXTSEMAPHORE };
private:
const void* sem_ptr_; //!< Pointer to external semaphore
int fence_; //!< semaphore value to be set
ExternalSemaphoreCmdType cmd_type_; //!< Signal or Wait semaphore command
public:
ExternalSemaphoreCmd(HostQueue& queue, const void* sem_ptr, int fence,
ExternalSemaphoreCmdType cmd_type)
: Command::Command(queue, CL_COMMAND_USER), sem_ptr_(sem_ptr), fence_(fence), cmd_type_(cmd_type) {}
virtual void submit(device::VirtualDevice& device) {
device.submitExternalSemaphoreCmd(*this);
}
const void* sem_ptr() const { return sem_ptr_; }
const int fence() { return fence_; }
const ExternalSemaphoreCmdType semaphoreCmd() { return cmd_type_; }
};
class Marker : public Command {
public:
//! Create a new Marker