1 | /** |
---|---|
2 | * Copyright (c) Glow Contributors. See CONTRIBUTORS file. |
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, software |
11 | * 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 and |
14 | * limitations under the License. |
15 | */ |
16 | |
17 | #include "glow/Backend/CompiledFunction.h" |
18 | #include "glow/Backend/BackendUtils.h" |
19 | |
20 | #include <fstream> |
21 | |
22 | using namespace glow; |
23 | |
24 | CompiledFunction::~CompiledFunction() { runtimeBundle_.freeConstants(); } |
25 | |
26 | CompiledFunction::CompiledFunction(runtime::RuntimeBundle &&bundle) |
27 | : runtimeBundle_(std::move(bundle)){}; |
28 | |
29 | void CompiledFunction::dumpJSON(llvm::StringRef fname) const { |
30 | LOG(INFO) << "Dumping CompiledFunction JSON to "<< fname.str() << std::endl; |
31 | std::ofstream myfile; |
32 | myfile.open(fname.str()); |
33 | myfile << toJSON(); |
34 | myfile.close(); |
35 | } |
36 |