E6044

E6044 — A register budget (max_registers) that is 0 or greater than 255.

What the compiler reports

Error[E6044] at {{.*}}max_registers_out_of_range.vx:[[@LINE+1]]:3: `max_registers` must be between 1 and 255, got 0
Error[E6044] at {{.*}}max_registers_out_of_range.vx:[[@LINE+1]]:3: `max_registers` must be between 1 and 255, got 300
Error[E6044] at {{.*}}max_registers_out_of_range.vx:[[@LINE+1]]:3: `max_registers` must be between 1 and 255, got 256

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
//
// `max_registers` must be between 1 and 255 (PTX allows at most 255 registers
// per thread). The compiler reports error E6044 when the value is 0 or
// greater than 255.
//

fn main() -> i32 {
  spawn on(Topology::GPU[0], max_registers: 0) {
    let mut x: i32 = 0;
    x = x + 1;
  }
  spawn on(Topology::GPU[0], max_registers: 300) {
    let mut z: i32 = 0;
    z = z + 1;
  }
  spawn on(Topology::GPU[0], max_registers: 256) {
    let mut y: i32 = 0;
    y = y + 1;
  }
  return 0;
}

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

Related