E6008
E6008 — AMemorydeclaration has a non-positivecapacity,bandwidth, orgranule.
What the compiler reports
E6008 … 'Unaddressable' … non-positive `granule`
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
//
// The third field E6008 covers.
//
// `granule` is the unit a space is addressed in, so it is the divisor in every
// alignment and every occupancy figure computed against the space. Zero makes
// each of those a division by zero -- the declaration is refused here rather
// than left to fault somewhere in the middle of a placement decision.
//
Memory CPU_DRAM {}
Memory Unaddressable {
within: Memory::CPU_DRAM, capacity: 8 GiB, granule: 0 KiB
}
fn main() -> i32 {
return 0;
}
From tests/frontend/fail/memory_granule_is_positive.vx, which asserts this diagnostic on every commit.
Related
Topologies and memoryThe chapter covering the rule this code enforces.
All diagnosticsEvery code the compiler can emit, grouped by stage.
E6007A
Memory sub-space's capacity exceeds its parent's capacity (a child cannot be larger than what contains it).
E6009A statically-shaped tensor placed in a memory space exceeds that space's capacity.