Repository: alibaba/GraphScope (language: python)

Issue:
interactive: Fix the warning of flex compilation
Fix the compilation warning when use aocc compiler.


Discussion / hints:
```bash
clang-16: warning: -lopen-pal: 'linker' input unused [-Wunused-command-line-argument]
```
```
warning: lambda capture 'this' is not used [-Wunused-lambda-capture]
unused variable  ...
```


Fix patch:
diff --git a/.github/workflows/flex.yml b/.github/workflows/flex.yml
index 9f7b4f41b4c8..2cfd15d31bb2 100644
--- a/.github/workflows/flex.yml
+++ b/.github/workflows/flex.yml
@@ -72,6 +72,34 @@ jobs:
                  -DBUILD_ODPS_FRAGMENT_LOADER=${{ matrix.BUILD_ODPS_FRAGMENT_LOADER }}
         sudo make -j4
 
+  test-AOCC-compilation:
+    runs-on: ubuntu-20.04
+    container:
+      image: registry.cn-hongkong.aliyuncs.com/graphscope/hqps-server-base:v0.0.9
+    steps:
+    - uses: actions/checkout@v3
+
+    - name: Download aocc compiler
+      run: |
+        cd ${GITHUB_WORKSPACE}/flex
+        wget https://download.amd.com/developer/eula/aocc/aocc-4-1/aocc-compiler-4.1.0_1_amd64.deb
+        sudo apt-get update && sudo apt-get install libncurses-dev libncurses5-dev
+        sudo dpkg -i aocc-compiler-4.1.0_1_amd64.deb
+    
+    - name: Test AOCC compiler
+      env:
+        CC: clang
+        CXX: clang++
+        OMPI_CC: clang
+        OMPI_CXX: clang++
+      run: |
+        . /opt/AMD/aocc-compiler-4.1.0/setenv_AOCC.sh
+        cd ${GITHUB_WORKSPACE}/flex
+        git submodule update --init
+        mkdir build && cd build
+        cmake .. -DBUILD_DOC=OFF -DCMAKE_BUILD_TYPE=DEBUG
+        sudo make -j4
+
   test-flex:
     runs-on: ubuntu-20.04
     if: ${{ github.repository == 'alibaba/GraphScope' }}
diff --git a/flex/CMakeLists.txt b/flex/CMakeLists.txt
index 7384c052d32d..0474fac2c6fa 100644
--- a/flex/CMakeLists.txt
+++ b/flex/CMakeLists.txt
@@ -65,13 +65,13 @@ if (APPLE)
     set(CMAKE_MACOSX_RPATH ON)
 else ()
     if (CMAKE_CXX_COMPILER_ID MATCHES "Clang")
-        set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fopenmp -Wl,-rpath,$ORIGIN -lopen-pal")
+        set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -lopen-pal")
     else ()
-        set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fopenmp -Werror -Wl,-rpath,$ORIGIN")
+        set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wl,-rpath,$ORIGIN")
     endif ()
 endif ()
 
-set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++17 -Wall -fPIC")
+set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fopenmp -Werror -std=c++17 -Wall -fPIC")
 set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -O0 -g")
 set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -O3 -g")
 
