MLIR  21.0.0git
Public Member Functions | List of all members
VulkanRuntime Class Reference

Vulkan runtime. More...

#include "ExecutionEngine/VulkanRuntime.h"

Public Member Functions

 VulkanRuntime ()=default
 
 VulkanRuntime (const VulkanRuntime &)=delete
 
VulkanRuntimeoperator= (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...
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ VulkanRuntime() [1/2]

VulkanRuntime::VulkanRuntime ( )
explicitdefault

◆ VulkanRuntime() [2/2]

VulkanRuntime::VulkanRuntime ( const VulkanRuntime )
delete

Member Function Documentation

◆ destroy()

LogicalResult VulkanRuntime::destroy ( )

Destroys all created vulkan objects and resources.

Definition at line 121 of file VulkanRuntime.cpp.

References RETURN_ON_VULKAN_ERROR.

◆ initRuntime()

LogicalResult VulkanRuntime::initRuntime ( )

Runtime initialization.

Definition at line 106 of file VulkanRuntime.cpp.

◆ operator=()

VulkanRuntime& VulkanRuntime::operator= ( const VulkanRuntime )
delete

◆ run()

LogicalResult VulkanRuntime::run ( )

Runs runtime.

Definition at line 162 of file VulkanRuntime.cpp.

References RETURN_ON_VULKAN_ERROR.

◆ setEntryPoint()

void VulkanRuntime::setEntryPoint ( const char *  entryPointName)

Definition at line 52 of file VulkanRuntime.cpp.

◆ setNumWorkGroups()

void VulkanRuntime::setNumWorkGroups ( const NumWorkGroups numberWorkGroups)

Definition at line 35 of file VulkanRuntime.cpp.

◆ setResourceData() [1/2]

void VulkanRuntime::setResourceData ( const DescriptorSetIndex  desIndex,
const BindingIndex  bindIndex,
const VulkanHostMemoryBuffer hostMemBuffer 
)

Definition at line 44 of file VulkanRuntime.cpp.

References StorageBuffer.

◆ setResourceData() [2/2]

void VulkanRuntime::setResourceData ( const ResourceData resData)

Sets needed data for Vulkan runtime.

Definition at line 56 of file VulkanRuntime.cpp.

◆ setResourceStorageClassBindingMap()

void VulkanRuntime::setResourceStorageClassBindingMap ( const ResourceStorageClassBindingMap stClassData)

Definition at line 39 of file VulkanRuntime.cpp.

◆ setShaderModule()

void VulkanRuntime::setShaderModule ( uint8_t *  shader,
uint32_t  size 
)

Definition at line 60 of file VulkanRuntime.cpp.

◆ updateHostMemoryBuffers()

LogicalResult VulkanRuntime::updateHostMemoryBuffers ( )

Updates host memory buffers.

Definition at line 870 of file VulkanRuntime.cpp.

References RETURN_ON_VULKAN_ERROR.


The documentation for this class was generated from the following files: