cuda_quick_start/
cuda_quick_start.rs

1use parabuild::{Parabuilder, RunMethod};
2use serde_json::Value as JsonValue;
3
4fn main() {
5    let project_path = "tests/example_cuda_project"; // your project path
6    let workspaces_path = "workspaces"; // where to store the workspaces, executables, etc.
7    let template_path = "src/main.cu"; // template file in the project
8    let target_executable_file = "build/main"; // target executable file
9    let datas = (0..20)
10        .into_iter()
11        .map(|_| JsonValue::Null)
12        .collect::<Vec<JsonValue>>();
13    let mut parabuilder = Parabuilder::new(
14        project_path,
15        workspaces_path,
16        template_path,
17        &[target_executable_file],
18    )
19    .in_place_template(true)
20    .build_workers(2)
21    .run_method(RunMethod::OutOfPlace(2));
22    parabuilder.set_datas(datas).unwrap();
23    parabuilder.init_workspace().unwrap();
24    parabuilder.run().unwrap();
25}