-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add halide official tutorial03 with my own code
- Loading branch information
1 parent
0da0d4f
commit c558103
Showing
3 changed files
with
41 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 1,5 @@ | ||
{ | ||
"cmake.configureSettings": { | ||
"CMAKE_TOOLCHAIN_FILE": "C:/src/vcpkg/scripts/buildsystems/vcpkg.cmake" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 1,20 @@ | ||
cmake_minimum_required(VERSION 3.21) | ||
|
||
project(halide_tutorial03) | ||
|
||
set(CMAKE_CXX_STANDARD 17) | ||
set(CMAKE_CXX_STANDARD_REQUIRED YES) | ||
set(CMAKE_CXX_EXTENSIONS NO) | ||
|
||
find_package(Halide REQUIRED) | ||
|
||
add_executable( | ||
${PROJECT_NAME} | ||
main.cpp | ||
) | ||
|
||
target_link_libraries( | ||
${PROJECT_NAME} | ||
PRIVATE | ||
Halide::Halide | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 1,16 @@ | ||
#include "Halide.h" | ||
#include <stdio.h> | ||
|
||
using namespace Halide; | ||
|
||
int main() | ||
{ | ||
Func gradient("gradient"); | ||
Var x("x"), y("y"); | ||
Expr e = x y; | ||
gradient(x, y) = e; | ||
Buffer<int> output = gradient.realize({8, 8}); | ||
gradient.compile_to_lowered_stmt("gradient.html", {}, HTML); | ||
printf("Success!\n"); | ||
return 0; | ||
} |