Skip to content

Commit 3ab14aa

Browse files
committed
Fix test for non-libc runners
1 parent f603e23 commit 3ab14aa

File tree

2 files changed

+10
-12
lines changed

2 files changed

+10
-12
lines changed

offload/plugins-nextgen/common/src/RPC.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ template <uint32_t NumLanes>
2424
rpc::Status handle_offload_opcodes(plugin::GenericDeviceTy &Device,
2525
rpc::Server::Port &Port) {
2626

27-
int Status = rpc::SUCCESS;
2827
switch (Port.get_opcode()) {
2928
case RPC_MALLOC: {
3029
Port.recv_and_send([&](rpc::Buffer *Buffer, uint32_t) {

offload/test/api/omp_host_call.c

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -23,22 +23,14 @@ typedef struct args_s {
2323
} args_t;
2424

2525
// CHECK-DAG: Thread: 0, Block: 0
26-
// CHECK-DAG: Result: 42
2726
// CHECK-DAG: Thread: 1, Block: 0
28-
// CHECK-DAG: Result: 42
2927
// CHECK-DAG: Thread: 0, Block: 1
30-
// CHECK-DAG: Result: 42
3128
// CHECK-DAG: Thread: 1, Block: 1
32-
// CHECK-DAG: Result: 42
3329
// CHECK-DAG: Thread: 0, Block: 2
34-
// CHECK-DAG: Result: 42
3530
// CHECK-DAG: Thread: 1, Block: 2
36-
// CHECK-DAG: Result: 42
3731
// CHECK-DAG: Thread: 0, Block: 3
38-
// CHECK-DAG: Result: 42
3932
// CHECK-DAG: Thread: 1, Block: 3
40-
// CHECK-DAG: Result: 42
41-
long long foo(void *data) {
33+
unsigned long long foo(void *data) {
4234
assert(omp_is_initial_device() && "Not executing on host?");
4335
args_t *args = (args_t *)data;
4436
printf("Thread: %d, Block: %d\n", args->thread_id, args->block_id);
@@ -52,12 +44,19 @@ int main() {
5244
fn_ptr = (void *)&foo;
5345
#pragma omp target update to(fn_ptr)
5446

55-
#pragma omp target teams num_teams(4)
47+
int failed = 0;
48+
#pragma omp target teams num_teams(4) map(from : failed)
5649
#pragma omp parallel num_threads(2)
5750
{
5851
args_t args = {omp_get_thread_num(), omp_get_team_num()};
5952
unsigned long long res =
6053
__llvm_omp_host_call(fn_ptr, &args, sizeof(args_t));
61-
printf("Result: %d\n", (int)res);
54+
if (res != 42)
55+
#pragma omp atomic write
56+
failed = 1;
6257
}
58+
59+
// CHECK: PASS
60+
if (!failed)
61+
printf("PASS\n");
6362
}

0 commit comments

Comments
 (0)