|
| 1 | +diff --git a/src/runtime/dso_library.cc b/src/runtime/dso_library.cc |
| 2 | +index 81eb30ee1..785fb48ac 100644 |
| 3 | +--- a/src/runtime/dso_library.cc |
| 4 | ++++ b/src/runtime/dso_library.cc |
| 5 | +@@ -115,15 +115,16 @@ void DSOLibrary::Unload() { |
| 6 | + #else |
| 7 | + |
| 8 | + void DSOLibrary::Load(const std::string& name) { |
| 9 | ++ abort(); /* |
| 10 | + lib_handle_ = dlopen(name.c_str(), RTLD_LAZY | RTLD_LOCAL); |
| 11 | + ICHECK(lib_handle_ != nullptr) << "Failed to load dynamic shared library " << name << " " |
| 12 | +- << dlerror(); |
| 13 | ++ << dlerror(); */ |
| 14 | + } |
| 15 | + |
| 16 | +-void* DSOLibrary::GetSymbol_(const char* name) { return dlsym(lib_handle_, name); } |
| 17 | ++void* DSOLibrary::GetSymbol_(const char* name) { abort(); /* return dlsym(lib_handle_, name); */ } |
| 18 | + |
| 19 | + void DSOLibrary::Unload() { |
| 20 | +- dlclose(lib_handle_); |
| 21 | ++ abort(); // dlclose(lib_handle_); |
| 22 | + lib_handle_ = nullptr; |
| 23 | + } |
| 24 | + |
| 25 | +diff --git a/CMakeLists.txt b/CMakeLists.txt |
| 26 | +index 7293abb60..d741ce2a2 100644 |
| 27 | +--- a/CMakeLists.txt |
| 28 | ++++ b/CMakeLists.txt |
| 29 | +@@ -1,6 +1,10 @@ |
| 30 | + cmake_minimum_required(VERSION 3.2) |
| 31 | + project(tvm C CXX) |
| 32 | + |
| 33 | ++set(CMAKE_C_FLAGS ${CMAKE_C_FLAGS} "-static-libgcc -static-libstdc++") |
| 34 | ++set(CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS} "-static-libgcc -static-libstdc++") |
| 35 | ++set(CMAKE_EXE_LINKER_FLAGS "-static-libgcc -static-libstdc++") |
| 36 | ++ |
| 37 | + # Utility functions |
| 38 | + include(cmake/utils/Utils.cmake) |
| 39 | + include(cmake/utils/FindCUDA.cmake) |
| 40 | +@@ -50,7 +54,7 @@ tvm_option(USE_FALLBACK_STL_MAP "Use TVM's POD compatible Map" OFF) |
| 41 | + tvm_option(USE_ETHOSN "Build with Arm Ethos-N" OFF) |
| 42 | + tvm_option(USE_CMSISNN "Build with Arm CMSIS-NN" OFF) |
| 43 | + tvm_option(INDEX_DEFAULT_I64 "Defaults the index datatype to int64" ON) |
| 44 | +-tvm_option(USE_LIBBACKTRACE "Build libbacktrace to supply linenumbers on stack traces" AUTO) |
| 45 | ++# tvm_option(USE_LIBBACKTRACE "Build libbacktrace to supply linenumbers on stack traces" AUTO) |
| 46 | + tvm_option(BUILD_STATIC_RUNTIME "Build static version of libtvm_runtime" OFF) |
| 47 | + tvm_option(USE_PAPI "Use Performance Application Programming Interface (PAPI) to read performance counters" OFF) |
| 48 | + tvm_option(USE_GTEST "Use GoogleTest for C++ sanity tests" AUTO) |
| 49 | +@@ -497,7 +501,7 @@ target_compile_definitions(tvm PUBLIC DMLC_USE_LOGGING_LIBRARY=<tvm/runtime/logg |
| 50 | + target_compile_definitions(tvm_runtime PUBLIC DMLC_USE_LOGGING_LIBRARY=<tvm/runtime/logging.h>) |
| 51 | + |
| 52 | + # logging option for libbacktrace |
| 53 | +-include(cmake/modules/Logging.cmake) |
| 54 | ++# include(cmake/modules/Logging.cmake) |
| 55 | + |
| 56 | + include(cmake/modules/contrib/PAPI.cmake) |
| 57 | + |
| 58 | +diff --git a/src/runtime/threading_backend.cc b/src/runtime/threading_backend.cc |
| 59 | +index 5b3093ac8..ce0d33fa1 100644 |
| 60 | +--- a/src/runtime/threading_backend.cc |
| 61 | ++++ b/src/runtime/threading_backend.cc |
| 62 | +@@ -127,7 +127,7 @@ class ThreadGroup::Impl { |
| 63 | + #if defined(__ANDROID__) |
| 64 | + sched_setaffinity(threads_[i].native_handle(), sizeof(cpu_set_t), &cpuset); |
| 65 | + #else |
| 66 | +- pthread_setaffinity_np(threads_[i].native_handle(), sizeof(cpu_set_t), &cpuset); |
| 67 | ++ abort(); // pthread_setaffinity_np(threads_[i].native_handle(), sizeof(cpu_set_t), &cpuset); |
| 68 | + #endif |
| 69 | + } |
| 70 | + if (exclude_worker0) { // main thread run task |
| 71 | +@@ -167,7 +167,7 @@ class ThreadGroup::Impl { |
| 72 | + #if defined(__ANDROID__) |
| 73 | + sched_setaffinity(pthread_self(), sizeof(cpu_set_t), &cpuset); |
| 74 | + #else |
| 75 | +- pthread_setaffinity_np(pthread_self(), sizeof(cpu_set_t), &cpuset); |
| 76 | ++ abort(); // pthread_setaffinity_np(pthread_self(), sizeof(cpu_set_t), &cpuset); |
| 77 | + #endif |
| 78 | + #endif |
| 79 | + } |
| 80 | +@@ -227,7 +227,7 @@ class ThreadGroup::Impl { |
| 81 | + |
| 82 | + ThreadGroup::ThreadGroup(int num_workers, std::function<void(int)> worker_callback, |
| 83 | + bool exclude_worker0) |
| 84 | +- : impl_(new ThreadGroup::Impl(num_workers, worker_callback, exclude_worker0)) {} |
| 85 | ++ : impl_((abort(), nullptr) /* new ThreadGroup::Impl(num_workers, worker_callback, exclude_worker0) */) {} |
| 86 | + ThreadGroup::~ThreadGroup() { delete impl_; } |
| 87 | + void ThreadGroup::Join() { impl_->Join(); } |
| 88 | + |
| 89 | +diff --git a/src/support/parallel_for.cc b/src/support/parallel_for.cc |
| 90 | +index e90967562..e55ed2b25 100644 |
| 91 | +--- a/src/support/parallel_for.cc |
| 92 | ++++ b/src/support/parallel_for.cc |
| 93 | +@@ -49,6 +49,8 @@ std::vector<std::vector<int>> rr_partitioner(int begin, int end, int step, int n |
| 94 | + |
| 95 | + void parallel_for(int begin, int end, const std::function<void(int)>& f, int step, |
| 96 | + const PartitionerFuncType partitioner) { |
| 97 | ++ abort(); |
| 98 | ++#if 0 |
| 99 | + static bool GLOBAL_PARALLEL_FOR_FLAG{false}; |
| 100 | + static std::mutex M_GLOBAL_PARALLEL_FOR_FLAG; |
| 101 | + { |
| 102 | +@@ -91,10 +93,13 @@ void parallel_for(int begin, int end, const std::function<void(int)>& f, int ste |
| 103 | + } catch (const std::exception& e) { |
| 104 | + LOG(FATAL) << "Parallel_for error with " << e.what(); |
| 105 | + } |
| 106 | ++#endif |
| 107 | + } |
| 108 | + |
| 109 | + void parallel_for_dynamic(int begin, int end, int num_threads, |
| 110 | + const std::function<void(int thread_id, int task_id)>& f) { |
| 111 | ++ abort(); |
| 112 | ++#if 0 |
| 113 | + // Step 1. Sanity checks |
| 114 | + if (begin == end) { |
| 115 | + return; |
| 116 | +@@ -138,6 +143,7 @@ void parallel_for_dynamic(int begin, int end, int num_threads, |
| 117 | + } catch (const std::exception& e) { |
| 118 | + LOG(FATAL) << "RuntimeError: parallel_for_dynamic error with " << e.what(); |
| 119 | + } |
| 120 | ++#endif |
| 121 | + } |
| 122 | + |
| 123 | + } // namespace support |
0 commit comments