Skip to content

Passing in a scalar Param into a generator #7998

Answered by icebeing
icebeing asked this question in Q&A
Discussion options

You must be logged in to vote

Correct. I was just looking at that lesson21 generator. I guess I can interpret it this way:

When you declare your Generator class, you have this sequence of public-scoped member variables:

class MyGenerator : public Halide::Generator<MyGenerator> 
{
    public:
    Input<Buffer<uint8_t>> input1;
    Input<Buffer<uint8_t>> input2;
    Input<int> someIntScalar;
    Output<Buffer<uint8_t>> output;

    ///etc...
};

When I run the GenGen.cpp - oriented mygenerator_generator executable, it effectively outputs this prototype in the mygen.h header file

HALIDE_FUNCTION_ATTRS
int mygenerator(struct halide_buffer_t *_input1, struct halide_buffer_t *_input2, int someIntScalar, struct halide_buffer…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@icebeing
Comment options

Answer selected by icebeing
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants