-
Notifications
You must be signed in to change notification settings - Fork 159
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[onert/odc] Auto-compilation. OdcInfo and input/output buffers in Exe…
…cution This PR for `odc:auto-compilation` introduces OdcInfo structure and input/output buffers in Execution. For [Issue]( #13288). From [Draft](#13530). ONE-DCO-1.0-Signed-off-by: Evgenii Maltsev [email protected]
- Loading branch information
Showing
3 changed files
with
102 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
/* | ||
* Copyright (c) 2024 Samsung Electronics Co., Ltd. All Rights Reserved | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
#ifndef __ONERT_ODC_ODC_INFO_H__ | ||
#define __ONERT_ODC_ODC_INFO_H__ | ||
|
||
namespace onert | ||
{ | ||
namespace odc | ||
{ | ||
|
||
/** | ||
* @brief Structure contains information about current state of on-device compiler | ||
*/ | ||
class OdcInfo | ||
{ | ||
public: | ||
OdcInfo() {} | ||
OdcInfo(const OdcInfo &) = default; | ||
OdcInfo(OdcInfo &&) = default; | ||
OdcInfo &operator=(const OdcInfo &) = default; | ||
OdcInfo &operator=(OdcInfo &&) = default; | ||
~OdcInfo() = default; | ||
|
||
/** | ||
* @brief Flag provides information about loading quantized model | ||
* | ||
* Within ODC pipeline, float model is quantized during inference and then this quantized model is | ||
* loaded and run. | ||
* | ||
* @return @c true if quantized model loaded, otherwise @c false | ||
*/ | ||
int isQuantizedModelLoaded() const { return _is_quantized_model_loaded; } | ||
|
||
/** | ||
* @brief Flag provides information about loading compiled model | ||
* | ||
* Within ODC pipeline, after quantization ODC launches code generation for quantized model | ||
* automatically. After compilation, ODC tries to load and run compiled model. | ||
* | ||
* @return @c true if compiled model loaded, otherwise @c false | ||
*/ | ||
int isCompiledModelLoaded() const { return _is_compiled_model_loaded; } | ||
|
||
/** | ||
* @brief Set loading flag for quantized model | ||
* @param[in] new_value New value | ||
*/ | ||
void setQuantizedModelLoaded(bool new_value) { _is_quantized_model_loaded = new_value; } | ||
|
||
/** | ||
* @brief Set loading flag for compiled model | ||
* @param[in] new_value New value | ||
*/ | ||
void setCompiledModelLoaded(bool new_value) { _is_compiled_model_loaded = new_value; } | ||
|
||
private: | ||
bool _is_quantized_model_loaded = false; | ||
bool _is_compiled_model_loaded = false; | ||
}; | ||
|
||
} // namespace odc | ||
} // namespace onert | ||
|
||
#endif // __ONERT_ODC_ODC_INFO_H__ |
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