forked from openvinotoolkit/openvino
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Python API] bind ProfilingInfo (#55)
* bind ProfilingInfo * Add tests * Fix code style * Add property
- Loading branch information
Alexey Lebedev
authored
Nov 8, 2021
1 parent
a6e21e4
commit 9cebdc7
Showing
6 changed files
with
60 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
28 changes: 28 additions & 0 deletions
28
runtime/bindings/python/src/pyopenvino/core/profiling_info.cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
// Copyright (C) 2021 Intel Corporation | ||
// SPDX-License-Identifier: Apache-2.0 | ||
// | ||
|
||
#include "pyopenvino/core/profiling_info.hpp" | ||
|
||
#include <pybind11/chrono.h> | ||
|
||
#include "openvino/runtime/profiling_info.hpp" | ||
|
||
namespace py = pybind11; | ||
|
||
void regclass_ProfilingInfo(py::module m) { | ||
py::class_<ov::runtime::ProfilingInfo, std::shared_ptr<ov::runtime::ProfilingInfo>> cls(m, "ProfilingInfo"); | ||
cls.def(py::init<>()) | ||
.def_readwrite("status", &ov::runtime::ProfilingInfo::status) | ||
.def_readwrite("real_time", &ov::runtime::ProfilingInfo::real_time) | ||
.def_readwrite("cpu_time", &ov::runtime::ProfilingInfo::cpu_time) | ||
.def_readwrite("node_name", &ov::runtime::ProfilingInfo::node_name) | ||
.def_readwrite("exec_type", &ov::runtime::ProfilingInfo::exec_type) | ||
.def_readwrite("node_type", &ov::runtime::ProfilingInfo::node_type); | ||
|
||
py::enum_<ov::runtime::ProfilingInfo::Status>(cls, "Status") | ||
.value("NOT_RUN", ov::runtime::ProfilingInfo::Status::NOT_RUN) | ||
.value("OPTIMIZED_OUT", ov::runtime::ProfilingInfo::Status::OPTIMIZED_OUT) | ||
.value("EXECUTED", ov::runtime::ProfilingInfo::Status::EXECUTED) | ||
.export_values(); | ||
} |
11 changes: 11 additions & 0 deletions
11
runtime/bindings/python/src/pyopenvino/core/profiling_info.hpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
// Copyright (C) 2021 Intel Corporation | ||
// SPDX-License-Identifier: Apache-2.0 | ||
// | ||
|
||
#pragma once | ||
|
||
#include <pybind11/pybind11.h> | ||
|
||
namespace py = pybind11; | ||
|
||
void regclass_ProfilingInfo(py::module m); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters