Skip to content

Commit

Permalink
Using CompilerInterface from build dir
Browse files Browse the repository at this point in the history
  • Loading branch information
RajivChitale committed Feb 17, 2024
1 parent 289c68d commit 179832c
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 11 deletions.
7 changes: 1 addition & 6 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,6 @@ add_subdirectory(MLModelRunner)
add_subdirectory(SerDes)
add_subdirectory(test)

add_custom_target(copy)
add_custom_command(TARGET copy PRE_BUILD COMMAND ${CMAKE_COMMAND} -E copy CompilerInterface ${CMAKE_CURRENT_BINARY_DIR}/MLModelRunner/CompilerInterface)

if(LLVM_MLBRIDGE)
include(AddLLVM)
include(HandleLLVMOptions)
Expand All @@ -54,9 +51,6 @@ if(LLVM_MLBRIDGE)
ADDITIONAL_HEADER_DIRS
${CMAKE_CURRENT_SOURCE_DIR}/include

DEPENDS
copy

LINK_LIBS
ModelRunnerLib
SerDesLib
Expand Down Expand Up @@ -94,3 +88,4 @@ endif(LLVM_MLBRIDGE)

install(DIRECTORY include/ DESTINATION include)
install(DIRECTORY CompilerInterface DESTINATION MLModelRunner/CompilerInterface)
file(COPY ${CMAKE_CURRENT_SOURCE_DIR}/CompilerInterface DESTINATION ${CMAKE_BINARY_DIR}/MLModelRunner/)
1 change: 0 additions & 1 deletion test/MLBridgeTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,6 @@ void testPrimitive(std::string label, T1 value, T2 expected) {
std::pair<std::string, T1> p("request_" + label, value);
MLRunner->populateFeatures(p);
T2 out = MLRunner->evaluate<T2>();

debug_out << " " << label << " reply: " << out << "\n";
if (std::abs(out - expected) > 10e-6) {
std::cerr << "Error: Expected " << label << " reply: " << expected
Expand Down
6 changes: 3 additions & 3 deletions test/include/HelloMLBridge_Env.h
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
//===----------------------------------------------------------------------===//
//
// Part of the MLCompilerBridge Project, under the Apache 2.0 License.
// See the LICENSE file under home directory for license and copyright
// information.
// Part of the MLCompilerBridge Project, under the Apache License v2.0 with LLVM
// Exceptions. See the LICENSE file for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//

Expand Down
8 changes: 8 additions & 0 deletions test/include/ProtosInclude.h
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
//===----------------------------------------------------------------------===//
//
// Part of the MLCompilerBridge Project, under the Apache License v2.0 with LLVM
// Exceptions. See the LICENSE file for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//

#include "grpc/MLBridgeTest_bool/MLBridgeTest_bool.grpc.pb.h"
#include "grpc/MLBridgeTest_bool/MLBridgeTest_bool.pb.h"
#include "grpc/MLBridgeTest_char/MLBridgeTest_char.grpc.pb.h"
Expand Down
2 changes: 1 addition & 1 deletion test/mlbridge-test.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
BUILD_DIR = "../build_release"
sys.path.extend(
[
"../CompilerInterface",
f"{BUILD_DIR}/MLModelRunner/CompilerInterface",
f"{BUILD_DIR}/MLModelRunner/gRPCModelRunner/Python-Utilities",
]
)
Expand Down

0 comments on commit 179832c

Please sign in to comment.