m4rs-mt / ILGPU

ILGPU JIT Compiler for high-performance .Net GPU programs
http://www.ilgpu.net
Other
1.38k stars 117 forks source link

Fixed NVVM generation for void functions and out parameters. #1147

Closed MoFtZ closed 9 months ago

MoFtZ commented 9 months ago

We pre-generate NVVM instructions at compile-time, to be used for generating PTX at runtime.

For LibDevice functions like SinCos that return void, and have out parameters, we were generating the wrong NVVM instructions.

We were incorrectly trying to store the result of a void function into a return variable. And for out parameters, treating it like a normal variable, rather than a pointer to a variable.