Skip to content

How to use scan_expr in InclusiveScanKernel for more general operation #376

Answered by inducer
dacapo1142 asked this question in Q&A
Discussion options

You must be logged in to vote

Can I pass a general function instead of a one-liner expression? like, using lambda expression in C/C++?

Sure. The expression can be a call to a function defined in the preamble.

Can I pass a vector instead of a number?

As long as it's fixed-size, yes. Make a struct containing your fixed-size vector, and then register the type with pycuda.

Can I create a copy of a vector inside the function and return it?

Sure. Simple struct assignment would do that.

Replies: 1 comment 4 replies

Comment options

You must be logged in to vote
4 replies
@henryliou-ephodtech
Comment options

@inducer
Comment options

@henryliou-ephodtech
Comment options

@inducer
Comment options

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