Skip to content

Commit

Permalink
chore(benchmark): fix lint errors
Browse files Browse the repository at this point in the history
  • Loading branch information
ashjeong committed Oct 17, 2024
1 parent 0a0d548 commit 5ae9901
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 0 deletions.
3 changes: 3 additions & 0 deletions benchmark/fft/fft_benchmark.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
#include <stdint.h>

#include <iostream>
#include <vector>
#include <memory>


// clang-format off
#include "benchmark/fft/fft_config.h"
Expand Down
4 changes: 4 additions & 0 deletions benchmark/fft/fft_benchmark_gpu.cc
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#if TACHYON_CUDA
#include <iostream>
#include <memory>
#include <vector>

// clang-format off
#include "benchmark/fft/fft_config.h"
Expand Down Expand Up @@ -42,12 +44,14 @@ void Run(const FFTConfig& config) {
reporter.AddVendor(Vendor::TachyonCPU());
reporter.AddVendor(Vendor::TachyonGPU());

// NOLINTNEXTLINE(build/include_what_you_use)
std::vector<size_t> degrees = config.GetDegrees();

FFTRunner<Domain, PolyOrEvals> runner(reporter);

for (size_t degree : degrees) {
PolyOrEvals input = PolyOrEvals::Random(degree);
// NOLINTNEXTLINE(build/include_what_you_use)
std::unique_ptr<Domain> domain = Domain::Create(degree + 1);
bool kShouldRecord = true;

Expand Down
2 changes: 2 additions & 0 deletions benchmark/fft_batch/fft_batch_benchmark.cc
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
#include <iostream>
#include <string>
#include <vector>

#include "absl/strings/substitute.h"

Expand Down
2 changes: 2 additions & 0 deletions benchmark/msm/msm_benchmark.cc
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
#include <iostream>
#include <memory>
#include <vector>

// clang-format off
#include "benchmark/msm/msm_config.h"
Expand Down
8 changes: 8 additions & 0 deletions benchmark/msm/msm_benchmark_gpu.cc
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#if TACHYON_CUDA
#include <iostream>
#include <vector>

// clang-format off
#include "benchmark/msm/msm_config.h"
Expand Down Expand Up @@ -38,28 +39,35 @@ int RealMain(int argc, char** argv) {
config.exponents(),
[](uint32_t exponent) { return base::NumberToString(exponent); }));

// NOLINTNEXTLINE(build/include_what_you_use)
std::vector<size_t> point_nums = config.GetPointNums();

tachyon_bn254_g1_init();
tachyon_bn254_g1_msm_ptr msm =
tachyon_bn254_g1_create_msm(config.exponents().back());

// NOLINTNEXTLINE(build/include_what_you_use)
std::cout << "Generating random points..." << std::endl;
size_t max_point_num = point_nums.back();
VariableBaseMSMTestSet<bn254::G1AffinePoint> test_set;
CHECK(config.GenerateTestSet(max_point_num, &test_set));

// NOLINTNEXTLINE(build/include_what_you_use)
std::cout << "Generation completed" << std::endl;

MSMRunner<bn254::G1AffinePoint> runner(reporter);
runner.SetInputs(test_set.bases, test_set.scalars);

// NOLINTNEXTLINE(build/include_what_you_use)
std::vector<bn254::G1JacobianPoint> results_cpu;
runner.Run(Vendor::TachyonCPU(), tachyon_bn254_g1_affine_msm, msm, point_nums,
results_cpu);
tachyon_bn254_g1_destroy_msm(msm);

tachyon_bn254_g1_msm_gpu_ptr msm_gpu =
tachyon_bn254_g1_create_msm_gpu(config.exponents().back());

// NOLINTNEXTLINE(build/include_what_you_use)
std::vector<bn254::G1JacobianPoint> results_gpu;
runner.Run(Vendor::TachyonGPU(), tachyon_bn254_g1_affine_msm_gpu, msm_gpu,
point_nums, results_gpu);
Expand Down

0 comments on commit 5ae9901

Please sign in to comment.