8 #ifndef LLUVIA_CORE_SESSION_H_
9 #define LLUVIA_CORE_SESSION_H_
39 class ComputeNodeDescriptor;
41 class ContainerNodeDescriptor;
51 class Session :
public std::enable_shared_from_this<ll::Session> {
84 static std::shared_ptr<ll::Session>
create();
393 std::
string help(const std::
string& builderName) const;
405 static uint32_t findComputeFamilyQueueIndex(vk::PhysicalDevice& physicalDevice);
410 void initDescriptor();
416 std::shared_ptr<
ll::vulkan::Instance> m_instance;
417 std::shared_ptr<
ll::vulkan::Device> m_device;
421 std::map<std::
string, std::shared_ptr<
ll::
Program>> m_programRegistry;
423 std::shared_ptr<
ll::
Memory> m_hostMemory;
424 std::shared_ptr<
ll::
Memory> m_deviceMemory;
ImageDescriptor class and related enumerations.
MemoryPropertyFlags class.
NodeBuilderDescriptor class.
Class for command buffer.
Definition: CommandBuffer.h:63
Class for describing a compute node node.
Definition: ComputeNodeDescriptor.h:33
Class representing compute nodes.
Definition: ComputeNode.h:38
Class for describing a container node.
Definition: ContainerNodeDescriptor.h:25
Definition: ContainerNode.h:24
Definition: Duration.h:22
Stores all relevant information for creating ll::Image objects.
Definition: ImageDescriptor.h:189
Definition: Interpreter.h:34
Class to manage allocation of objects into a specific type of memory.
Definition: Memory.h:92
Class representing Vulkan shader modules in SPIR-V representation.
Definition: Program.h:37
Definition: SessionDescriptor.h:16
Class that contains all the state required to run compute operations on a compute device.
Definition: Session.h:51
std::string help(const std::string &builderName) const
Returns the help string of a given node builder.
const ll::DeviceDescriptor & getDeviceDescriptor() const noexcept
Gets the device descriptor associated to this session.
std::shared_ptr< ll::Program > createProgram(const std::string &spirvPath) const
Creates a program object reading a file at a given path.
std::shared_ptr< ll::Memory > getHostMemory() const noexcept
Returns a pointer to ll::Memory object that is HOST_LOCAL and HOST_COHERENT.
ll::ContainerNodeDescriptor createContainerNodeDescriptor(const std::string &builderName) const
ll::ComputeNodeDescriptor createComputeNodeDescriptor(const std::string &builderName) const
Creates a compute node descriptor given its builder name.
vk::PhysicalDeviceMemoryProperties getPhysicalDeviceMemoryProperties() const
Gets the Lua interpreter.
std::shared_ptr< ll::Memory > getDeviceMemory() const noexcept
Returns a pointer to ll::Memory object that is DEVICE_LOCAL.
std::vector< ll::NodeBuilderDescriptor > getNodeBuilderDescriptors() const
Gets the node builder descriptors currently registered.
static std::vector< vk::LayerProperties > getVulkanInstanceLayerProperties()
Gets the Vulkan instance layer properties available to this machine.
Session & operator=(const Session &session)=delete
std::shared_ptr< ll::ComputeNode > createComputeNode(const ll::ComputeNodeDescriptor &descriptor)
Creates a compute node.
static std::vector< vk::ExtensionProperties > getVulkanExtensionProperties()
Gets the Vulkan extension properties available to this machine.
bool hasReceivedVulkanWarningMessages() const noexcept
Tells whether or not this session has triggered Vulkan warning messages.
std::shared_ptr< ll::ContainerNode > createContainerNode(const ll::ContainerNodeDescriptor &descriptor)
static std::shared_ptr< ll::Session > create()
Creates a new ll::Session object.
std::shared_ptr< ll::Program > getProgram(const std::string &name) const
Gets a program given its name in the registry.
ll::vec3ui getGoodComputeLocalShape(ll::ComputeDimension dimensions) const noexcept
Returns the suggested local grid shape for compute nodes given the number of dimensions.
std::vector< ll::MemoryPropertyFlags > getSupportedMemoryFlags() const
Gets the supported memory flags.
Session & operator=(Session &&session)=delete
std::shared_ptr< ll::Memory > createMemory(const ll::MemoryPropertyFlags &flags, const uint64_t pageSize, bool exactFlagsMatch=false)
Creates a memory.
bool isImageDescriptorSupported(const ll::ImageDescriptor &descriptor) const noexcept
Determines if parameters in image descriptor are supported for image creation.
Session(Session &&session)=delete
void loadLibrary(const std::string &filename)
Loads a library made of SPIR-V shader code and Lua scripts.
void setProgram(const std::string &name, const std::shared_ptr< ll::Program > &program)
Sets a program with a given name into the registry.
static std::shared_ptr< ll::Session > create(const ll::SessionDescriptor &descriptor)
Creates a new ll::Session object.
void run(const ll::CommandBuffer &cmdBuffer)
Runs a ll::CommandBuffer.
Session(const Session &session)=delete
void script(const std::string &code)
Runs Lua script code into the session's internal interpreter.
static std::vector< ll::DeviceDescriptor > getAvailableDevices()
Gets the available devices.
std::unique_ptr< ll::Duration > createDuration() const
Creates a Duration object.
std::unique_ptr< ll::CommandBuffer > createCommandBuffer() const
Creates a command buffer.
void scriptFile(const std::string &filename)
Runs a Lua script file into the the session's internal interpreter.
ComputeDimension
Supported compute dimensions.
Definition: ComputeDimension.h:21
Definition: DeviceDescriptor.h:18
Describes the attributes of a node builder.
Definition: NodeBuilderDescriptor.h:20