Skip to content

Commit

Permalink
Merge branch 'legalize_tensorcore' of https://github.com/Meteorix/tvm
Browse files Browse the repository at this point in the history
…into legalize_tensorcore
  • Loading branch information
Meteorix committed Dec 22, 2020
2 parents d34360a + a2277c3 commit 7bf253c
Show file tree
Hide file tree
Showing 503 changed files with 23,247 additions and 6,987 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ jobs:
with:
path: ~/conda_pkgs_dir
key: ${{ runner.os }}-conda-${{ env.CACHE_NUMBER }}-${{ hashFiles('conda/build-environment.yaml') }}
- uses: conda-incubator/setup-miniconda@v1
- uses: conda-incubator/setup-miniconda@v2
with:
activate-environment: tvm-build
channel-priority: strict
Expand Down
2 changes: 1 addition & 1 deletion 3rdparty/vta-hw
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -353,6 +353,7 @@ include(cmake/modules/contrib/ONNX.cmake)
include(cmake/modules/contrib/ArmComputeLib.cmake)
include(cmake/modules/contrib/TensorRT.cmake)
include(cmake/modules/contrib/VitisAI.cmake)
include(cmake/modules/contrib/Verilator.cmake)
include(cmake/modules/Git.cmake)
include(cmake/modules/LibInfo.cmake)
include(cmake/modules/RustExt.cmake)
Expand Down
8 changes: 5 additions & 3 deletions CONTRIBUTORS.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,12 @@ We do encourage everyone to work anything they are interested in.

