VART-X  0.3.0
vart_plkernel_impl_base.hpp
Go to the documentation of this file.
1 /*
2  * Copyright 2024-2026 Advanced Micro Devices Inc.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 #pragma once
18 
19 #include <any>
20 #include <memory>
21 #include <string>
22 #include <vector>
23 #include "../vart_device.hpp"
24 #include "../vart_plkernel_types.hpp"
25 
28 namespace vart {
29 
37  public:
39  PLKernelImplBase() = default;
40 
42  virtual ~PLKernelImplBase() {}
43 
56  virtual void process(const std::vector<std::any>& args) = 0;
57 
68  virtual int wait(unsigned int timeout) = 0;
69 
83  virtual void set_config_impl(const std::any& info) = 0;
84 
94  virtual void get_config_impl(std::any& info) = 0;
95 
104  template <typename PLKernelAnyInfo>
105  void set_config(PLKernelAnyInfo& info) {
106  set_config_impl(info);
107  }
108 
117  template <typename PLKernelAnyInfo>
118  void get_config(PLKernelAnyInfo& info) {
119  get_config_impl(info);
120  }
121 };
122 
123 } /* namespace vart */
Abstract interface for PLKernel implementation used by PLKernel.
Definition: vart_plkernel_impl_base.hpp:36
void set_config(PLKernelAnyInfo &info)
set_config() - Sets the configuration for the kernel.
Definition: vart_plkernel_impl_base.hpp:105
virtual int wait(unsigned int timeout)=0
wait() - Waits for the kernel to complete processing.
virtual void process(const std::vector< std::any > &args)=0
process() - Set and process the given arguments on Kernel.
virtual void set_config_impl(const std::any &info)=0
set_config_impl() - Set configuration using a non-template virtual function.
PLKernelImplBase()=default
Default constructor.
virtual ~PLKernelImplBase()
Virtual destructor to ensure proper cleanup of derived implementations.
Definition: vart_plkernel_impl_base.hpp:42
void get_config(PLKernelAnyInfo &info)
get_config() - Gets the configuration of the kernel.
Definition: vart_plkernel_impl_base.hpp:118
virtual void get_config_impl(std::any &info)=0
get_config_impl() - Gets configuration using a non-template virtual function.
VART (Vitis AI Runtime) public API namespace.