-
Notifications
You must be signed in to change notification settings - Fork 14k
Offload intrinsic #147936
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
base: main
Are you sure you want to change the base?
Offload intrinsic #147936
Conversation
9118683 to
23722aa
Compare
This comment has been minimized.
This comment has been minimized.
| } | ||
|
|
||
| pub fn from_ty<'tcx>(tcx: TyCtxt<'tcx>, ty: Ty<'tcx>) -> Self { | ||
| OffloadMetadata { payload_size: get_payload_size(tcx, ty), mode: TransferKind::Both } |
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.
If you already have the code here, I would add a small check for & or byVal (implies Mode ToGPU), vs &mut (implies Both).
In the future we would hope to analyze the & or byval case more, if we never read from it (before writing) then we could use a new mode 4, which allocates directly on the gpu.
This comment has been minimized.
This comment has been minimized.
|
☔ The latest upstream changes (presumably #148507) made this pull request unmergeable. Please resolve the merge conflicts. |
e0fd7be to
97a8e96
Compare
This comment has been minimized.
This comment has been minimized.
|
☔ The latest upstream changes (presumably #148721) made this pull request unmergeable. Please resolve the merge conflicts. |
| let i32_0 = cx.get_const_i32(0); | ||
| for index in 0..types.len() { | ||
| let v = unsafe { llvm::LLVMGetOperand(kernel_call, index as u32).unwrap() }; | ||
| for index in 0..num_args { |
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 you iterate directly over args now?
| return Ok(()); | ||
| } | ||
| sym::offload => { | ||
| // FIXME(Sa4dUs): emit error when offload is not enabled |
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.
I'd rather have that as a TODO, thus fixed before we land it. You can just copy the check I had above (and potentially error if you find an intrinsic, but not the flag set). The current main already requires it, and we shouldn't change nightly behaviour because of an experimental feature without a user setting a feature flag.
| | ty::FnDef(_, _) | ||
| | ty::FnPtr(_, _) | ||
| | ty::Closure(_, _) | ||
| | ty::CoroutineClosure(_, _) | ||
| | ty::Coroutine(_, _) | ||
| | ty::CoroutineWitness(_, _) | ||
| | ty::Never |
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.
I'd expect all of these to not be handled correctly by offload without further work, so I'd just error.
The same goes for
| ty::Bound(_, _)
| ty::Placeholder(_)
| ty::Infer(_)
| ty::Error(_)
No description provided.