diff --git a/flex/bin/rt_bench.cc b/flex/bin/rt_bench.cc
index b744b9893dd5..68e376bece08 100644
--- a/flex/bin/rt_bench.cc
+++ b/flex/bin/rt_bench.cc
@@ -218,12 +218,12 @@ int main(int argc, char** argv) {
   int ac = 1;
   char* av[] = {(char*) "rt_bench"};
   app.run(ac, av, [shard_num] {
-    return seastar::parallel_for_each(
-               boost::irange<unsigned>(0u, shard_num),
-               [](unsigned id) {
-                 return seastar::smp::submit_to(
-                     id, [id] { return Req::get().simulate(); });
-               })
+    return seastar::parallel_for_each(boost::irange<unsigned>(0u, shard_num),
+                                      [](unsigned id) {
+                                        return seastar::smp::submit_to(id, [] {
+                                          return Req::get().simulate();
+                                        });
+                                      })
         .then([] {
           hiactor::actor_engine().exit();
           fmt::print("Exit actor system.\n");
diff --git a/flex/codegen/src/hqps/hqps_limit_builder.h b/flex/codegen/src/hqps/hqps_limit_builder.h
index be9280f0667b..75ef6eae764b 100644
--- a/flex/codegen/src/hqps/hqps_limit_builder.h
+++ b/flex/codegen/src/hqps/hqps_limit_builder.h
@@ -43,7 +43,6 @@ class LimitOpBuilder {
   }
 
  private:
-  int32_t lower_, upper_;
   BuildingContext& context_;
   algebra::Range range_;
 };
diff --git a/flex/engines/hqps_db/core/base_engine.h b/flex/engines/hqps_db/core/base_engine.h
index e0425dff6c58..ba01e925c482 100644
--- a/flex/engines/hqps_db/core/base_engine.h
+++ b/flex/engines/hqps_db/core/base_engine.h
@@ -659,7 +659,6 @@ class BaseEngine {
                                            real_y_ind0, real_y_ind1>(ctx_x,
                                                                      ctx_y);
 
-    double t0 = -grape::GetCurrentTime();
     std::unordered_map<ctx_x_ele_t, int, boost::hash<ctx_x_ele_t>> join_key_map;
     {
       for (auto iter : ctx_x) {
@@ -683,8 +682,6 @@ class BaseEngine {
     }
     LOG(INFO) << "total entry size in map: " << join_key_map.size();
 
-    t0 += grape::GetCurrentTime();
-
     for (auto iter : ctx_x) {
       auto eles = iter.GetAllElement();
       auto datas = iter.GetAllData();
@@ -983,7 +980,6 @@ class BaseEngine {
     new_offsets.emplace_back(0);
 
     size_t ind_x = 0;
-    size_t ind_x_limit = head_x.Size();
     auto x_iter = head_x.begin();
     auto x_end = head_x.end();
     auto y_iter = head_y.begin();
diff --git a/flex/engines/hqps_db/core/operator/path_expand.h b/flex/engines/hqps_db/core/operator/path_expand.h
index c44ea8f32ded..d724ea0cf3a3 100644
--- a/flex/engines/hqps_db/core/operator/path_expand.h
+++ b/flex/engines/hqps_db/core/operator/path_expand.h
@@ -486,7 +486,6 @@ class PathExpand {
 
     double visit_array_time = 0.0;
     for (auto cur_hop = 1; cur_hop < range.limit_; ++cur_hop) {
-      double t0 = -grape::GetCurrentTime();
       std::vector<size_t> unused;
       std::tie(tmp_vec, unused) = graph.GetOtherVerticesV2(
           src_label, edge_expand_opt.other_label_, edge_expand_opt.edge_label_,
diff --git a/flex/engines/hqps_db/database/adj_list.h b/flex/engines/hqps_db/database/adj_list.h
index 5f3ee9cdc1fa..003495cfc24d 100644
--- a/flex/engines/hqps_db/database/adj_list.h
+++ b/flex/engines/hqps_db/database/adj_list.h
@@ -586,7 +586,6 @@ class AdjListArray<grape::EmptyType> {
         dynamic_cast<const typed_csr_base_t*>(csr);
     if (casted_csr) {
       for (auto v : vids) {
-        auto edges = casted_csr->get_edges(v);
         slices_.emplace_back(
             std::make_pair(casted_csr->get_edges(v), slice_t()));
       }
diff --git a/flex/engines/hqps_db/structures/multi_vertex_set/general_vertex_set.h b/flex/engines/hqps_db/structures/multi_vertex_set/general_vertex_set.h
index 5d79ca4fcd30..4e16c373a797 100644
--- a/flex/engines/hqps_db/structures/multi_vertex_set/general_vertex_set.h
+++ b/flex/engines/hqps_db/structures/multi_vertex_set/general_vertex_set.h
@@ -810,7 +810,6 @@ class GeneralVertexSet {
       res_data_vec.reserve(repeat_vec.back());
       for (size_t i = 0; i + 1 < cur_offset.size(); ++i) {
         auto times_to_repeat = repeat_vec[i + 1] - repeat_vec[i];
-        auto num_ele = cur_offset[i + 1] - cur_offset[i];
         for (size_t j = 0; j < times_to_repeat; ++j) {
           for (auto k = cur_offset[i]; k < cur_offset[i + 1]; ++k) {
             res_vec.emplace_back(vec_[k]);
diff --git a/flex/engines/hqps_db/structures/multi_vertex_set/multi_label_vertex_set.h b/flex/engines/hqps_db/structures/multi_vertex_set/multi_label_vertex_set.h
index 816889cc2a78..7ff3fc0329cb 100644
--- a/flex/engines/hqps_db/structures/multi_vertex_set/multi_label_vertex_set.h
+++ b/flex/engines/hqps_db/structures/multi_vertex_set/multi_label_vertex_set.h
@@ -256,7 +256,6 @@ class MultiLabelVertexSet {
     std::vector<std::vector<offset_t>> indices_vec(N);
     std::array<std::vector<offset_t>, N> local_offsets;
 
-    size_t cur_cnt = 0;
     for (size_t i = 0; i < N; ++i) {
       local_offsets[i].emplace_back(0);
     }
diff --git a/flex/engines/hqps_db/structures/multi_vertex_set/row_vertex_set.h b/flex/engines/hqps_db/structures/multi_vertex_set/row_vertex_set.h
index 3deef580fc44..c06373f45843 100644
--- a/flex/engines/hqps_db/structures/multi_vertex_set/row_vertex_set.h
+++ b/flex/engines/hqps_db/structures/multi_vertex_set/row_vertex_set.h
@@ -1302,9 +1302,6 @@ class RowVertexSetImpl<LabelT, VID_T, grape::EmptyType> {
   // Filter current vertices with expression.
   template <typename EXPR>
   std::pair<self_type_t, std::vector<offset_t>> Filter(EXPR&& expr) {
-    // Expression contains the property name, we extract vertex store here.
-    static constexpr size_t num_args = EXPR::num_args;
-
     size_t cur = 0;
     std::vector<offset_t> offset;
     std::vector<lid_t> res_lids;
diff --git a/flex/engines/hqps_db/structures/multi_vertex_set/two_label_vertex_set.h b/flex/engines/hqps_db/structures/multi_vertex_set/two_label_vertex_set.h
index c532ef94480e..80adf0efbed8 100644
--- a/flex/engines/hqps_db/structures/multi_vertex_set/two_label_vertex_set.h
+++ b/flex/engines/hqps_db/structures/multi_vertex_set/two_label_vertex_set.h
@@ -1289,9 +1289,7 @@ static auto get_property_tuple_two_label(
     const TwoLabelVertexSet<typename GRAPH_INTERFACE::vertex_id_t, LabelT,
                             VERTEX_SET_PROP_T...>& general_set,
     const std::array<std::string, sizeof...(T)>& prop_names) {
-  double t0 = -grape::GetCurrentTime();
   auto& label_array = general_set.GetLabels();
-  t0 += grape::GetCurrentTime();
 
   // Get data for multilabel vertices, mixed
   // double t1 = -grape::GetCurrentTime();
diff --git a/flex/engines/http_server/CMakeLists.txt b/flex/engines/http_server/CMakeLists.txt
index 2123b59c29f6..b9ebc7be5eb9 100644
--- a/flex/engines/http_server/CMakeLists.txt
+++ b/flex/engines/http_server/CMakeLists.txt
@@ -28,6 +28,20 @@ if (Hiactor_FOUND)
         PUBLIC
         -Wno-attributes)
   target_link_libraries(flex_server Hiactor::hiactor flex_graph_db)
+
+  # Hiactor/seastar could be compiled with a compiler support option: -Wno-maybe-uninitialized, 
+  # so when we are compiling flex with a compiler that does not support this option(e.g. AOCC compiler), 
+  # we need to remove it from INTERFACE_COMPILE_OPTIONS.
+  # Otherwise, we will got error: unrecognized warning option '-Wno-maybe-uninitialized'
+  get_target_property(seastar_options Hiactor::seastar INTERFACE_COMPILE_OPTIONS)
+  include(CheckCXXCompilerFlag)
+  check_cxx_compiler_flag("-Wno-maybe-uninitialized" COMPILER_SUPPORTS_WNO_MAYBE_UNINITIALIZED)
+  if (NOT COMPILER_SUPPORTS_WNO_MAYBE_UNINITIALIZED)
+    list(FILTER seastar_options EXCLUDE REGEX "-Wno-maybe-uninitialized")
+    message(STATUS "remove -Wno-maybe-uninitialized from seastar_options, since not supported by ${CMAKE_CXX_COMPILER_ID} ${CMAKE_CXX_COMPILER_VERSION}")
+  endif ()
+  set_target_properties(Hiactor::seastar PROPERTIES INTERFACE_COMPILE_OPTIONS "${seastar_options}")
+  
   if (BUILD_HQPS)
       target_include_directories(flex_server PUBLIC ${CMAKE_CURRENT_BINARY_DIR}/../hqps/)
       target_link_libraries(flex_server hqps_plan_proto)
diff --git a/flex/engines/http_server/actor/admin_actor.act.cc b/flex/engines/http_server/actor/admin_actor.act.cc
index 0a9f7989468e..aecda0d147ac 100644
--- a/flex/engines/http_server/actor/admin_actor.act.cc
+++ b/flex/engines/http_server/actor/admin_actor.act.cc
@@ -366,7 +366,7 @@ seastar::future<query_result> admin_actor::service_status(
     LOG(INFO) << "Query service has not been inited!";
     res["status"] = "Query service has not been inited!";
   }
-  return seastar::make_ready_future<query_result>(std::move(res.dump()));
+  return seastar::make_ready_future<query_result>(res.dump());
 }
 
 // get node status.
diff --git a/flex/engines/http_server/handler/admin_http_handler.cc b/flex/engines/http_server/handler/admin_http_handler.cc
index 415de6f7110d..fedaa2b62b22 100644
--- a/flex/engines/http_server/handler/admin_http_handler.cc
+++ b/flex/engines/http_server/handler/admin_http_handler.cc
@@ -524,7 +524,7 @@ void admin_http_handler::stop() {
 }
 
 seastar::future<> admin_http_handler::set_routes() {
-  return server_.set_routes([this](seastar::httpd::routes& r) {
+  return server_.set_routes([](seastar::httpd::routes& r) {
     auto admin_graph_handler = new admin_http_graph_handler_impl(
         interactive_admin_group_id, shard_admin_graph_concurrency);
 
diff --git a/flex/engines/http_server/handler/graph_db_http_handler.cc b/flex/engines/http_server/handler/graph_db_http_handler.cc
index 335eec54378d..a82b4e7c590a 100644
--- a/flex/engines/http_server/handler/graph_db_http_handler.cc
+++ b/flex/engines/http_server/handler/graph_db_http_handler.cc
@@ -139,7 +139,7 @@ void graph_db_http_handler::stop() {
 }
 
 seastar::future<> graph_db_http_handler::set_routes() {
-  return server_.set_routes([this](seastar::httpd::routes& r) {
+  return server_.set_routes([](seastar::httpd::routes& r) {
     r.add(seastar::httpd::operation_type::POST,
           seastar::httpd::url("/interactive/query"),
           new graph_db_ic_handler(ic_query_group_id, shard_query_concurrency));
diff --git a/flex/engines/http_server/handler/hqps_http_handler.cc b/flex/engines/http_server/handler/hqps_http_handler.cc
index 9c1be8730ffd..5b57cc5bb384 100644
--- a/flex/engines/http_server/handler/hqps_http_handler.cc
+++ b/flex/engines/http_server/handler/hqps_http_handler.cc
@@ -165,7 +165,7 @@ seastar::future<> hqps_adhoc_query_handler::cancel_current_scope() {
           hiactor::scope<hiactor::actor_group>(cur_codegen_group_id_));
   return hiactor::actor_engine()
       .cancel_scope_request(adhoc_builder, false)
-      .then([this, codegen_builder] {
+      .then([codegen_builder] {
         LOG(INFO) << "Cancel adhoc scope successfully!";
         return hiactor::actor_engine().cancel_scope_request(codegen_builder,
                                                             false);
@@ -334,7 +334,7 @@ seastar::future<> hqps_http_handler::stop_query_actors() {
         LOG(INFO) << "Cancel ic scope";
         return adhoc_query_handler_->cancel_current_scope();
       })
-      .then([this] {
+      .then([] {
         LOG(INFO) << "Cancel adhoc scope";
         return seastar::make_ready_future<>();
       });
diff --git a/flex/engines/http_server/workdir_manipulator.cc b/flex/engines/http_server/workdir_manipulator.cc
index 56106449c784..74668578c775 100644
--- a/flex/engines/http_server/workdir_manipulator.cc
+++ b/flex/engines/http_server/workdir_manipulator.cc
@@ -1229,9 +1229,7 @@ gs::Result<seastar::sstring> WorkDirManipulator::disable_procedure_on_graph(
   // error: procedure already exists.
   // remove procedure from enable_lists
   auto new_enable_list = YAML::Node(YAML::NodeType::Sequence);
-  int ind = -1;
   for (auto iter = enable_lists.begin(); iter != enable_lists.end(); iter++) {
-    ind += 1;
     if (iter->as<std::string>() == procedure_name) {
       LOG(INFO) << "Found procedure " << procedure_name << " in enable_lists";
       break;
diff --git a/flex/storages/rt_mutable_graph/loader/csv_fragment_loader.cc b/flex/storages/rt_mutable_graph/loader/csv_fragment_loader.cc
index 8d7ea433357f..490374359e27 100644
--- a/flex/storages/rt_mutable_graph/loader/csv_fragment_loader.cc
+++ b/flex/storages/rt_mutable_graph/loader/csv_fragment_loader.cc
@@ -23,7 +23,7 @@ CSVStreamRecordBatchSupplier::CSVStreamRecordBatchSupplier(
     arrow::csv::ConvertOptions convert_options,
     arrow::csv::ReadOptions read_options,
     arrow::csv::ParseOptions parse_options)
-    : label_id_(label_id), file_path_(file_path) {
+    : file_path_(file_path) {
   auto read_result = arrow::io::ReadableFile::Open(file_path);
   if (!read_result.ok()) {
     LOG(FATAL) << "Failed to open file: " << file_path
@@ -58,7 +58,7 @@ CSVTableRecordBatchSupplier::CSVTableRecordBatchSupplier(
     arrow::csv::ConvertOptions convert_options,
     arrow::csv::ReadOptions read_options,
     arrow::csv::ParseOptions parse_options)
-    : label_id_(label_id), file_path_(path) {
+    : file_path_(path) {
   auto read_result = arrow::io::ReadableFile::Open(path);
   if (!read_result.ok()) {
     LOG(FATAL) << "Failed to open file: " << path
diff --git a/flex/storages/rt_mutable_graph/loader/csv_fragment_loader.h b/flex/storages/rt_mutable_graph/loader/csv_fragment_loader.h
index 5be16ff002de..39bfaebb3fde 100644
--- a/flex/storages/rt_mutable_graph/loader/csv_fragment_loader.h
+++ b/flex/storages/rt_mutable_graph/loader/csv_fragment_loader.h
@@ -43,7 +43,6 @@ class CSVStreamRecordBatchSupplier : public IRecordBatchSupplier {
   std::shared_ptr<arrow::RecordBatch> GetNextBatch() override;
 
  private:
-  label_t label_id_;
   std::string file_path_;
   std::shared_ptr<arrow::csv::StreamingReader> reader_;
 };
@@ -58,7 +57,6 @@ class CSVTableRecordBatchSupplier : public IRecordBatchSupplier {
   std::shared_ptr<arrow::RecordBatch> GetNextBatch() override;
 
  private:
-  label_t label_id_;
   std::string file_path_;
   std::shared_ptr<arrow::Table> table_;
   std::shared_ptr<arrow::TableBatchReader> reader_;
diff --git a/flex/storages/rt_mutable_graph/loader/odps_fragment_loader.cc b/flex/storages/rt_mutable_graph/loader/odps_fragment_loader.cc
index 6ae32c7395b3..5167317c343d 100644
--- a/flex/storages/rt_mutable_graph/loader/odps_fragment_loader.cc
+++ b/flex/storages/rt_mutable_graph/loader/odps_fragment_loader.cc
@@ -253,8 +253,7 @@ ODPSStreamRecordBatchSupplier::ODPSStreamRecordBatchSupplier(
     label_t label_id, const std::string& file_path,
     const ODPSReadClient& odps_table_reader, const std::string& session_id,
     int split_count, TableIdentifier table_identifier)
-    : label_id_(label_id),
-      file_path_(file_path),
+    : file_path_(file_path),
       odps_read_client_(odps_table_reader),
       session_id_(session_id),
       split_count_(split_count),
@@ -311,11 +310,9 @@ ODPSTableRecordBatchSupplier::ODPSTableRecordBatchSupplier(
     label_t label_id, const std::string& file_path,
     const ODPSReadClient& odps_table_reader, const std::string& session_id,
     int split_count, TableIdentifier table_identifier, int thread_num)
-    : label_id_(label_id),
-      file_path_(file_path),
+    : file_path_(file_path),
       odps_read_client_(odps_table_reader),
       session_id_(session_id),
-      split_count_(split_count),
       table_identifier_(table_identifier) {
   // Read the table.
   table_ = odps_read_client_.ReadTable(session_id, split_count,
diff --git a/flex/storages/rt_mutable_graph/loader/odps_fragment_loader.h b/flex/storages/rt_mutable_graph/loader/odps_fragment_loader.h
index 2cea046e40c4..a894be69b2bb 100644
--- a/flex/storages/rt_mutable_graph/loader/odps_fragment_loader.h
+++ b/flex/storages/rt_mutable_graph/loader/odps_fragment_loader.h
@@ -125,7 +125,6 @@ class ODPSStreamRecordBatchSupplier : public IRecordBatchSupplier {
   std::shared_ptr<arrow::RecordBatch> GetNextBatch() override;
 
  private:
-  label_t label_id_;
   std::string file_path_;
   const ODPSReadClient& odps_read_client_;
   std::string session_id_;
@@ -148,11 +147,9 @@ class ODPSTableRecordBatchSupplier : public IRecordBatchSupplier {
   std::shared_ptr<arrow::RecordBatch> GetNextBatch() override;
 
  private:
-  label_t label_id_;
   std::string file_path_;
   const ODPSReadClient& odps_read_client_;
   std::string session_id_;
-  int split_count_;
   TableIdentifier table_identifier_;
 
   std::shared_ptr<arrow::Table> table_;
diff --git a/flex/utils/property/column.cc b/flex/utils/property/column.cc
index b746255e01d0..5c09ad7fcc96 100644
--- a/flex/utils/property/column.cc
+++ b/flex/utils/property/column.cc
@@ -62,8 +62,8 @@ class TypedEmptyColumn : public ColumnBase {
 template <>
 class TypedEmptyColumn<std::string_view> : public ColumnBase {
  public:
-  TypedEmptyColumn(int32_t max_length = PropertyType::STRING_DEFAULT_MAX_LENGTH)
-      : max_length_(max_length) {}
+  TypedEmptyColumn(
+      int32_t max_length = PropertyType::STRING_DEFAULT_MAX_LENGTH) {}
   ~TypedEmptyColumn() {}
 
   void open(const std::string& name, const std::string& snapshot_dir,
@@ -96,9 +96,6 @@ class TypedEmptyColumn<std::string_view> : public ColumnBase {
   StorageStrategy storage_strategy() const override {
     return StorageStrategy::kNone;
   }
-
- private:
-  int32_t max_length_;
 };
 
 using IntEmptyColumn = TypedEmptyColumn<int32_t>;


Test patch:
diff --git a/flex/tests/hqps/context_test.cc b/flex/tests/hqps/context_test.cc
index fe49fe478f26..e928d702dc39 100644
--- a/flex/tests/hqps/context_test.cc
+++ b/flex/tests/hqps/context_test.cc
@@ -210,22 +210,18 @@ int main() {
     }
     {
       int32_t res = 0;
-      int64_t res0 = 0;
       double t0 = -grape::GetCurrentTime();
       for (size_t j = 0; j < 10; ++j) {
         for (auto ind : indices) {
           res += col1->get_view(ind);
-          res0 += col2->get_view(ind);
         }
       }
       t0 += grape::GetCurrentTime();
 
       double t1 = -grape::GetCurrentTime();
       res = 0;
-      res0 = 0;
       for (auto ind : indices) {
         res += col1->get_view(ind);
-        res0 += col2->get_view(ind);
       }
       t1 += grape::GetCurrentTime();
       LOG(INFO) << "ptr visit cost: " << t1 << " ,warm up took: " << t0
@@ -240,10 +236,8 @@ int main() {
 
       double t1 = -grape::GetCurrentTime();
       int32_t res = 0;
-      int64_t res0 = 0;
       for (auto ind : indices) {
         res += getter1.get_view(ind);
-        res0 += getter2.get_view(ind);
       }
       t1 += grape::GetCurrentTime();
       LOG(INFO) << "bench1 cost: " << t1 << ", res: " << res;