E6043

E6043 — A register budget (max_registers) on a target that is not an NVIDIA GPU (arch: nvptx64).

What the compiler reports

Error[E6043] at {{.*}}max_registers_on_cpu_target.vx:[[@LINE+1]]:3: Only an NVIDIA GPU target (`arch: nvptx64`) takes `max_registers`, but `Topology::CPU` has no `arch:`

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
//
// Only an NVIDIA GPU target (`arch: nvptx64`) takes `max_registers`. The
// compiler reports error E6043 when the target is a CPU.
//

fn main() -> i32 {
  spawn on(Topology::CPU, max_registers: 96) {
    let mut x: i32 = 0;
    x = x + 1;
  }
  return 0;
}

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

Related