E6029
E6029 — A pointer argument into one memory passed to a parameter that wants a pointer into another: a host*mut f32where*mut f32 in Memory::GPU_HBMis declared, or the reverse. The two are different types, and the C library or kernel behind the parameter reads the memory the declaration names, so the spaces must match exactly.
What the compiler reports
E6029
argument 1 of 'reads_host' is a pointer into Memory::GPU_HBM, but the parameter wants a pointer into host memory
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
//
// `as_ptr()` on a tensor in GPU memory gives a pointer into GPU memory, and that
// is not a host pointer. Passing it where a plain `*const f32` is expected is
// refused, and the message names both memories.
fn reads_host(p : *const f32) -> i32 {
return 0;
}
fn main() -> i32 {
let host_data : Tensor<f32, [4, 4]> = Tensor<f32, [4, 4]>::new();
let on_gpu = transfer(host_data, Memory::GPU_HBM);
let dp = on_gpu.as_ptr();
return reads_host(dp);
}
From tests/frontend/fail/device_pointer_is_not_a_host_pointer.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.
E6028A recursive cycle that places tiles in a space with a declared capacity. The recursion depth is not known at compile time, so the true peak is unbounded and the placement is refused conservatively. Downgraded to W1028 when the space is declared
overcommit.