From 0e005deba3d65bfb03efc80aee08e1b3c07a5188 Mon Sep 17 00:00:00 2001 From: tianboh <54729592+tianboh@users.noreply.github.com> Date: Wed, 30 Mar 2022 11:22:02 +0800 Subject: [PATCH] print tid in vODLA adapter (#876) * Update version to 0.7.32 * Print tid in vODLA Adapter execution. --- CMakeLists.txt | 2 +- ODLA/platforms/vodla/vODLA.cpp | 9 ++++++--- tests/driver/test_driver.cc | 2 +- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 4672a86e3..f4fed3e44 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -17,7 +17,7 @@ cmake_minimum_required(VERSION 3.14.5) set(PROJECT_NAME "HALO_STABLE_SDK_2.3.1" HOMEPAGE_URL "https://github.com/alibaba/heterogeneity-aware-lowering-and-optimization") -set(PROJECT_VERSION "0.7.31") +set(PROJECT_VERSION "0.7.32") project(${PROJECT_NAME} VERSION ${PROJECT_VERSION} LANGUAGES C CXX ASM) diff --git a/ODLA/platforms/vodla/vODLA.cpp b/ODLA/platforms/vodla/vODLA.cpp index 2bbad670d..5c948338b 100644 --- a/ODLA/platforms/vodla/vODLA.cpp +++ b/ODLA/platforms/vodla/vODLA.cpp @@ -1,7 +1,9 @@ #include #include #include +#include #include +#include #include #include @@ -12,6 +14,7 @@ #include #include +#define gettid() syscall(SYS_gettid) #define MAX_INPUT_TENSOR 256 #define MAX_OUTPUT_TENSOR 256 @@ -850,6 +853,7 @@ bool allocDMA(odla_device device, odla_context context) { odla_status odla_ExecuteComputation(odla_computation comp, odla_context context, odla_compute_mode mode, odla_device device) { + pid_t tid = gettid(); // init vODLA device failed if (context == NULL) { std::cout << "[vODLA] ERROR: odla device is NULL.\n"; @@ -934,9 +938,8 @@ odla_status odla_ExecuteComputation(odla_computation comp, odla_context context, device->vodh_infer_opt.model.use_file = 1; // use file path instead of DMA strcpy(device->vodh_infer_opt.model.weight_file, comp->wtFile.c_str()); -#ifdef DEBUG - std::cout << "[vODLA] INFO: start remote inference...\n"; -#endif + std::cout << "[vODLA] INFO: thread " << tid + << " start remote inference...\n"; #ifdef TIMING std::cout << "[vODLA] INFO: loop " << LOOP_CNT << " times.\n"; diff --git a/tests/driver/test_driver.cc b/tests/driver/test_driver.cc index 7431b9e41..80334af0a 100644 --- a/tests/driver/test_driver.cc +++ b/tests/driver/test_driver.cc @@ -19,5 +19,5 @@ // RUN: %halo_compiler -version 2>&1 | FileCheck %s -// CHECK: Version: 0.7.31 +// CHECK: Version: 0.7.32 // CHECK: HALO Repo:{{.*}} Rev: