Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 0 additions & 19 deletions tests/codegen-llvm/gpu_offload/gpu_host.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,6 @@ pub fn _kernel_1(x: &mut [f32; 256], y: &[f32; 256]) {
// CHECK: @anon.[[ID:.*]].0 = private unnamed_addr constant [23 x i8] c";unknown;unknown;0;0;;\00", align 1
// CHECK: @anon.{{.*}}.1 = private unnamed_addr constant %struct.ident_t { i32 0, i32 2, i32 0, i32 22, ptr @anon.[[ID]].0 }, align 8

// CHECK-DAG: @.omp_offloading.descriptor = internal constant { i32, ptr, ptr, ptr } zeroinitializer
// CHECK-DAG: @llvm.global_ctors = appending constant [1 x { i32, ptr, ptr }] [{ i32, ptr, ptr } { i32 101, ptr @.omp_offloading.descriptor_reg, ptr null }]
// CHECK-DAG: @.offload_sizes.[[K:[^ ]*kernel_1]] = private unnamed_addr constant [2 x i64] [i64 1024, i64 1024]
// CHECK-DAG: @.offload_maptypes.[[K]].begin = private unnamed_addr constant [2 x i64] [i64 1, i64 1]
// CHECK-DAG: @.offload_maptypes.[[K]].kernel = private unnamed_addr constant [2 x i64] [i64 32, i64 32]
Expand Down Expand Up @@ -98,21 +96,4 @@ pub fn _kernel_1(x: &mut [f32; 256], y: &[f32; 256]) {
// CHECK: ret void
// CHECK-NEXT: }

// CHECK: declare void @__tgt_register_lib(ptr) local_unnamed_addr
// CHECK: declare void @__tgt_unregister_lib(ptr) local_unnamed_addr

// CHECK-LABEL: define internal void @.omp_offloading.descriptor_reg() section ".text.startup"
// CHECK-NEXT: entry:
// CHECK-NEXT: {{tail }}call void @__tgt_register_lib(ptr nonnull @.omp_offloading.descriptor)
// CHECK-NEXT: {{tail }}call void @__tgt_init_all_rtls()
// CHECK-NEXT: %0 = {{tail }}call i32 @atexit(ptr nonnull @.omp_offloading.descriptor_unreg)
// CHECK-NEXT: ret void
// CHECK-NEXT: }

// CHECK-LABEL: define internal void @.omp_offloading.descriptor_unreg() section ".text.startup"
// CHECK-NEXT: entry:
// CHECK-NEXT: {{tail }}call void @__tgt_unregister_lib(ptr nonnull @.omp_offloading.descriptor)
// CHECK-NEXT: ret void
// CHECK-NEXT: }

// CHECK: !{i32 7, !"openmp", i32 51}
2 changes: 1 addition & 1 deletion tests/codegen-llvm/gpu_offload/slice_device.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ extern crate minicore;
// amdgpu-NEXT: define amdgpu_kernel void @foo
// CHECK-SAME: ptr nofree readnone captures(none) %dyn_ptr
// nvptx-SAME: [2 x i64] %0
// amdgpu-SAME: ptr noalias {{.*}} %0, i64 {{.*}} %1
// amdgpu-SAME: ptr addrspace(4) {{.*}} byref([16 x i8]) align 8 {{.*}} %0)
// CHECK-NEXT: entry:
// CHECK-NEXT: ret void
// CHECK-NEXT: }
Expand Down
4 changes: 2 additions & 2 deletions tests/run-make/offload/host-std-device-nostd/rmake.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,12 @@ fn main() {
.emit("obj")
.run();

rfs::write(cwd().join("device.bin"), [0u8; 8]);
rfs::write(cwd().join("device.elf"), [0u8; 8]);

rustc()
.input("example.rs")
.arg("-Zunstable-options")
.arg(format!("-Zoffload=Host={}", cwd().join("device.bin").display()))
.arg(format!("-Zoffload=Host={}", cwd().join("device.elf").display()))
.arg("-Csymbol-mangling-version=v0")
.arg("-Clto=fat")
.emit("obj")
Expand Down
4 changes: 2 additions & 2 deletions tests/ui/offload/non_tuple_args.stderr
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
error: `args` must be a tuple literal
--> $DIR/non_tuple_args.rs:7:5
--> $DIR/non_tuple_args.rs:8:5
|
LL | core::offload::offload! { kernel = kernel_0, args = 42 }
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: this error originates in the macro `$crate::offload` which comes from the expansion of the macro `core::offload::offload` (in Nightly builds, run with -Z macro-backtrace for more info)

error: `args` must be a tuple literal
--> $DIR/non_tuple_args.rs:13:5
--> $DIR/non_tuple_args.rs:14:5
|
LL | core::offload::offload! { kernel = kernel_0, args = args }
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Expand Down
8 changes: 4 additions & 4 deletions tests/ui/offload/region_by_ref.stderr
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
error: offload kernel argument 0 contains a `Region` nested inside another type. Pass the `Region` by value so it can be mapped like a slice
--> $DIR/region_by_ref.rs:30:5
--> $DIR/region_by_ref.rs:32:5
|
LL | core::intrinsics::offload::<_, _, ()>(
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

error: offload kernel argument 0 contains a `Region` nested inside another type. Pass the `Region` by value so it can be mapped like a slice
--> $DIR/region_by_ref.rs:42:5
--> $DIR/region_by_ref.rs:44:5
|
LL | core::intrinsics::offload::<_, _, ()>(
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

error: offload kernel argument 0 contains a `Region` nested inside another type. Pass the `Region` by value so it can be mapped like a slice
--> $DIR/region_by_ref.rs:54:5
--> $DIR/region_by_ref.rs:56:5
|
LL | core::intrinsics::offload::<_, _, ()>(
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

error: offload kernel argument 0 contains a `Region` nested inside another type. Pass the `Region` by value so it can be mapped like a slice
--> $DIR/region_by_ref.rs:66:5
--> $DIR/region_by_ref.rs:68:5
|
LL | core::intrinsics::offload::<_, _, ()>(
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Expand Down
12 changes: 6 additions & 6 deletions tests/ui/offload/type_mismatch.stderr
Original file line number Diff line number Diff line change
@@ -1,35 +1,35 @@
error: expected a function item for the offload kernel, found `i32`
--> $DIR/type_mismatch.rs:8:5
--> $DIR/type_mismatch.rs:9:5
|
LL | core::intrinsics::offload::<_, _, ()>(not_fn, [1, 1, 1], [1, 1, 1], 0, -1, ());
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

error: offload kernel expects 1 arguments, but 0 arguments were provided
--> $DIR/type_mismatch.rs:12:5
--> $DIR/type_mismatch.rs:13:5
|
LL | core::intrinsics::offload::<_, _, ()>(kernel_1, [1, 1, 1], [1, 1, 1], 0, -1, ());
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

error: type mismatch in offload kernel argument 0: expected `f32`, found `f64`
--> $DIR/type_mismatch.rs:16:5
--> $DIR/type_mismatch.rs:17:5
|
LL | core::intrinsics::offload::<_, _, ()>(kernel_1, [1, 1, 1], [1, 1, 1], 0, -1, (42.0f64,));
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

error: offload kernel return type mismatch: kernel returns `()`, but offload call expects `f64`
--> $DIR/type_mismatch.rs:20:18
--> $DIR/type_mismatch.rs:21:18
|
LL | let _: f64 = core::intrinsics::offload::<_, _, f64>(kernel_0, [1, 1, 1], [1, 1, 1], 0, -1, ());
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

error: type mismatch in offload kernel argument 0: expected `f32`, found `f64`
--> $DIR/type_mismatch.rs:24:5
--> $DIR/type_mismatch.rs:25:5
|
LL | core::intrinsics::offload::<_, _, ()>(
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

error: type mismatch in offload kernel argument 1: expected `f32`, found `f64`
--> $DIR/type_mismatch.rs:24:5
--> $DIR/type_mismatch.rs:25:5
|
LL | core::intrinsics::offload::<_, _, ()>(
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Expand Down
Loading