You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I would like to run the auto-schedule at runtime for a Func not known at the compilation time.
For that I design a function:
class AutoScheduledDynamic : public Generator<AutoScheduledDynamic>
{
public:
static GeneratorInput<Buffer<f32>> oInput;
static GeneratorOutput<Buffer<f32>> oOutput;
void generate()
{
oStart();
Func oPassthrough{ "Passthrough" };
oPassthrough( x, y, c ) = oInput( x, y, c );
Func oOperation = oFunc( oPassthrough );
oOutput( x, y, c ) = oOperation( x, y, c );
oEnd();
}
void schedule()
{
if (auto_schedule)
{
oInput.set_estimates(oRegInput);
oOutput.set_estimates(oRegOutput);
}
}
static Region oRegInput;
static Region oRegOutput;
static std::function<Func(Func)> oFunc;
static std::function<void()> oStart;
static std::function<void()> oEnd;
static Var x, y, c;
};
Where oFunc is defined on the code. We can imagine an stack of operations for image processing stacked by a user behind a UI.
Like:
Blur > Resize > ... > Sharpen
And we want to perform an autoschedule to have an overall optimization.
As a toy-test I used: Halide::Internal::generate_filter_main(18, const_cast<char**>(&values[0]), std::cout);
Nevertheless I have: Unhandled exception: Error: Must use Output<> with generate() method.
I tried to add a dummy non-static GeneratorOutput<> which fix that.
I tried to check the code, wasn't able to find a solution.
Do we have a comment with my approch? Or a solution?
This discussion was converted from issue #5451 on November 24, 2020 00:39.
Heading
Bold
Italic
Quote
Code
Link
Numbered list
Unordered list
Task list
Attach files
Mention
Reference
Menu
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I would like to run the auto-schedule at runtime for a Func not known at the compilation time.
For that I design a function:
Where oFunc is defined on the code. We can imagine an stack of operations for image processing stacked by a user behind a UI.
Like:
Blur > Resize > ... > Sharpen
And we want to perform an autoschedule to have an overall optimization.
At the runtime level we do:
To replace the macro:
As a toy-test I used:
Halide::Internal::generate_filter_main(18, const_cast<char**>(&values[0]), std::cout);
Nevertheless I have:
Unhandled exception: Error: Must use Output<> with generate() method.
I tried to add a dummy non-static GeneratorOutput<> which fix that.
I tried to check the code, wasn't able to find a solution.
Do we have a comment with my approch? Or a solution?
Beta Was this translation helpful? Give feedback.
All reactions