Skip to content

Commit f2a5f90

Browse files
New GC interface. Added changes from code review.
1 parent 0726837 commit f2a5f90

File tree

5 files changed

+54
-27
lines changed

5 files changed

+54
-27
lines changed

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,6 @@ add_mlir_library(graph_compiler SHARED ${GC_LIB_SOURCES})
102102
target_include_directories(graph_compiler PUBLIC ${GC_LIB_INCLUDES})
103103
target_compile_options(graph_compiler PRIVATE -fvisibility=hidden -fexceptions)
104104
target_link_options(graph_compiler PRIVATE -Wl,--gc-sections)
105-
target_link_libraries(graph_compiler PUBLIC ${GC_LIB_LINKED_LIBS})
105+
target_link_libraries(graph_compiler PRIVATE ${GC_LIB_LINKED_LIBS})
106106

107107
add_subdirectory(test)

src/dnnl/dnnl_graph_compiler.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -210,13 +210,11 @@ GC_DLL_EXPORT dnnl_status_t dnnl_graph_compiler_compile(
210210
}
211211

212212
GC_DLL_EXPORT void dnnl_graph_compiler_destroy_executable(
213-
const struct dnnl_graph_compiler *gc,
214213
const struct dnnl_graph_compiler_executable *exe) {
215214
delete exe;
216215
}
217216

218217
GC_DLL_EXPORT dnnl_status_t dnnl_graph_compiler_execute(
219-
const struct dnnl_graph_compiler *gc,
220218
const struct dnnl_graph_compiler_executable *exe,
221219
dnnl_graph_compiler_tensor *inputs, dnnl_graph_compiler_tensor *outputs) {
222220
try {

test/dnnl/DnnlTestUtils.h

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,20 @@
1-
//===-- DnnlTestUtils.h - Test utils ----------------------------*- C++ -*-===//
2-
//
3-
// This file is licensed under the Apache License v2.0 with LLVM Exceptions.
4-
// See https://llvm.org/LICENSE.txt for license information.
5-
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6-
//
7-
//===----------------------------------------------------------------------===//
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+
*/
818

919
#include <filesystem>
1020
#include <fstream>

test/dnnl/TestApiBasic.cpp

Lines changed: 19 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,20 @@
1-
//===-- TestApiBasic.cpp - Basic tests for the dnnl interface ---*- C++ -*-===//
2-
//
3-
// This file is licensed under the Apache License v2.0 with LLVM Exceptions.
4-
// See https://llvm.org/LICENSE.txt for license information.
5-
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6-
//
7-
//===----------------------------------------------------------------------===//
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+
*/
818

919
#include <gtest/gtest.h>
1020

@@ -37,10 +47,9 @@ TEST(TestApiBasic, basicWorkflow) {
3747
arg2[i] = i;
3848
}
3949

40-
ASSERT_EQ(dnnl_graph_compiler_execute(gc, exe, inputs, outputs),
41-
dnnl_success);
50+
ASSERT_EQ(dnnl_graph_compiler_execute(exe, inputs, outputs), dnnl_success);
4251

43-
dnnl_graph_compiler_destroy_executable(gc, exe);
52+
dnnl_graph_compiler_destroy_executable(exe);
4453
dnnl_graph_compiler_destroy(gc);
4554

4655
for (size_t i = 0; i < 128; i++) {

test/dnnl/TestJsonParser.cpp

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,20 @@
1-
//===-- TestJsonParser.cpp - JsonParser test --------------------*- C++ -*-===//
2-
//
3-
// This file is licensed under the Apache License v2.0 with LLVM Exceptions.
4-
// See https://llvm.org/LICENSE.txt for license information.
5-
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6-
//
7-
//===----------------------------------------------------------------------===//
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+
*/
818

919
#include <gtest/gtest.h>
1020

0 commit comments

Comments
 (0)