onnxruntime/winml/lib/Api.Ort/UniqueOrtPtr.h
Sheil Kumar 6255194659
All LearningModelSessions created from a common LearningModelDevice should share the same thread pool (#11457)
* Share thread pools between devices

* make tests reuse device

* Change cpu thread pool options for dml sessions to use 1 thread with no spinning

* fix test failure

* Update missing type constraints for dft

* Add comment and rename inference session parameter

* default missing causing inconsistent test behavior

Co-authored-by: Sheil Kumar <sheilk@microsoft.com>
2022-05-13 11:12:43 -07:00

21 lines
1.5 KiB
C++

// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
#pragma once
#include <memory>
#include "adapter/winml_adapter_c_api.h"
using UniqueOrtModel = std::unique_ptr<OrtModel, decltype(WinmlAdapterApi::ReleaseModel)>;
using UniqueOrtThreadPool = std::unique_ptr<OrtThreadPool, decltype(WinmlAdapterApi::ReleaseThreadPool)>;
using UniqueOrtAllocator = std::unique_ptr<OrtAllocator, decltype(OrtApi::ReleaseAllocator)>;
using UniqueOrtSessionOptions = std::unique_ptr<OrtSessionOptions, decltype(OrtApi::ReleaseSessionOptions)>;
using UniqueOrtSession = std::unique_ptr<OrtSession, decltype(OrtApi::ReleaseSession)>;
using UniqueOrtValue = std::unique_ptr<OrtValue, decltype(OrtApi::ReleaseValue)>;
using UniqueOrtMemoryInfo = std::unique_ptr<OrtMemoryInfo, decltype(OrtApi::ReleaseMemoryInfo)>;
using UniqueOrtTypeInfo = std::unique_ptr<OrtTypeInfo, decltype(OrtApi::ReleaseTypeInfo)>;
using UniqueOrtTensorTypeAndShapeInfo = std::unique_ptr<OrtTensorTypeAndShapeInfo, decltype(OrtApi::ReleaseTensorTypeAndShapeInfo)>;
using UniqueOrtRunOptions = std::unique_ptr<OrtRunOptions, decltype(OrtApi::ReleaseRunOptions)>;
using UniqueOrtEnv = std::unique_ptr<OrtEnv, decltype(OrtApi::ReleaseEnv)>;