[BUG] right_inverse with 1d layout results "#2700-D: attempt to access expired storage" on constexpr return value.
Nobody has claimed this yet.
- Dominant language
- C++
- Stars
- 10.5k
- Forks
- 2.1k
- Avg merge
- 3d 11h
- Merged PRs (30d)
- 7
Description
Describe the bug
Steps/Code to reproduce bug
#include "cute/tensor.hpp"
using namespace cute;
__global__ void kernel() {
constexpr auto weird = right_inverse(make_layout(_2{}, _1{}));
print(weird);
}
int main() {
kernel<<<1, 1>>>();
cudaDeviceSynchronize();
}
compile the code cause
error: expression must have a constant value
include/cute/layout.hpp(1143): note #2700-D: attempt to access expired storage
include/cute/algorithm/tuple_algorithms.hpp(114): note #2693-D: called from:
include/cute/algorithm/tuple_algorithms.hpp(248): note #2693-D: called from:
include/cute/layout.hpp(1143): note #2693-D: called from:
remove the constexpr however, the program compiles smoothly and prints _2:_1
Expected behavior
It compiles.
Environment details (please complete the following information):
reproduced with cuda 11.8 and 12.1
Additional context
a75b4ac483166189a45290783cb0a18af5ff0ea5
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with include/cute/layout.hpp at line 1143 and follow the tuple-algorithm calls through include/cute/algorithm/tuple_algorithms.hpp lines 114 and 248. Reproduce the constexpr example with CUDA 11.8 or 12.1, compare it with the non-constexpr version, and verify that the constexpr return value compiles and prints the expected layout.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- backend
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100