VART-X  0.3.0
vart_device.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 
24 #include <memory>
25 #include <string>
26 
29 namespace vart {
33 class DeviceImplBase;
34 
42 class Device {
43  public:
72  static std::shared_ptr<Device> get_device_hdl(const int32_t dev_idx, const std::string& xclbin_loc);
73 
82  const std::shared_ptr<DeviceImplBase>& get_pimpl_handle() const;
83 
90  int32_t get_device_index() const;
91  Device() = delete;
92  ~Device() = default;
93 
94  private:
95  Device(std::shared_ptr<DeviceImplBase> pimpl_hdl);
96  std::shared_ptr<DeviceImplBase> pimpl;
97 };
98 
99 } // namespace vart
Manages the hardware context and loading of xclbin onto the device. Any module utilizing hardware acc...
Definition: vart_device.hpp:42
static std::shared_ptr< Device > get_device_hdl(const int32_t dev_idx, const std::string &xclbin_loc)
get_device_hdl() - Creates a Device() instance if not created earlier, else return an existing instan...
const std::shared_ptr< DeviceImplBase > & get_pimpl_handle() const
get_pimpl_handle() - Retrieves pointer to Device implementation Base class.
~Device()=default
int32_t get_device_index() const
get_device_index() - Retrieves device index of current instance.
Device()=delete
VART (Vitis AI Runtime) public API namespace.