diff --git a/include/wamr_exec_env.h b/include/wamr_exec_env.h index 8faf444..84dd3bd 100644 --- a/include/wamr_exec_env.h +++ b/include/wamr_exec_env.h @@ -18,7 +18,7 @@ struct WAMRExecEnv { // multiple // // /* Previous thread's exec env of a WASM module instance. */ // struct WASMExecEnv *prev; - ssize_t cur_count{}; + uint32 cur_count{}; /* Note: field module_inst, argv_buf, native_stack_boundary, susÆ’end_flags, aux_stack_boundary, aux_stack_bottom, and diff --git a/include/wamr_export.h b/include/wamr_export.h index 0c1b51f..a4331e5 100644 --- a/include/wamr_export.h +++ b/include/wamr_export.h @@ -25,7 +25,7 @@ enum sync_op { }; struct sync_op_t { - size_t tid; + uint32 tid; uint32 ref; enum sync_op sync_op; }; diff --git a/src/checkpoint.cpp b/src/checkpoint.cpp index f5fef1d..c0c9724 100644 --- a/src/checkpoint.cpp +++ b/src/checkpoint.cpp @@ -5,18 +5,11 @@ #include "aot_runtime.h" #include "logging.h" #include "wamr.h" -#include "wamr_wasi_context.h" -#include "wasm_runtime.h" -#include #include #include -#include -#include -#include #include #include #include -#include #if !defined(_WIN32) #include "thread_manager.h" #include diff --git a/src/wamr_export.cpp b/src/wamr_export.cpp index e5bed70..373f84c 100644 --- a/src/wamr_export.cpp +++ b/src/wamr_export.cpp @@ -281,7 +281,7 @@ int gettid() { return GetCurrentThreadId(); } void insert_sync_op(wasm_exec_env_t exec_env, uint32 *mutex, enum sync_op locking) { printf("insert sync on offset %d, as op: %d\n", *mutex, locking); - struct sync_op_t sync_op = {.tid = exec_env->cur_count, .ref = *mutex, .sync_op = locking}; + struct sync_op_t sync_op = {.tid = ((uint32)exec_env->cur_count), .ref = *mutex, .sync_op = locking}; wamr->sync_ops.push_back(sync_op); } @@ -290,11 +290,11 @@ void lightweight_checkpoint(WASMExecEnv *exec_env) { if (((AOTFrame *)exec_env->cur_frame)) { fid = (((AOTFrame *)exec_env->cur_frame)->func_index); } -// LOGV(DEBUG) << "checkpoint " << gettid() << " func(" << fid << ")"; -// if (fid == -1) { -// LOGV(DEBUG) << "skip checkpoint"; -// return; -// } + // LOGV(DEBUG) << "checkpoint " << gettid() << " func(" << fid << ")"; + // if (fid == -1) { + // LOGV(DEBUG) << "skip checkpoint"; + // return; + // } std::unique_lock as_ul(wamr->as_mtx); wamr->lwcp_list[gettid()]++; @@ -306,11 +306,11 @@ void lightweight_uncheckpoint(WASMExecEnv *exec_env) { if (((AOTFrame *)exec_env->cur_frame)) { fid = (((AOTFrame *)exec_env->cur_frame)->func_index); } -// LOGV(DEBUG) << "uncheckpoint " << gettid() << " func(" << fid << ")"; -// if (fid == -1) { -// LOGV(DEBUG) << "skip uncheckpoint"; -// return; -// } + // LOGV(DEBUG) << "uncheckpoint " << gettid() << " func(" << fid << ")"; + // if (fid == -1) { + // LOGV(DEBUG) << "skip uncheckpoint"; + // return; + // } std::unique_lock as_ul(wamr->as_mtx); if (wamr->lwcp_list[gettid()] == 0) { // someone has reset our counter diff --git a/src/wamr_native.cpp b/src/wamr_native.cpp index 4448998..2481abb 100644 --- a/src/wamr_native.cpp +++ b/src/wamr_native.cpp @@ -52,10 +52,10 @@ static void dgemm_wrapper(wasm_exec_env_t exec_env, int32_t m, int32_t n, int32_ // fprintf(stderr, "CUBLAS matrix mul took: %f [s]\n", miliseconds / 1000); #else auto begin = clock(); - cblas_dgemm(CblasColMajor, CblasNoTrans, CblasNoTrans, m, n, k, alpha, a, lda, b, ldb, beta, c, ldc); + cblas_dgemm(CblasColMajor, CblasNoTrans, CblasNoTrans, m, n, k, alpha, a, m, b, k, beta, c, m); auto end = clock(); auto time_spent = (double)(end - begin) / CLOCKS_PER_SEC; -// fprintf(stderr, "CPU matrix mul took: %f [s]\n", time_spent); + fprintf(stderr, "CPU matrix mul took: %f [s]\n", time_spent); #endif #endif }