in reply to Re: Compile and run cuda code on the GPU via Perl's Inline::C - passing parameters
in thread Compile and possibly run cuda code on the GPU via Perl's Inline::C

My answer to the implied question of what to return on error is don't return NULL, instead return the empty list you just created. That is, change return NULL to return ret in both places.

But a more Perl-idiomatic way might be to do a croak, since your API doesn't allow a return value indicating error. A way to do that might be to return an array-ref on success, and undef on failure. That would also avoid excess copying of data to and from the stack.