Skip to content

Commit

Permalink
Bench consistently with 64-bit input #7
Browse files Browse the repository at this point in the history
  • Loading branch information
jurihock committed Jun 19, 2023
1 parent 3cbec51 commit 4f27ba4
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
8 changes: 4 additions & 4 deletions cpp/examples/bench.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ int main()
const auto window = std::make_pair(+0.5, -0.5);

const auto ta0 = std::chrono::high_resolution_clock::now();
QDFT qdft(samplerate, bandwidth, resolution, latency, window);
QDFT<double, double> qdft(samplerate, bandwidth, resolution, latency, window);
const auto tb0 = std::chrono::high_resolution_clock::now();
const auto e0 = std::chrono::duration_cast<std::chrono::microseconds>(tb0 - ta0).count();

Expand All @@ -24,7 +24,7 @@ int main()
const auto n = 1 * samplerate;
const auto m = qdft.size();

std::vector<float> x(n);
std::vector<double> x(n);
std::vector<std::complex<double>> y(n * m);

const auto runs = 10;
Expand All @@ -33,8 +33,8 @@ int main()
{
std::cout << "RUN\t" << run << "/" << runs << std::endl;

std::fill(x.begin(), x.end(), 0);
std::fill(y.begin(), y.end(), 0);
std::fill(x.begin(), x.end(), 0.0);
std::fill(y.begin(), y.end(), 0.0);

const auto ta1 = std::chrono::high_resolution_clock::now();
qdft.qdft(n, x.data(), y.data());
Expand Down
6 changes: 3 additions & 3 deletions rust/examples/bench.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ fn main() {
let window = Some((0.5, -0.5));

let t0 = Instant::now();
let mut qdft = QDFT::new(
let mut qdft = QDFT::<f64, f64>::new(
samplerate,
bandwidth,
resolution,
Expand All @@ -27,15 +27,15 @@ fn main() {
let n = 1 * samplerate as usize;
let m = qdft.size();

let mut x = vec![f32::zero(); n];
let mut x = vec![f64::zero(); n];
let mut y = vec![c64::zero(); n * m];

let runs = 10;

for run in 1 .. runs + 1 {
println!("RUN\t{}/{}", run, runs);

x.fill(f32::zero());
x.fill(f64::zero());
y.fill(c64::zero());

let t1 = Instant::now();
Expand Down

0 comments on commit 4f27ba4

Please sign in to comment.