E6002

E6002 — Cannot transfer between memory spaces (no hardware path)

What the compiler reports

E6002 … Cannot transfer from CPU_DRAM to Island … no hardware path

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
//
// A `transfer` is only legal when a hardware path exists between the source and target memory
// spaces (the transfer cost graph is searched with Dijkstra, and sub-spaces resolve through their
// `within:` ancestors). `Island` is a custom root space with no declared `within:` and no transfer
// edges, so it is unreachable from the host (CPU_DRAM) -- the transfer is a compile error rather
// than a silent no-op.
//

Memory Island {}

fn main() -> i32 {
  let t = Tensor<f32>([[1.0, 2.0], [3.0, 4.0]]);
  let s = transfer(t, Memory::Island);
  return 0;
}

// The code is pinned, not just the words. E6002 was declared and emitted
// nowhere, so the compiler could not produce it while this diagnostic -- the one
// it names -- carried no code at all and printed as a bare `Error:`.

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

Related