| //@ revisions: pass fail | |
| //@ no-prefer-dynamic | |
| //@ needs-offload | |
| //@[pass] build-pass | |
| //@[fail] build-fail | |
| //@[pass] compile-flags: -Zunstable-options -Zoffload=Device -Clto=fat --emit=metadata | |
| //@[fail] compile-flags: -Clto=thin | |
| //[fail]~? ERROR: using the offload feature requires -Z offload=<Device or Host=/absolute/path/to/device.bin> | |
| //[fail]~? ERROR: using the offload feature requires -C lto=fat | |
| #![feature(gpu_offload)] | |
| fn main() { | |
| let mut x = [3.0; 256]; | |
| kernel_1(&mut x); | |
| } | |
| fn kernel_1(x: &mut [f32; 256]) { | |
| core::offload::offload! { | |
| kernel = _kernel_1, | |
| args = (x,), | |
| } | |
| } | |
| fn _kernel_1(x: &mut [f32; 256]) {} |