- [Aditya Atluri](https://github.com/adityaatluri): @adityaatluri - rocm
- [Matthew Barrett](https://github.com/mbaret): @mbaret - byoc, arm
- [Matthew Brookhart](https://github.com/mbrookhart): @mbrookhart - relay, frontends
- [Tianqi Chen](https://github.com/tqchen) (PPMC): @tqchen - topi, compiler, relay, docs
- [Liangfu Chen](https://github.com/liangfu): @liangfu - vta, chisel, intel FPGA, c runtime
- [Wei Chen](https://github.com/wweic): @wweic - runtime, relay, vm
- [Zhi Chen](https://github.com/zhiics) (PPMC): @zhiics - relay, quantization, pass manager
- [Chenfan](https://github.com/jcf94): @jcf94 - autoscheduling
- [Yuwei Hu](https://github.com/Huyuwei): @Huyuwei - topi, frontends
- [Nick Hynes](https://github.com/nhynes): @nhynes: - sgx, rust
- [Animesh Jain](https://github.com/anijain2305): @anijain2305 - quantization, relay
Expand Down Expand Up @@ -77,7 +79,6 @@ We do encourage everyone to work anything they are interested in.

- [Aditya Atluri](https://github.com/adityaatluri): @adityaatluri
- [Matthew Barrett](https://github.com/mbaret): @mbaret
- [Luke Hutton](https://github.com/lhutton1): @lhutton1
- [Arnaud Bergeron](https://github.com/abergeron): @abergeron
- [Matthew Brookhart](https://github.com/mbrookhart): @mbrookhart
- [Tianqi Chen](https://github.com/tqchen): @tqchen
Expand All @@ -92,11 +93,12 @@ We do encourage everyone to work anything they are interested in.
- [Hao Lu](https://github.com/hlu1): @hlu1
- [Nick Hynes](https://github.com/nhynes): @nhynes
- [Yuwei Hu](https://github.com/Huyuwei): @Huyuwei
- [Luke Hutton](https://github.com/lhutton1): @lhutton1
- [Animesh Jain](https://github.com/anijain2305): @anijain2305
- [Hua Jiang](https://github.com/huajsj): @huajsj
- [Leandro Nunes](https://github.com/leandron): @leandron
- [Yizhi Liu](https://github.com/yzhliu) : @yzhliu
- [Zhixun Tan](https://github.com/phisiart): @phisiart
- [Zhi Chen](https://github.com/zhiics): @zhiics
- [Xiaoqiang Dan](https://github.com/xqdan): @xqdan
- [Ziheng Jiang](https://github.com/ZihengJiang): @ZihengJiang
- [Marisa Kirisame](https://github.com/MarisaKirisame): @MarisaKirisame
Expand Down Expand Up @@ -138,7 +140,7 @@ We do encourage everyone to work anything they are interested in.
- [Lianmin Zheng](https://github.com/merrymercy): @merrymercy

## List of Contributors
- [Full List of Contributors](https://github.com/apache/incubator-tvm/graphs/contributors)
- [Full List of Contributors](https://github.com/apache/tvm/graphs/contributors)
- To contributors: please add your name to the list.
- [Qiao Zhang](https://github.com/zhangqiaorjc)
- [Haolong Zhang](https://github.com/haolongzhangm)
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,15 @@
<!--- specific language governing permissions and limitations -->
<!--- under the License. -->

<img src=https://raw.githubusercontent.com/apache/incubator-tvm-site/main/images/logo/tvm-logo-small.png width=128/> Open Deep Learning Compiler Stack
<img src=https://raw.githubusercontent.com/apache/tvm-site/main/images/logo/tvm-logo-small.png width=128/> Open Deep Learning Compiler Stack
==============================================
[Documentation](https://tvm.apache.org/docs) |
[Contributors](CONTRIBUTORS.md) |
[Community](https://tvm.apache.org/community) |
[Release Notes](NEWS.md)

[![Build Status](https://ci.tlcpack.ai/buildStatus/icon?job=tvm/main)](https://ci.tlcpack.ai/job/tvm/job/main/)
[![WinMacBuild](https://github.com/apache/incubator-tvm/workflows/WinMacBuild/badge.svg)](https://github.com/apache/incubator-tvm/actions?query=workflow%3AWinMacBuild)
[![WinMacBuild](https://github.com/apache/tvm/workflows/WinMacBuild/badge.svg)](https://github.com/apache/tvm/actions?query=workflow%3AWinMacBuild)

Apache TVM (incubating) is a compiler stack for deep learning systems. It is designed to close the gap between the
productivity-focused deep learning frameworks, and the performance- and efficiency-focused hardware backends.
Expand Down
4 changes: 2 additions & 2 deletions apps/android_deploy/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ Alternatively, you may execute Docker image we provide which contains the requir

### Build APK

Before you build the Android application, please refer to [TVM4J Installation Guide](https://github.com/apache/incubator-tvm/blob/main/jvm/README.md) and install tvm4j-core to your local maven repository. You can find tvm4j dependency declare in `app/build.gradle`. Modify it if it is necessary.
Before you build the Android application, please refer to [TVM4J Installation Guide](https://github.com/apache/tvm/blob/main/jvm/README.md) and install tvm4j-core to your local maven repository. You can find tvm4j dependency declare in `app/build.gradle`. Modify it if it is necessary.

```
dependencies {
Expand Down Expand Up @@ -124,7 +124,7 @@ If everything goes well, you will find compile tools in `/opt/android-toolchain-

Follow instruction to get compiled version model for android target [here.](https://tvm.apache.org/docs/deploy/android.html)

Copied these compiled model deploy_lib.so, deploy_graph.json and deploy_param.params to apps/android_deploy/app/src/main/assets/ and modify TVM flavor changes on [java](https://github.com/apache/incubator-tvm/blob/main/apps/android_deploy/app/src/main/java/org/apache/tvm/android/demo/MainActivity.java#L81)
Copied these compiled model deploy_lib.so, deploy_graph.json and deploy_param.params to apps/android_deploy/app/src/main/assets/ and modify TVM flavor changes on [java](https://github.com/apache/tvm/blob/main/apps/android_deploy/app/src/main/java/org/apache/tvm/android/demo/MainActivity.java#L81)

`CPU Verison flavor`
```
Expand Down
6 changes: 3 additions & 3 deletions apps/android_rpc/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ You will need JDK, [Android NDK](https://developer.android.com/ndk) and an Andro

We use [Gradle](https://gradle.org) to build. Please follow [the installation instruction](https://gradle.org/install) for your operating system.

Before you build the Android application, please refer to [TVM4J Installation Guide](https://github.com/apache/incubator-tvm/blob/main/jvm/README.md) and install tvm4j-core to your local maven repository. You can find tvm4j dependency declare in `app/build.gradle`. Modify it if it is necessary.
Before you build the Android application, please refer to [TVM4J Installation Guide](https://github.com/apache/tvm/blob/main/jvm/README.md) and install tvm4j-core to your local maven repository. You can find tvm4j dependency declare in `app/build.gradle`. Modify it if it is necessary.

```
dependencies {
Expand Down Expand Up @@ -146,7 +146,7 @@ android 1 1 0
```


Then checkout [android\_rpc/tests/android\_rpc\_test.py](https://github.com/apache/incubator-tvm/blob/main/apps/android_rpc/tests/android_rpc_test.py) and run,
Then checkout [android\_rpc/tests/android\_rpc\_test.py](https://github.com/apache/tvm/blob/main/apps/android_rpc/tests/android_rpc_test.py) and run,

```bash
# Specify the RPC tracker
Expand All @@ -157,7 +157,7 @@ export TVM_NDK_CC=/opt/android-toolchain-arm64/bin/aarch64-linux-android-g++
python android_rpc_test.py
```

This will compile TVM IR to shared libraries (CPU, OpenCL and Vulkan) and run vector addition on your Android device. To verify compiled TVM IR shared libraries on OpenCL target set `'test_opencl = True'` and on Vulkan target set `'test_vulkan = True'` in [tests/android_rpc_test.py](https://github.com/apache/incubator-tvm/blob/main/apps/android_rpc/tests/android_rpc_test.py), by default on CPU target will execute.
This will compile TVM IR to shared libraries (CPU, OpenCL and Vulkan) and run vector addition on your Android device. To verify compiled TVM IR shared libraries on OpenCL target set `'test_opencl = True'` and on Vulkan target set `'test_vulkan = True'` in [tests/android_rpc_test.py](https://github.com/apache/tvm/blob/main/apps/android_rpc/tests/android_rpc_test.py), by default on CPU target will execute.
On my test device, it gives following results.

```bash
Expand Down
4 changes: 2 additions & 2 deletions apps/benchmark/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

## Results

See results on wiki page https://github.com/apache/incubator-tvm/wiki/Benchmark
See results on wiki page https://github.com/apache/tvm/wiki/Benchmark

## How to Reproduce

Expand Down Expand Up @@ -78,7 +78,7 @@ python3 -m tvm.exec.rpc_tracker
`python3 -m tvm.exec.rpc_server --tracker=10.77.1.123:9190 --key=rk3399`, where 10.77.1.123 is the IP address of the tracker.

* For Android device
* Build and install tvm RPC apk on your device [Help](https://github.com/apache/incubator-tvm/tree/main/apps/android_rpc).
* Build and install tvm RPC apk on your device [Help](https://github.com/apache/tvm/tree/main/apps/android_rpc).
Make sure you can pass the android rpc test. Then you have alreadly known how to register.

3. Verify the device registration
Expand Down
15 changes: 9 additions & 6 deletions apps/bundle_deploy/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -76,11 +76,14 @@ demo_static: $(build_dir)/demo_static $(build_dir)/cat.bin
test_static: $(build_dir)/test_static $(build_dir)/test_data_c.bin $(build_dir)/test_output_c.bin
$(QUIET)TVM_NUM_THREADS=1 $(build_dir)/test_static $(build_dir)/test_data_c.bin $(build_dir)/test_output_c.bin $(build_dir)/test_graph_c.json $(build_dir)/test_params_c.bin

$(build_dir)/crt/libcommon.a: $(CRT_SRCS)
$(QUIET)cd $(CRT_ROOT) && make QUIET= BUILD_DIR=$(abspath $(build_dir))/crt CRT_CONFIG=$(abspath crt_config/crt_config.h) "EXTRA_CFLAGS=$(PKG_COMPILE_OPTS)" common

$(build_dir)/crt/libgraph_runtime.a: $(CRT_SRCS)
$(QUIET)cd $(CRT_ROOT) && make QUIET= BUILD_DIR=$(abspath $(build_dir))/crt CRT_CONFIG=$(abspath crt_config/crt_config.h) "EXTRA_CFLAGS=$(PKG_COMPILE_OPTS)" graph_runtime

$(build_dir)/crt/libcommon.a: $(CRT_SRCS)
$(QUIET)cd $(CRT_ROOT) && make QUIET= BUILD_DIR=$(abspath $(build_dir))/crt CRT_CONFIG=$(abspath crt_config/crt_config.h) "EXTRA_CFLAGS=$(PKG_COMPILE_OPTS)" common
$(build_dir)/crt/libmemory.a: $(CRT_SRCS)
$(QUIET)cd $(CRT_ROOT) && make QUIET= BUILD_DIR=$(abspath $(build_dir))/crt CRT_CONFIG=$(abspath crt_config/crt_config.h) "EXTRA_CFLAGS=$(PKG_COMPILE_OPTS)" memory

$(build_dir)/demo_dynamic: demo.cc
$(QUIET)mkdir -p $(@D)
Expand All @@ -90,11 +93,11 @@ $(build_dir)/test_dynamic: test.cc ${build_dir}/test_graph_c.json ${build_dir}/t
$(QUIET)mkdir -p $(@D)
$(QUIET)g++ $(PKG_CXXFLAGS) -o $@ test.cc $(BACKTRACE_OBJS) $(BACKTRACE_LDFLAGS)

$(build_dir)/demo_static: demo_static.c ${build_dir}/bundle_static.o ${build_dir}/model_c.o ${build_dir}/crt/libgraph_runtime.a ${build_dir}/crt/libcommon.a ${build_dir}/graph_c.json.c ${build_dir}/params_c.bin.c $(BACKTRACE_OBJS)
$(build_dir)/demo_static: demo_static.c ${build_dir}/bundle_static.o ${build_dir}/model_c.o ${build_dir}/crt/libmemory.a ${build_dir}/crt/libgraph_runtime.a ${build_dir}/crt/libcommon.a ${build_dir}/graph_c.json.c ${build_dir}/params_c.bin.c $(BACKTRACE_OBJS)
$(QUIET)mkdir -p $(@D)
$(QUIET)gcc $(PKG_CFLAGS) -o $@ $^ $(PKG_LDFLAGS) $(BACKTRACE_LDFLAGS) $(BACKTRACE_CFLAGS)

$(build_dir)/test_static: test_static.c ${build_dir}/bundle_static.o ${build_dir}/test_model_c.o ${build_dir}/crt/libgraph_runtime.a ${build_dir}/crt/libcommon.a $(BACKTRACE_OBJS)
$(build_dir)/test_static: test_static.c ${build_dir}/bundle_static.o ${build_dir}/test_model_c.o ${build_dir}/crt/libmemory.a ${build_dir}/crt/libgraph_runtime.a ${build_dir}/crt/libcommon.a $(BACKTRACE_OBJS)
$(QUIET)mkdir -p $(@D)
$(QUIET)gcc $(PKG_CFLAGS) -o $@ $^ $(BACKTRACE_LDFLAGS)

Expand Down Expand Up @@ -128,15 +131,15 @@ $(build_dir)/bundle.so: bundle.cc runtime.cc $(build_dir)/model_cpp.o
$(QUIET)mkdir -p $(@D)
$(QUIET)g++ -shared $(PKG_CXXFLAGS) -fvisibility=hidden -o $@ $^ $(PKG_LDFLAGS)

$(build_dir)/bundle_c.so: bundle.c $(build_dir)/model_c.o ${build_dir}/crt/libgraph_runtime.a ${build_dir}/crt/libcommon.a $(BACKTRACE_OBJS)
$(build_dir)/bundle_c.so: bundle.c $(build_dir)/model_c.o ${build_dir}/crt/libmemory.a ${build_dir}/crt/libgraph_runtime.a ${build_dir}/crt/libcommon.a $(BACKTRACE_OBJS)
$(QUIET)mkdir -p $(@D)
$(QUIET)gcc -shared $(PKG_CFLAGS) -fvisibility=hidden -o $@ $^ $(PKG_LDFLAGS) $(BACKTRACE_LDFLAGS) $(BACKTRACE_CFLAGS)

$(build_dir)/test_bundle.so: bundle.cc runtime.cc $(build_dir)/test_model_cpp.o
$(QUIET)mkdir -p $(@D)
$(QUIET)g++ -shared $(PKG_CXXFLAGS) -fvisibility=hidden -o $@ $^ $(PKG_LDFLAGS)

$(build_dir)/test_bundle_c.so: bundle.c $(build_dir)/test_model_c.o ${build_dir}/crt/libgraph_runtime.a ${build_dir}/crt/libcommon.a $(BACKTRACE_OBJS)
$(build_dir)/test_bundle_c.so: bundle.c $(build_dir)/test_model_c.o ${build_dir}/crt/libmemory.a ${build_dir}/crt/libgraph_runtime.a ${build_dir}/crt/libcommon.a $(BACKTRACE_OBJS)
$(QUIET)mkdir -p $(@D)
$(QUIET)gcc -shared $(PKG_CFLAGS) -fvisibility=hidden -o $@ $^ $(PKG_LDFLAGS) $(BACKTRACE_LDFLAGS) $(BACKTRACE_CFLAGS)

Expand Down
2 changes: 0 additions & 2 deletions apps/bundle_deploy/build_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ def build_module(opts):
build_dir = os.path.abspath(opts.out_dir)
if not os.path.isdir(build_dir):
os.makedirs(build_dir)

lib.save(os.path.join(build_dir, file_format_str.format(name="model", ext="o")))
with open(
os.path.join(build_dir, file_format_str.format(name="graph", ext="json")), "w"
Expand Down Expand Up @@ -85,7 +84,6 @@ def build_test_module(opts):
build_dir = os.path.abspath(opts.out_dir)
if not os.path.isdir(build_dir):
os.makedirs(build_dir)

lib.save(os.path.join(build_dir, file_format_str.format(name="test_model", ext="o")))
with open(
os.path.join(build_dir, file_format_str.format(name="test_graph", ext="json")), "w"
Expand Down
19 changes: 16 additions & 3 deletions apps/bundle_deploy/bundle.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
#include <tvm/runtime/c_runtime_api.h>
#include <tvm/runtime/crt/crt.h>
#include <tvm/runtime/crt/graph_runtime.h>
#include <tvm/runtime/crt/memory.h>
#include <tvm/runtime/crt/packed_func.h>

#ifdef ENABLE_TVM_ABORT_BACKTRACE
Expand All @@ -33,6 +34,7 @@
#define CRT_MEMORY_PAGE_SIZE_LOG2 10

static uint8_t g_crt_memory[CRT_MEMORY_NUM_PAGES * (1 << CRT_MEMORY_PAGE_SIZE_LOG2)];
static MemoryManagerInterface* g_memory_manager;

/*! \brief macro to do C API call */
#define TVM_CCALL(func) \
Expand Down Expand Up @@ -62,7 +64,9 @@ TVM_DLL void* tvm_runtime_create(const char* json_data, const char* params_data,
ctx.device_id = device_id;

// declare pointers
TVM_CCALL(TVMInitializeRuntime(g_crt_memory, sizeof(g_crt_memory), CRT_MEMORY_PAGE_SIZE_LOG2));
TVM_CCALL(MemoryManagerCreate(&g_memory_manager, g_crt_memory, sizeof(g_crt_memory),
CRT_MEMORY_PAGE_SIZE_LOG2));
TVM_CCALL(TVMInitializeRuntime());
TVMPackedFunc pf;
TVMArgs args = TVMArgs_Create(NULL, NULL, 0);
TVM_CCALL(TVMPackedFunc_InitGlobalFunc(&pf, "runtime.SystemLib", &args));
Expand All @@ -71,8 +75,9 @@ TVM_DLL void* tvm_runtime_create(const char* json_data, const char* params_data,
TVMModuleHandle mod_syslib = TVMArgs_AsModuleHandle(&pf.ret_value, 0);

// run modules
TVMGraphRuntime* graph_runtime = TVMGraphRuntime_Create(json_data, mod_syslib, &ctx);
TVMGraphRuntime_LoadParams(graph_runtime, params.data, params.size);
TVMGraphRuntime* graph_runtime = NULL;
TVM_CCALL(TVMGraphRuntime_Create(json_data, mod_syslib, &ctx, &graph_runtime));
TVM_CCALL(TVMGraphRuntime_LoadParams(graph_runtime, params.data, params.size));

return graph_runtime;
}
Expand Down Expand Up @@ -110,3 +115,11 @@ void __attribute__((noreturn)) TVMPlatformAbort(tvm_crt_error_t error_code) {
#endif
exit(-1);
}

tvm_crt_error_t TVMPlatformMemoryAllocate(size_t num_bytes, DLContext ctx, void** out_ptr) {
return g_memory_manager->Allocate(g_memory_manager, num_bytes, ctx, out_ptr);
}

tvm_crt_error_t TVMPlatformMemoryFree(void* ptr, DLContext ctx) {
return g_memory_manager->Free(g_memory_manager, ptr, ctx);
}
19 changes: 16 additions & 3 deletions apps/bundle_deploy/bundle_static.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
#include <stdlib.h>
#include <tvm/runtime/crt/crt.h>
#include <tvm/runtime/crt/graph_runtime.h>
#include <tvm/runtime/crt/memory.h>
#include <tvm/runtime/crt/packed_func.h>
#include <unistd.h>

Expand All @@ -34,6 +35,7 @@
#define CRT_MEMORY_PAGE_SIZE_LOG2 10

static uint8_t g_crt_memory[CRT_MEMORY_NUM_PAGES * (1 << CRT_MEMORY_PAGE_SIZE_LOG2)];
static MemoryManagerInterface* g_memory_manager;

/*! \brief macro to do C API call */
#define TVM_CCALL(func) \
Expand Down Expand Up @@ -62,7 +64,9 @@ TVM_DLL void* tvm_runtime_create(const char* json_data, const char* params_data,
ctx.device_id = device_id;

// get pointers
TVM_CCALL(TVMInitializeRuntime(g_crt_memory, sizeof(g_crt_memory), CRT_MEMORY_PAGE_SIZE_LOG2));
TVM_CCALL(MemoryManagerCreate(&g_memory_manager, g_crt_memory, sizeof(g_crt_memory),
CRT_MEMORY_PAGE_SIZE_LOG2));
TVM_CCALL(TVMInitializeRuntime());
TVMPackedFunc pf;
TVMArgs args = TVMArgs_Create(NULL, NULL, 0);
TVM_CCALL(TVMPackedFunc_InitGlobalFunc(&pf, "runtime.SystemLib", &args));
Expand All @@ -71,8 +75,9 @@ TVM_DLL void* tvm_runtime_create(const char* json_data, const char* params_data,
TVMModuleHandle mod_syslib = TVMArgs_AsModuleHandle(&pf.ret_value, 0);

// run modules
TVMGraphRuntime* graph_runtime = TVMGraphRuntime_Create(json_data, mod_syslib, &ctx);
TVMGraphRuntime_LoadParams(graph_runtime, params.data, params.size);
TVMGraphRuntime* graph_runtime = NULL;
TVM_CCALL(TVMGraphRuntime_Create(json_data, mod_syslib, &ctx, &graph_runtime));
TVM_CCALL(TVMGraphRuntime_LoadParams(graph_runtime, params.data, params.size));

return graph_runtime;
}
Expand Down Expand Up @@ -111,3 +116,11 @@ void __attribute__((noreturn)) TVMPlatformAbort(tvm_crt_error_t error_code) {
#endif
exit(-1);
}

tvm_crt_error_t TVMPlatformMemoryAllocate(size_t num_bytes, DLContext ctx, void** out_ptr) {
return g_memory_manager->Allocate(g_memory_manager, num_bytes, ctx, out_ptr);
}

tvm_crt_error_t TVMPlatformMemoryFree(void* ptr, DLContext ctx) {
return g_memory_manager->Free(g_memory_manager, ptr, ctx);
}
1 change: 1 addition & 0 deletions apps/cpp_rpc/rpc_server.cc
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
#include <iostream>
#include <set>
#include <string>
#include <thread>

#include "../../src/runtime/rpc/rpc_endpoint.h"
#include "../../src/runtime/rpc/rpc_socket_impl.h"
Expand Down
Loading

0 comments on commit 7bf253c

Please sign in to comment.