m4rs-mt / ILGPU

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

Fix F# sample #1105

Closed kant2002 closed 1 year ago

kant2002 commented 1 year ago

Since I did not touch license headers, I would like to understand what's my future steps here.

MoFtZ commented 1 year ago

hi @kant2002. Thank you for taking an interested in ILGPU.

Looking at your PR, what problem is it trying to fix in the F# sample code?

kant2002 commented 1 year ago

When I run sample code the GPU part return 0 instead of results

MoFtZ commented 1 year ago

@kant2002 That actually sounds like a bug with ILGPU, not with the sample project.

The call to GetAsArray1D internally calls Synchronize. It should not be necessary to call Synchronize twice (once explicitly, and a second time within GetAsArray1D).

MoFtZ commented 1 year ago

@kant2002 OK, I see the problem now.

The F# sample project is launching the kernel on the default stream, rather than the newly created stream. I have raised #1106 to fix this issue.

m4rs-mt commented 1 year ago

@kant2002 welcome to the ILGPU community and thank you for raising this PR. Nice catch 👍!

m4rs-mt commented 1 year ago

This patch has been merged in #1106.