E6011

E6011 — A sub-space's scope is broader than its parent's (locality must narrow down within:).

What the compiler reports

E6011

The fragments the test suite holds the compiler to. An ellipsis marks text the test does not constrain; the emitted message also carries a source location.

A program that triggers it

//
// Part of the Vx Project, under the Apache License v2.0 with LLVM Exceptions.
// See LICENSE for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
// Locality must narrow (never widen) going down the memory hierarchy: a sub-space cannot be
// scoped more broadly than the space that contains it. A `device`-scoped space declared
// `within` an `sm`-scoped one is incoherent (E6011). The faithful B200 shape is the reverse --
// per-SM SMEM/TMEM inside the per-device HBM.
//

Memory OneSm {
  scope: sm
}
Memory Wider {
  within: Memory::OneSm, scope: device
}

fn main() -> i32 {
  return 0;
}

From tests/frontend/fail/memory_scope_widens.vx, which asserts this diagnostic on every commit.

Related