|
| 1 | +// Copyright (c) Microsoft Corporation. All rights reserved. |
| 2 | +// Licensed under the MIT License. |
| 3 | + |
| 4 | +#pragma once |
| 5 | + |
| 6 | +#include "api.h" |
| 7 | +#include "common.h" |
| 8 | + |
| 9 | +// This header is only used when building WebGPU/CUDA EP as a shared library. |
| 10 | +// |
| 11 | +// This header file is used as a precompiled header so it is always included first. |
| 12 | + |
| 13 | +#pragma push_macro("ORT_EP_API_ADAPTER_HEADER_INCLUDED") |
| 14 | +#define ORT_EP_API_ADAPTER_HEADER_INCLUDED |
| 15 | + |
| 16 | +#include "adapter/allocator.h" |
| 17 | +#include "adapter/logging.h" |
| 18 | +#include "adapter/ep.h" |
| 19 | +#include "adapter/kernel_registry.h" |
| 20 | + |
| 21 | +#pragma pop_macro("ORT_EP_API_ADAPTER_HEADER_INCLUDED") |
| 22 | + |
| 23 | +// |
| 24 | +// EP specific using declarations |
| 25 | +// |
| 26 | + |
| 27 | +#define EP_SPECIFIC_USING_DECLARATIONS \ |
| 28 | + using FuncManager = onnxruntime::ep::adapter::FuncManager; \ |
| 29 | + using KernelCreatePtrFn = onnxruntime::ep::adapter::KernelCreatePtrFn; \ |
| 30 | + using KernelDefBuilder = onnxruntime::ep::adapter::KernelDefBuilder; \ |
| 31 | + using KernelRegistry = onnxruntime::ep::adapter::KernelRegistry; \ |
| 32 | + using KernelCreateInfo = onnxruntime::ep::adapter::KernelCreateInfo; \ |
| 33 | + using BuildKernelCreateInfoFn = onnxruntime::ep::adapter::KernelCreateInfo (*)(); \ |
| 34 | + using OpKernelInfo = onnxruntime::ep::adapter::OpKernelInfo; \ |
| 35 | + using OpKernelContext = onnxruntime::ep::adapter::OpKernelContext; \ |
| 36 | + using OpKernel = onnxruntime::ep::adapter::OpKernel; \ |
| 37 | + using DataTransferManager = onnxruntime::ep::adapter::DataTransferManager; \ |
| 38 | + namespace logging { \ |
| 39 | + using Logger = onnxruntime::ep::adapter::Logger; \ |
| 40 | + } |
| 41 | + |
| 42 | +namespace onnxruntime { |
| 43 | +namespace webgpu { |
| 44 | +EP_SPECIFIC_USING_DECLARATIONS |
| 45 | +} // namespace webgpu |
| 46 | +namespace cuda { |
| 47 | +EP_SPECIFIC_USING_DECLARATIONS |
| 48 | +} // namespace cuda |
| 49 | + |
| 50 | +#ifndef DISABLE_CONTRIB_OPS |
| 51 | +namespace contrib { |
| 52 | +namespace webgpu { |
| 53 | +EP_SPECIFIC_USING_DECLARATIONS |
| 54 | +} // namespace webgpu |
| 55 | +namespace cuda { |
| 56 | +EP_SPECIFIC_USING_DECLARATIONS |
| 57 | +} // namespace cuda |
| 58 | +} // namespace contrib |
| 59 | +#endif |
| 60 | + |
| 61 | +} // namespace onnxruntime |
0 commit comments