10SN/A//===----------------------------------------------------------------------===// 23233Sksrini// 30SN/A// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 40SN/A// See https://llvm.org/LICENSE.txt for license information. 50SN/A// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 60SN/A// 7553SN/A//===----------------------------------------------------------------------===// 80SN/A 9553SN/A#include <algorithm> 100SN/A 110SN/A#include "common.h" 120SN/A 130SN/Anamespace { 140SN/Atemplate <class ValueType> 150SN/Astruct RangesPopHeap { 160SN/A size_t Quantity; 170SN/A 180SN/A void run(benchmark::State& state) const { 190SN/A runOpOnCopies<ValueType>( 200SN/A state, Quantity, Order(), BatchSize::CountElements, [](auto& Copy) { 21553SN/A for (auto B = Copy.begin(), I = Copy.end(); I != B; --I) { 22553SN/A std::ranges::pop_heap(B, I); 23553SN/A } 240SN/A }); 253233Sksrini } 260SN/A 270SN/A std::string name() const { 280SN/A return "BM_RangesPopHeap" + ValueType::name() + "_" + std::to_string(Quantity); 290SN/A }; 303233Sksrini}; 310SN/A} // namespace 321358SN/A 331358SN/Aint main(int argc, char** argv) { 341358SN/A benchmark::Initialize(&argc, argv); 351358SN/A if (benchmark::ReportUnrecognizedArguments(argc, argv)) 360SN/A return 1; 373233Sksrini makeCartesianProductBenchmark<RangesPopHeap, AllValueTypes>(Quantities); 380SN/A benchmark::RunSpecifiedBenchmarks(); 390SN/A} 400SN/A