Skip to content

Commit

Permalink
Merge pull request #3 from RootButcher/refactoringMakeIntoCompile
Browse files Browse the repository at this point in the history
Refactoring make into compile
  • Loading branch information
RootButcher authored Apr 21, 2022
2 parents 0f8bce4 + cb841ff commit 6164826
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 4 deletions.
4 changes: 4 additions & 0 deletions src/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@ impl GenBuilder {
///
impl Generator<'static> {
pub fn compile(&self) -> Output {

let mut cmd_compile = Command::new("g++");
cmd_compile.args(["-std=c++17"]);

Expand All @@ -127,14 +128,17 @@ impl Generator<'static> {
.join("tools")
.join("GenGen")
.with_extension("cpp");

cmd_compile.args([
"-g",
self.gen_path.to_str().unwrap(),
temp.to_str().unwrap(),
]);

cmd_compile.args(self.gcc_flags.clone());
//compile.args(["-Wl,-rpath","-Wl,/home/rootbutcher2/CLionProjects/Halide-Rusts-tests/Halide/distrib/lib/"]);
cmd_compile.output().expect("Make generator failed")

}
pub fn run_gen(&self) -> Output {
//assert!(!self.gen_exe.is_none());
Expand Down
2 changes: 1 addition & 1 deletion src/build_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
#[test]
fn it_works() {
let h = GenBuilder::new(
"/home/rootbutcher2/CLionProjects/Halide-Rusts-tests/Halide",
"/home/jacob/Desktop/Halide",
"test_files/",
).out_dir("test_files/").debug(true);
let g = h.new_gen("iir_blur".to_string());
Expand Down
9 changes: 6 additions & 3 deletions test_files/iir_blur.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ Func blur_cols_transpose(Func input, Expr height, Expr alpha, bool skip_schedule
// Transpose the blur.
Func transpose("transpose");
transpose(x, y, c) = blur(y, x, c);

// Schedule
if (!skip_schedule) {
if (!target.has_gpu_feature()) {
Expand Down Expand Up @@ -133,12 +133,15 @@ class IirBlur : public Generator<IirBlur> {
public:
// This is the input image: a 3D (color) image with 32 bit float
// pixels.
Input<Buffer<float>> input{"input",3};

Input<Buffer<float>> input{"input", 3};

// The filter coefficient, alpha is the weight of the input to the
// filter.
Input<float> alpha{"alpha"};

Output<Buffer<float>> output{"output",3};
Output<Buffer<float>> output{"output", 3};


void generate() {

Expand Down

0 comments on commit 6164826

Please sign in to comment.