Skip to content

Commit

Permalink
print tid in vODLA adapter (#876)
Browse files Browse the repository at this point in the history
* Update version to 0.7.32

* Print tid in vODLA Adapter execution.
  • Loading branch information
tianboh authored Mar 30, 2022
1 parent 827f7c1 commit 0e005de
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
9 changes: 6 additions & 3 deletions ODLA/platforms/vodla/vODLA.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
#include <ODLA/odla.h>
#include <stdlib.h>
#include <string.h>
#include <sys/syscall.h>
#include <sys/time.h>
#include <unistd.h>
#include <vodh_common.h>

#include <cassert>
Expand All @@ -12,6 +14,7 @@
#include <memory>
#include <vector>

#define gettid() syscall(SYS_gettid)
#define MAX_INPUT_TENSOR 256
#define MAX_OUTPUT_TENSOR 256

Expand Down Expand Up @@ -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";
Expand Down Expand Up @@ -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";
Expand Down
2 changes: 1 addition & 1 deletion tests/driver/test_driver.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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:

0 comments on commit 0e005de

Please sign in to comment.