llvm / llvm/offload-test-suite

[Metal] Metal unsupported 64 bit wave op when using WaveReadLaneAt

Open
#355 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C++
Stars
18
Forks
39
Avg merge
2d 18h
Merged PRs (30d)
40

Description

WaveReadLaneAt for 64 bit inputs is not supported on Metal.
Error result: `metal-shaderconverter: [callSIMDOp:6529] Fatal: Unsupported 64bit wave op`

Source:
```
[numthreads(4,1,1)]
void main(uint32_t3 TID : SV_GroupThreadID) {
uint OutIdx = TID.x * 3;

// Int
OutInt[OutIdx] = WaveReadLaneAt(InInt[TID.x], TID.x);
uint64_t4 ThreadInInt = {InInt[TID.x].xyz, InInt[TID.x].w};
OutInt[OutIdx + 1] = WaveReadLaneAt(ThreadInInt, TID.x);;
OutInt[OutIdx + 2].xy = WaveReadLaneAt(InInt[TID.x].xy, TID.x);

// UInt
OutUInt[OutIdx] = WaveReadLaneAt(InUInt[TID.x], TID.x);
int64_t4 ThreadInUInt = {InUInt[TID.x].xyz, InUInt[TID.x].w};
OutUInt[OutIdx + 1] = WaveReadLaneAt(ThreadInUInt, TID.x);;
OutUInt[OutIdx + 2].xy = WaveReadLaneAt(InUInt[TID.x].xy, TID.x);
}

# RUN: split-file %s %t
# RUN: %dxc_target -T cs_6_5 -Fo %t.o %t/source.hlsl
# RUN: %offloader %t/pipeline.yaml %t.o

```

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by running the inline HLSL reproduction with the shown dxc_target and offloader commands, then inspect the callSIMDOp:6529 failure in the Metal shader conversion path. Done means the WaveReadLaneAt cases using 64-bit int and uint inputs no longer produce the unsupported 64bit wave op error and the offloader run succeeds.

Written by the indexing model from the issue text.

Assessment

Domain
compilers, computer-graphics
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.