This is an automated email from the ASF dual-hosted git repository. andrewzhaoluo pushed a commit to branch aluo/rebase-08312022-autotensorization-fq2i-changes in repository https://gitbox.apache.org/repos/asf/tvm.git
commit b2b0772cc47b69d9ebf7466b2d5225270e801938 Author: Andrew Zhao Luo <[email protected]> AuthorDate: Fri Sep 2 15:08:26 2022 -0700 vm.cc optional --- src/runtime/vm/profiler/vm.cc | 2 +- src/runtime/vm/profiler/vm.h | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/runtime/vm/profiler/vm.cc b/src/runtime/vm/profiler/vm.cc index db8a3f5dc2..0ace910b5c 100644 --- a/src/runtime/vm/profiler/vm.cc +++ b/src/runtime/vm/profiler/vm.cc @@ -73,7 +73,7 @@ PackedFunc VirtualMachineDebug::GetFunction(const std::string& name, invoke(arg_name); prof_.operator*().Stop(); auto report = prof_.operator*().Report(); - prof_ = std::nullopt; // releases hardware counters + prof_ = dmlc::optional<profiling::Profiler>(); // releases hardware counters return report; }); } else if (name == "profile_rpc") { diff --git a/src/runtime/vm/profiler/vm.h b/src/runtime/vm/profiler/vm.h index f0374c75a7..0c9e94c0dd 100644 --- a/src/runtime/vm/profiler/vm.h +++ b/src/runtime/vm/profiler/vm.h @@ -25,11 +25,11 @@ #ifndef TVM_RUNTIME_VM_PROFILER_VM_H_ #define TVM_RUNTIME_VM_PROFILER_VM_H_ +#include <dmlc/optional.h> #include <tvm/runtime/profiling.h> #include <tvm/runtime/vm/vm.h> #include <memory> -#include <optional> #include <string> #include <unordered_map> #include <vector> @@ -55,7 +55,7 @@ class VirtualMachineDebug : public VirtualMachine { void OpStopHook() final; std::unordered_map<Index, std::string> packed_index_map_; - std::optional<profiling::Profiler> prof_; + dmlc::optional<profiling::Profiler> prof_; }; } // namespace vm
