-
Notifications
You must be signed in to change notification settings - Fork 222
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add an experimental opaque closure type. #1853
base: master
Are you sure you want to change the base?
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #1853 +/- ##
===========================================
- Coverage 71.83% 59.97% -11.87%
===========================================
Files 155 155
Lines 15013 14979 -34
===========================================
- Hits 10785 8984 -1801
- Misses 4228 5995 +1767 ☔ View full report in Codecov by Sentry. |
How much of this is actually CUDA specific? |
Not much. Only the fact that we need to be able to create a compiler invocation, which depends on backend-specific state (which device is active, etc): https://github.com/JuliaGPU/CUDA.jl/pull/1853/files#diff-ecbfaf5b99ab10dcafff5717c7cc5f856768e4313446fa3fb58b839a25b17cfcR317 |
8538870
to
dab7f8a
Compare
Seems to cause some IR verification errors:
|
ae85f2e
to
9cfd249
Compare
9cfd249
to
92632e9
Compare
92632e9
to
4511f85
Compare
3f9cde3
to
7782216
Compare
id = length(GPUCompiler.deferred_codegen_jobs) + 1 | ||
GPUCompiler.deferred_codegen_jobs[id] = job | ||
quote | ||
ptr = ccall("extern deferred_codegen", llvmcall, Ptr{Cvoid}, (Int,), $id) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
After #582 you should be able to just emit a gpuc.lookup(mi, oc, args...)
or maybe gpuc.deferred(oc, args...)
?
Opaque closures don't make that much sense in the CUDA environment (where we don't have a linker and need to recompile when the OC changes, also because we require specsig), but it can be useful to inline typed IR into a kernel and call it.
Current state of this PR is 1.12+ only (because of JuliaLang/julia#53219). It could be made more general if and when we decide to merge this.
Depends on JuliaGPU/GPUCompiler.jl#572