Questions tagged [halide]
For question related to the Halide domain-specific language including scheduling, and computations. Halide supports different languages such as C, C++, Matlab/octave and Python. Please consider a language tag as well.
237
questions
0
votes
1
answer
18
views
Including ComplexExpr and ComplexFunc classes in Halide API
The ComplexExpr and ComplexFunc classes in the links below seem very convenient to work with complex numbers. Is there a plan to include them into the official Halide API? Or is there a reason why ...
0
votes
0
answers
19
views
Non-associative RDOM parallellization in Halide
I am trying to write a decoder for GPU. My encoding scheme has data dependencies between lines. So when decoding columns of data each column depends on the previous. I want to parallellize the ...
0
votes
0
answers
30
views
Visual studio 0xc00007b vcpkg dll libs
I am trying to process images with Halide language. For that, I need some library packages that I have installed from vcpkg (libpng16.lib and jpeg.lib). It needs their dlls, and what I do is copy the ...
0
votes
1
answer
51
views
Cannot find libHalide.so to build
I'd like to build the Halide tutorials on mac.
The instruction says:
// On os x:
// g++ lesson_02*.cpp -g -I <path/to/Halide.h> -I <path/to/tools/halide_image_io.h> -L <path/to/...
0
votes
0
answers
51
views
How to convert Halide::Buffer<unsigned char> to c++ array
In lesson_02_input_image.cpp, I am trying to transpose Buffer<uint8_t> type data to a c++ array so that compare the time consumption between halide and c++. The code is like :
Halide::Buffer<...
1
vote
0
answers
45
views
Halide Error: Input buffer b0 is accessed at -1, which is before the min (0) in dimension 0 - sobel edge detector
I'm trying to develop a sobel edge detector using Halide.
Because I need to compute the 3x3 square around each pixel, I'm trying to realize the function over a smaller rectangle (and avoid the outer ...
1
vote
1
answer
81
views
How to derive a class that is already derived from Halide::Generator?
I would like to create a basic inheritance structure based on Halide::Generator in Halide/C++, so as to avoid duplicated code.
The idea is to have an abstract base generator class that owns a pure ...
0
votes
1
answer
152
views
Linker gives undefined symbols error when cross compiling Halide
Hey I'm trying to build Halide into static library for arm64-v8a Android architecture on the host OSX system. When I run the following commands I get the linking errors below. Which part am I doing ...
0
votes
1
answer
136
views
How to calculate maximum/minimum over n-channels in Halide using domains?
I am currently trying out Halide, playing around with calculating the maximum/minimum over all channels of an image. I would like to achieve this for a arbitrary images, where the amount of channels ...
1
vote
1
answer
113
views
How to calculate chroma image in Halide?
I am currently evaluating if Halide is a good choice for my programmes. As a short Hello Halide example, I wanted to convert an rgb image to hsl space. However, when trying, I got stuck at the first ...
2
votes
2
answers
224
views
HEXAGON Halide Tools 2.3: /usr/bin/ld: cannot find -lc++abi
I did not get response from Qualcomm forum so I decided to post here. When I was trying to run examples of Halide for Hexagon by running make run as written in the document. Then I got the following ...
0
votes
1
answer
100
views
How to load_image() in Halide with 4 channels instead of 3?
I want to get a 4 channel image instead of 3 while loading it in Halide, however load_image() gives only 3 channel images. How can I solve it?
0
votes
2
answers
124
views
CMake for Halide Hexagon failed while successfully compiled using g++
I am writing CMake file for the following command:
g++ --std=c++11 -DLOG2VLEN=7 -DRUN=1 -DASSEMBLY=1 -DBITCODE=1 -I
/home/user/Qualcomm/HALIDE_Tools/2.2.06/Halide/include -fno-rtti -O3 -g
...
0
votes
1
answer
57
views
Halide: image shifts to top-left after convolution using a large patch
I encounter a strange issue during convolution using Halide. Below is the code
Func Deblur::filter2D(Func ima, Func ker, RDom r) {
Func blur{"blur1"};
blur(x, y, c) += ker(r.x, r.y) ...
0
votes
1
answer
41
views
Why is the extern func called multiple times?
Recently, I tried using the defin_extern method defined by Halide with AOT mode.
The description code of the Halide frontend is as follows:
class ExternFuncInput : public Generator<ExternFuncInput&...
3
votes
0
answers
99
views
Efficient Image Normalization in Halide
I've discover Halide (the language), a few weeks ago and I actually enjoy trying to optimize some parts of my code with it, nonetheless, I struggle to find an optimized implementation of a very basic ...
1
vote
1
answer
60
views
Is there a Halide::BoundaryConditions to mimic OpenCV default border type?
The documentation says this is similar to GL_MIRRORED_REPEAT. I tried to research this, but it doesn't seem as specific as the OpenCV border types.
BORDER_REFLECT_101 as gfedcb|abcdefgh|gfedcba, ...
0
votes
1
answer
101
views
Halide - sort buffer/function in one dimension
I am currently using Halide with the use of a generator and ahead of time compilation.
Somewhere in the pipeline I have a 3D buffer with limited extent (typically 3-6 values) in one of the dimensions.
...
0
votes
0
answers
89
views
Sorting a list of tuple according to integer value of on of the tuple members
I have Halide func which is iterating over a gray image and finding highest gray value in 3x3 patch. I am using RDOM to search for largest gray value in 3x3 patch, which returns a Tuple of the X,Y ...
3
votes
0
answers
265
views
How to prevent Halide 'select' from evaluating both branches
The select expression in Halide is similar to if or switch statement in C. That is to say, the expression select(cond, a, b) will evaluate to a if cond is true, otherwise it evaluates to b.
So, I ...
0
votes
1
answer
35
views
how to use define_extern in Halide with JIT?
when i compile the "extern_stage.cpp" in Halide/test/correctness/extern_stage.cpp, cmd as follow:
g++ extern_stage.cpp -g -I ../../../Halide/build/include/ -L ../../../Halide/bin -lHalide -...
1
vote
1
answer
210
views
Issues setting stride in Halide python bindings (Error: Constraint violated: brighten.stride.0 (1) == 3 (3))
I'm trying to use a C memory layout (RGBRGBRGBRGB) instead of planar from an AOT compiled halide function (build and run with the python bindings.) Following the C++ tutorial here, I set the stride ...
1
vote
1
answer
190
views
Halide non-contiguous memory layout
Is it possible to use non-c/fortran ordering in Halide? (where given dimensions x, y, c, x varies the fastest, then c varies the 2nd fastest (strides in numpy at least would be: .strides = (W*C, 1, W) ...
1
vote
1
answer
293
views
Sum of array in Halide
I've started learning Halide. Suppose I wanted to calculate the sum of elements in an array. Why is the following code snippet failing?
constexpr int N = 10;
ImageParam array(Float(32), 1);
Var x;
...
1
vote
1
answer
244
views
When trying to build Halide on Linux system with llvm-10.0 on release/10.x and master branches, facing the below issue
[ 53%] Linking CXX executable test_function_dag
/bin/ld: ../../libHalide.so.10.0.0: undefined reference to `typeinfo for llvm::SectionMemoryManager'
collect2: error: ld returned 1 exit status
make[2]: ...
1
vote
1
answer
129
views
How to solve Halide Constraint violation problem (in Python)
Can anyone help?
I've implemented a halide aot function in python to compute a histogram of a grayscale image... I create a numpy array to hold the histogram like so:
histo = np.empty((1, 2048), dtype=...
0
votes
1
answer
102
views
How do I keep passing the output of a Halide pipeline back into the pipeline until some condition is met?
I have a Halide pipeline which takes in an image, and applies some filters to it. It works fine for a single pass. I pass in an image, and I get the processed image as the output. What I would like to ...
0
votes
1
answer
164
views
Halide JIT vs Generator Differences
While playing around with Halide, I see that totally different pseudocodes are created for a same pipline when using JIT and a generated function approaches. It looks like I'm missing something and so ...
0
votes
1
answer
91
views
Is there a way to specifiy a Halide computation that operates on quartets of pixels?
In Halide, is there a way to split up an input image into 2x2 quartets of pixels and implement a unique computation in each pixel of the quartet?
For example, I want to implement the following ...
0
votes
1
answer
92
views
How to build a windows static library for lesson15 under windows platform?
I have successful built the LLVM and Halide with Visual studio 2019 on windows platform.
I then tried to make some no_runtime objs and a halide_runtime obj and link them together.
./lesson_15_generate ...
0
votes
1
answer
114
views
How do I use declare a halide Func with float16_t?
let say I want to perform a running horizontal average on x-axis of an image.
Func g;
g(x,y) = (img(x-1,y) + img(x,y) + img(x+1,y))/3.f;
h(x,y) = cast<uint8_t>(g(x,y) + 0.5f);
Using float32 for ...
0
votes
1
answer
209
views
Halide process average of color image
I am starting to learn Halide. What I want to do is apply a filter based on the average value of an RGB image. Essentially, I am trimming the highlights and the lows for further processing. I need the ...
1
vote
1
answer
82
views
how do I dispatch the functions that generated by halide (tutorial lesson 15)?
The tutorial generates 3 functions with different target and pack into a single static library along with halide runtime.
The question is, how do I call it ?
To my understanding, I should check the ...
0
votes
1
answer
138
views
How to debug Halide internal error with CodeGen_LLVM
I have problems finding the source of an error message reported by JIT-compiled pipeline with halide.
The log message is:
Internal Error at Halide-release_2019_08_27/halide/src/CodeGen_LLVM.cpp:2815 ...
1
vote
1
answer
230
views
How do I switch auto-scheduler of "lesson 21: Auto-Scheduler" to Adam2019 or Li2018
I believe that the auto-scheduler adopted in lesson_21_auto_scheduler_generate.cpp is a classical Mullapudi2016 algorithm.
How do I switch this auto-scheduler to Adam2019 or Li2018 for this lesson ?
...
1
vote
1
answer
102
views
Speed up compilation and bench-marking of schedules
I am making a program that is bench-marking a lot of generated schedules for a particular algorithm. But that is taking a lot of time, for the most part due to the compilation of each schedule. And I ...
0
votes
1
answer
110
views
Buffer Argument is NULL
I am new to Halide and was given a image processing Pipeline. I am trying to understand this pipe line by printing values. Following the tutorial from https://halide-lang.org/tutorials/...
0
votes
1
answer
132
views
how to free a CPU buffer defined in halide
my projec used the buffer both in GPU and CPU.
code are similar like this:
xxx = HalideBuffer_n(width, heght, 1); // buffer in CPU
xxx.device_malloc(device); // buffer in GPU
PS: using ...
1
vote
1
answer
150
views
Halide with GPU schedule produce black image
I'm trying to learn Halide and I can't get GPU right, because it generate black images when scheduled for GPU. For CPU it produce good result (when comment out brighter.gpu_tile(x, y, xo, yo, xi, yi, ...
-3
votes
1
answer
179
views
Error while compiling Halide program using Linux command in Windows environment through Cygwin
I downloaded Halide binaries for Linux. For compiling the tutorial programs(especially the autoscheduler program), I need to install g++ version 5.3. But, I am not able to install this particular ...
0
votes
1
answer
205
views
How does Func.realize in Halide works?
I can understand the explanation in tutorial 6, which is:
// Func gradient("gradient");
// Var x("x"), y("y");
// gradient(x, y) = x + y;
// gradient.realize(8, 8);
//
// This does three things ...
0
votes
2
answers
194
views
Not able to save image in png format while using Halide
I tried running the following program on a Windows machine using Visual Studio:
#include <Halide.h>
#include "halide_image_io.h"
#include "png.h"
using namespace Halide;
using namespace Halide:...
1
vote
1
answer
248
views
The visibility of halide_library in subdirectory using CMake building system
It seems that the Halide library created using:
halide_library(xxx SRCS xxx_generator.cpp)
in CMakeLists.txt in a subdirectory is invisible to its parent or parallel-directories.
For example, I ...
0
votes
1
answer
111
views
Cannot find -lHalide when compiling a toy program
I've been trying to install and use Halide.
I installed Halide by doing the following:
I cloned the Halide repo then executed the following commands from the root of the repository.
mkdir build
cd ...
0
votes
1
answer
40
views
Halide: Var declaration format
When declaring a Var inside a Halite generator class, why does one need to use curly braces like
Var x{"x"}
if it is outside the function of generate(), while if it is inside the function of ...
0
votes
1
answer
106
views
Halide: Cannot print in Generator - "!function_takes_user_context(op->name)"
When I try to print() an expression within a generator, I cannot build:
Internal Error at /home/halidenightly/build_bot/worker/linux-64-gcc53-800/halide/src/CodeGen_OpenCL_Dev.cpp:229 triggered by ...
0
votes
1
answer
112
views
Halide index error when using AutoScheduler and GPU Schedule, but not default CPU schedule
I am using a Generator to create a static library for my Halide module. I am comparing the default schedule, AutoScheduler, and a GPU schedule that uses simple tiling. I have two inputs of the same ...
1
vote
1
answer
95
views
How to debug Halide's print_when() only when environment variable is set?
I'd like to set an environment variable when running my code, e.g. DEBUG=TRUE ./run_my_halide_program, and only see the output of Halide's print_when() statements when said variable is set. However, ...
0
votes
2
answers
151
views
How to operate on a neighborhood or patch of surrounding pixels?
This question is for the Halide language.
Say for a particular (x, y), I want to operate on a KxK patch around (x, y). E.g. sum them, square them, etc., to get the obtain the new value for (x, y).
...
0
votes
1
answer
146
views
CommandLine error in autoscheduler "Li2018" Halide
I want to test the autoscheduler "Li2018" on Ubuntu16.04. I exploit dlopen to load the libgradient_autoscheduler.so to my pipeline (the plugin of autoscheduler Li2018) and build it, but when I ran the ...