Skip to content

Offload slice support#153411

Open
Sa4dUs wants to merge 1 commit intorust-lang:mainfrom
Sa4dUs:offload-slices
Open

Offload slice support#153411
Sa4dUs wants to merge 1 commit intorust-lang:mainfrom
Sa4dUs:offload-slices

Conversation

@Sa4dUs
Copy link
Copy Markdown
Contributor

@Sa4dUs Sa4dUs commented Mar 4, 2026

This PR allows offload to support slice type arguments.

NOTE: this is built on top of #152283

r? @ZuseZ4

@rustbot rustbot added A-LLVM Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues. S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Mar 4, 2026
@rust-bors

This comment has been minimized.

@Sa4dUs Sa4dUs marked this pull request as ready for review March 9, 2026 23:18
@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Mar 9, 2026
@ZuseZ4
Copy link
Copy Markdown
Member

ZuseZ4 commented Mar 10, 2026

cc @workingjubilee

builder.store(geps[i as usize], gep2, Align::EIGHT);

if matches!(metadata[i as usize].payload_size, OffloadSize::Dynamic) {
if matches!(metadata[i as usize].payload_size, OffloadSize::Dynamic(_)) {
Copy link
Copy Markdown
Member

@ZuseZ4 ZuseZ4 Apr 15, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Try if let OffloadSize::Dynamic(dynamic_size: DynamicSize) = metadata[i as usize].payload_size {

and update the get_runtime_size below, so we don't have more unnecessary matches.

View changes since the review

pub enum OffloadSize {
Dynamic,
Static(u64),
Dynamic(DynamicSize),
Copy link
Copy Markdown
Member

@ZuseZ4 ZuseZ4 Apr 15, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd probably for now directly add Slice under OffloadSize, at least until we handle more dynamic ones.

View changes since the review

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-LLVM Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues. S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants