tree: b7a62a4f00f6789eeb966e49f318e165d8dcb6c7 [path history] [tgz]
  1. README.md
  2. vulkan.cc
  3. vulkan_common.h
  4. vulkan_module.h
  5. vulkan_shader.h
  6. vulkan_stream.h
src/runtime/vulkan/README.md

Components

VulkanDeviceAPI

Implements the TVM DeviceAPI interface. Owns the core Vulkan datastructures. Is responsible for initializing the Vulkan instance and devices, querying for possible extensions.

VulkanThreadEntry

Thread-local state for the Vulkan runtime. Maintains a staging buffer (for copies), and a VulkanStream per device.

VulkanWrappedFunc

Responsible for launching computation kernels. Responsible for obtaining a VulkanPipeline instance (from the VulkanModuleNode), and launches the kernel (via immediate or deferred mode) on the active VulkanStream instance.

Stream execution in the Vulkan programming model.

The natural model for TVM DeviceAPI implementation and runtime follows the CUDA API model. That is, we launch “kernels” onto a (implicit or explicit) “stream” (which execute asynchronously with respect to the host, but ordered with respect to the stream), and explicitly synchronize the stream with respect to the host. We simulate this behaviour in the Vulkan model by maintaining a thread-local vkCommandBuffer instance, and queueing up (or eagerly executing, depending on the availability of the VK_KHR_push_descriptor extension). When we synchronize the stream, we end the command buffer recording, submit it to the device queue, and wait on the corresponding fence.