-
Notifications
You must be signed in to change notification settings - Fork 772
[SYCL] Add support for NVPTX device printf #4293
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
Conversation
Looks like the build might be broken, there are multiple failures to do with |
fe58b68
to
e7b4173
Compare
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.
Looks much simpler. Just one more suggestion.
Could you update PR title, please?
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.
Great. Thank you!
Is the Precommit failure something that I would need to look into? |
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.
Can we add a FE test to verify change?
I don't think so. Precommit doesn't run any tests on CUDA back-end and the failure in this particular is seems to be known flaky issue - it's the same as the second issue in this comment #4281 (comment). |
Use `::printf` when not compiling for `__SPIR__`, this allows the use of `EmitNVPTXDevicePrintfCallExpr` which packs the var args and dispatches to CUDA's `vprintf`. Fixes intel#1154
Added in f7bbcc6 |
@sergey-semenov, @intel/llvm-reviewers-runtime, ping. |
@premanandrao your suggestion makes sense, unfortunately @jchlanda is on leave for a few weeks, would you be okay with this change being made in a follow up pull request? |
c8b0ea2
I've applied the suggestion. I think we can merge it, if tests pass. |
That works too, thanks @bader |
if (FD->getBuiltinID() == Builtin::BIprintf) | ||
return true; |
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.
Tagging @AaronBallman, @elizabethandrews and @premanandrao for awareness: this if
should probably be extended to check if we are compiling for CUDA or not.
The thing is that printf
built-in as-is won't be properly converted into SPIR-V and will cause JIT compilation errors on OpenCL backends.
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.
Changing it to check for CUDA makes sense to me, good catch!
Use
::printf
when not compiling for__SPIR__
, this allows the use ofEmitNVPTXDevicePrintfCallExpr
which packs the var args and dispatches to CUDA'svprintf
.Fixes #1154