VART-X  0.3.0
vart_device_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 
24 #include <cstdint>
25 
28 namespace vart {
29 
37  public:
39  DeviceImplBase() = delete;
40  DeviceImplBase(int32_t dev_idx) : device_index(dev_idx) {}
41 
43  virtual ~DeviceImplBase() {}
44 
51  virtual int32_t get_device_index() = 0;
52 
53  protected:
54  int32_t device_index;
55 };
56 
57 } // namespace vart
Abstract interface for device implementation used by Device.
Definition: vart_device_impl_base.hpp:36
int32_t device_index
Device index for this implementation.
Definition: vart_device_impl_base.hpp:54
DeviceImplBase(int32_t dev_idx)
Definition: vart_device_impl_base.hpp:40
virtual ~DeviceImplBase()
Virtual destructor to ensure proper cleanup of derived implementations.
Definition: vart_device_impl_base.hpp:43
virtual int32_t get_device_index()=0
get_device_index() - Retrieves device index of current instance
DeviceImplBase()=delete
Default construction is disabled.
VART (Vitis AI Runtime) public API namespace.