onnxruntime/winml/lib/Api.Ort/UniqueOrtPtr.h
Justin Chu eeef157888
Format c++ code under winml/ (#16660)
winml/ was previously excluded from lintrunner config. This change
includes the directory and adds the clang-format config file specific to
winml/ that fits existing style.

---------

Signed-off-by: Justin Chu <justinchu@microsoft.com>
2023-07-25 21:56:50 -07:00

25 lines
1.6 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"
// clang-format off
// preserve visually scannable types
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)>;
// clang-format on