|
1 |
| -#include "dnnl_graph_compiler.hpp" |
| 1 | +/* |
| 2 | + * Copyright (C) 2024 Intel Corporation |
| 3 | + * |
| 4 | + * Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | + * you may not use this file except in compliance with the License. |
| 6 | + * You may obtain a copy of the License at |
| 7 | + * |
| 8 | + * http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | + * |
| 10 | + * Unless required by applicable law or agreed to in writing, |
| 11 | + * software distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | + * See the License for the specific language governing permissions |
| 14 | + * and limitations under the License. |
| 15 | + * |
| 16 | + * SPDX-License-Identifier: Apache-2.0 |
| 17 | + */ |
| 18 | + |
| 19 | +#include "dnnl_graph_compiler.h" |
2 | 20 | #include "gc_version.h"
|
| 21 | +#include <memory> |
3 | 22 | #include <new>
|
| 23 | +#include <string_view> |
4 | 24 |
|
5 | 25 | // dnnl_graph_compiler.h interface implementation.
|
6 | 26 | // TODO: Implement.
|
7 | 27 |
|
| 28 | +struct dnnl_graph_compiler_executable { |
| 29 | + // TODO: Implement |
| 30 | + |
| 31 | + void execute(dnnl_graph_compiler_tensor *inputs, |
| 32 | + dnnl_graph_compiler_tensor *outputs) const; |
| 33 | +}; |
| 34 | + |
| 35 | +struct dnnl_graph_compiler { |
| 36 | + const dnnl_graph_compiler_context ctx; |
| 37 | + |
| 38 | + explicit dnnl_graph_compiler(const dnnl_graph_compiler_context *context) |
| 39 | + // TODO: Initialize ctx with context or defaults if context is nullptr |
| 40 | + : ctx() {} |
| 41 | + |
| 42 | + [[nodiscard]] std::unique_ptr<const dnnl_graph_compiler_executable> |
| 43 | + compile(const std::string_view &graph_json) const; |
| 44 | +}; |
| 45 | + |
8 | 46 | const dnnl_graph_compiler_version *dnnl_graph_compiler_get_version(void) {
|
9 | 47 | static const dnnl_graph_compiler_version ver = {
|
10 | 48 | .api_version = {DNNL_GC_API_V_MAJOR, DNNL_GC_API_V_MINOR,
|
|
0 commit comments