mirror of
https://github.com/saymrwulf/onnxruntime.git
synced 2026-05-16 21:00:14 +00:00
* Register ILearningModelSessionOptionsNate interface * Threading options exposed * Add interrogator for Session options * Add test * Polish test * PR comments * Set intra op threads * Add adapter api to grab intra op threads * Add adapter test for getting intraop num threads * Make ILearningModelSessionNative and update winml api test * Make it required when building engine to set the intraop num threads * Make test more pretty * Change naming of idl function * Revert "Change naming of idl function" This reverts commit c06916aa5bf94e3bf233ed281e508b935fc8638d. * PR comment on naming * Skip the test because it's influenced if it's built with openmp Co-authored-by: Ryan Lai <ryalai96@gamil.com>
35 lines
No EOL
1.2 KiB
C++
35 lines
No EOL
1.2 KiB
C++
// Copyright (c) Microsoft Corporation. All rights reserved.
|
|
// Licensed under the MIT License.
|
|
|
|
#include "pch.h"
|
|
#include "LearningModelSessionOptions.h"
|
|
|
|
namespace WINMLP {
|
|
LearningModelSessionOptions::LearningModelSessionOptions(const LearningModelSessionOptions& options) : batch_size_override_(options.batch_size_override_),
|
|
close_model_on_session_creation_(options.close_model_on_session_creation_) {}
|
|
|
|
uint32_t LearningModelSessionOptions::BatchSizeOverride() {
|
|
return batch_size_override_;
|
|
}
|
|
|
|
void LearningModelSessionOptions::BatchSizeOverride(uint32_t value) {
|
|
batch_size_override_ = value;
|
|
}
|
|
|
|
bool LearningModelSessionOptions::CloseModelOnSessionCreation() {
|
|
return close_model_on_session_creation_;
|
|
}
|
|
|
|
void LearningModelSessionOptions::CloseModelOnSessionCreation(bool value) {
|
|
close_model_on_session_creation_ = value;
|
|
}
|
|
|
|
uint32_t LearningModelSessionOptions::GetIntraOpNumThreads() {
|
|
return intra_op_num_threads_override_;
|
|
}
|
|
|
|
STDMETHODIMP LearningModelSessionOptions::SetIntraOpNumThreadsOverride(uint32_t intraOpNumThreads) noexcept {
|
|
intra_op_num_threads_override_ = intraOpNumThreads;
|
|
return S_OK;
|
|
}
|
|
} // namespace WINMLP
|