remove gpu compute stuff (didn't work at all, might revisit later)

This commit is contained in:
Simon Gardling
2021-03-29 12:27:49 +00:00
parent d36bec61f4
commit e07aa5ca0a
3 changed files with 2 additions and 195 deletions

View File

@@ -2,17 +2,8 @@ use chrono::{DateTime, Utc};
use indicatif::{ProgressBar, ProgressStyle};
use physarum::model;
use rand::Rng;
use arrayfire as af;
fn main() {
let gpu_compute: bool = false;
if gpu_compute {
backend_man();
// af::set_backend(af::Backend::CPU);
af::set_device(0);
af::info();
}
// let n_iterations = 16384;
let n_iterations = 1024;
// let n_iterations = 100;
@@ -38,43 +29,11 @@ fn main() {
let mut model = model::Model::new(width, height, n_particles, n_populations, diffusivity);
model.print_configurations();
if gpu_compute {
model.run_cl(n_iterations);
} else {
model.run(n_iterations);
}
model.run(n_iterations);
println!("Rendering all saved image data....");
model.render_all_imgdata();
model.flush_image_data();
println!("Done!");
}
fn backend_man() {
let available = af::get_available_backends();
if available.contains(&af::Backend::CUDA) {
println!("Evaluating CUDA Backend...");
af::set_backend(af::Backend::CUDA);
println!("There are {} CUDA compute devices", af::device_count());
return;
}
/*
if available.contains(&af::Backend::OPENCL) {
println!("Evaluating OpenCL Backend...");
af::set_backend(af::Backend::OPENCL);
println!("There are {} OpenCL compute devices", af::device_count());
return;
}
*/
if available.contains(&af::Backend::CPU) {
println!("Evaluating CPU Backend...");
af::set_backend(af::Backend::CPU);
println!("There are {} CPU compute devices", af::device_count());
return;
}
}
}