NVPTX: Allow PassMode::Direct for ptx kernels for now by kjetilkjeka · Pull Request #117247 · rust-lang/rust

@kjetilkjeka

@rustbot rustbot added 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.

labels

Oct 26, 2023

@rustbot rustbot added the O-NVPTX

Target: the NVPTX LLVM backend for running rust on GPUs, https://llvm.org/docs/NVPTXUsage.html

label

Oct 26, 2023

workingjubilee

@kjetilkjeka @workingjubilee

…ect assert

Co-authored-by: Jubilee <46493976+workingjubilee@users.noreply.github.com>

workingjubilee

RalfJung

@bors bors added S-waiting-on-bors

Status: Waiting on bors to run and complete tests. Bors will change the label on completion.

and removed S-waiting-on-review

Status: Awaiting review from the assignee but also interested parties.

labels

Oct 27, 2023

bors added a commit to rust-lang-ci/rust that referenced this pull request

Oct 27, 2023
…iaskrgr

Rollup of 7 pull requests

Successful merges:

 - rust-lang#116834 (Remove `rustc_symbol_mangling/messages.ftl`.)
 - rust-lang#117212 (Properly restore snapshot when failing to recover parsing ternary)
 - rust-lang#117246 (Fix ICE: Restrict param constraint suggestion)
 - rust-lang#117247 (NVPTX: Allow PassMode::Direct for ptx kernels for now)
 - rust-lang#117270 (Hide internal methods from documentation)
 - rust-lang#117281 (std::thread : add SAFETY comment)
 - rust-lang#117287 (fix miri target information for Test step)

r? `@ghost`
`@rustbot` modify labels: rollup

bors added a commit to rust-lang-ci/rust that referenced this pull request

Oct 27, 2023
…iaskrgr

Rollup of 7 pull requests

Successful merges:

 - rust-lang#116834 (Remove `rustc_symbol_mangling/messages.ftl`.)
 - rust-lang#117212 (Properly restore snapshot when failing to recover parsing ternary)
 - rust-lang#117246 (Fix ICE: Restrict param constraint suggestion)
 - rust-lang#117247 (NVPTX: Allow PassMode::Direct for ptx kernels for now)
 - rust-lang#117270 (Hide internal methods from documentation)
 - rust-lang#117281 (std::thread : add SAFETY comment)
 - rust-lang#117287 (fix miri target information for Test step)

r? `@ghost`
`@rustbot` modify labels: rollup

rust-timer added a commit to rust-lang-ci/rust that referenced this pull request

Oct 27, 2023
Rollup merge of rust-lang#117247 - kjetilkjeka:nvptx_direct_passmode_exception, r=workingjubilee,RalfJung

NVPTX: Allow PassMode::Direct for ptx kernels for now

Upgrading the nvptx toolchain to the newest nightly makes it hit the assert that links to rust-lang#115666

It seems like most targets get around this by using `PassMode::Indirect`. That is impossible for the kernel as it's not a normal call, but instead the arguments are copied from CPU to GPU and the passed pointer would be invalid when it reached the GPU.

I also made an experiment with `PassMode::Cast` but at least the most simple version of this broke the assembly API tests.

I added  fixing the pass mode in my unofficial tracking issue list (I do not have the necessary permissions to update to official one). rust-lang#38788 (comment)

Since the ptx_abi is currently unstable and have been working with `PassMode::Direct` for more than a year now, the steps above is hopefully sufficient to enable it as an exception until I can prioritize to fix it. I'm currently looking at steps to enable the CI for nvptx64 again and would prefer to finish that first.

bors-ferrocene bot added a commit to ferrocene/ferrocene that referenced this pull request

Oct 31, 2023

bors-ferrocene bot added a commit to ferrocene/ferrocene that referenced this pull request

Oct 31, 2023