MLIR
21.0.0git
|
Vulkan runtime. More...
#include "ExecutionEngine/VulkanRuntime.h"
Public Member Functions | |
VulkanRuntime ()=default | |
VulkanRuntime (const VulkanRuntime &)=delete | |
VulkanRuntime & | operator= (const VulkanRuntime &)=delete |
void | setResourceData (const ResourceData &resData) |
Sets needed data for Vulkan runtime. More... | |
void | setResourceData (const DescriptorSetIndex desIndex, const BindingIndex bindIndex, const VulkanHostMemoryBuffer &hostMemBuffer) |
void | setShaderModule (uint8_t *shader, uint32_t size) |
void | setNumWorkGroups (const NumWorkGroups &numberWorkGroups) |
void | setResourceStorageClassBindingMap (const ResourceStorageClassBindingMap &stClassData) |
void | setEntryPoint (const char *entryPointName) |
LogicalResult | initRuntime () |
Runtime initialization. More... | |
LogicalResult | run () |
Runs runtime. More... | |
LogicalResult | updateHostMemoryBuffers () |
Updates host memory buffers. More... | |
LogicalResult | destroy () |
Destroys all created vulkan objects and resources. More... | |
Vulkan runtime.
The purpose of this class is to run SPIR-V compute shader on Vulkan device. Before the run, user must provide and set resource data with descriptors, SPIR-V shader, number of work groups and entry point. After the creation of VulkanRuntime, special methods must be called in the following sequence: initRuntime(), run(), updateHostMemoryBuffers(), destroy(); each method in the sequence returns success or failure depends on the Vulkan result code.
Definition at line 93 of file VulkanRuntime.h.
|
explicitdefault |
|
delete |
LogicalResult VulkanRuntime::destroy | ( | ) |
Destroys all created vulkan objects and resources.
Definition at line 121 of file VulkanRuntime.cpp.
References RETURN_ON_VULKAN_ERROR.
LogicalResult VulkanRuntime::initRuntime | ( | ) |
Runtime initialization.
Definition at line 106 of file VulkanRuntime.cpp.
|
delete |
LogicalResult VulkanRuntime::run | ( | ) |
void VulkanRuntime::setEntryPoint | ( | const char * | entryPointName | ) |
Definition at line 52 of file VulkanRuntime.cpp.
void VulkanRuntime::setNumWorkGroups | ( | const NumWorkGroups & | numberWorkGroups | ) |
Definition at line 35 of file VulkanRuntime.cpp.
void VulkanRuntime::setResourceData | ( | const DescriptorSetIndex | desIndex, |
const BindingIndex | bindIndex, | ||
const VulkanHostMemoryBuffer & | hostMemBuffer | ||
) |
Definition at line 44 of file VulkanRuntime.cpp.
References StorageBuffer.
void VulkanRuntime::setResourceData | ( | const ResourceData & | resData | ) |
Sets needed data for Vulkan runtime.
Definition at line 56 of file VulkanRuntime.cpp.
void VulkanRuntime::setResourceStorageClassBindingMap | ( | const ResourceStorageClassBindingMap & | stClassData | ) |
Definition at line 39 of file VulkanRuntime.cpp.
void VulkanRuntime::setShaderModule | ( | uint8_t * | shader, |
uint32_t | size | ||
) |
Definition at line 60 of file VulkanRuntime.cpp.
LogicalResult VulkanRuntime::updateHostMemoryBuffers | ( | ) |
Updates host memory buffers.
Definition at line 870 of file VulkanRuntime.cpp.
References RETURN_ON_VULKAN_ERROR.