Since we can now build the DeviceRTL with SPIR-V, redo the `XFAIL/UNSUPPORTED` specifications for the tests we see passing/failing on the Level Zero backend with the DeviceRTL being used. The tests marked `UNSUPPORTED` hang or sporadically fail and those are tracked in https://github.com/llvm/llvm-project/issues/182119. This change will allow us to enable CI testing with the DeviceRTL. Here are the full test results with this change applied, running only the `spirv64-intel` `check-offload` tests: ``` Total Discovered Tests: 453 Unsupported : 206 (45.47%) Passed : 141 (31.13%) Expectedly Failed: 106 (23.40%) ``` 31% is not a bad start. --------- Signed-off-by: Nick Sarnie <nick.sarnie@intel.com>
105 lines
4.6 KiB
C
105 lines
4.6 KiB
C
// clang-format off
|
|
// RUN: %libomptarget-compile-run-and-check-generic
|
|
// REQUIRES: ompt
|
|
// REQUIRES: gpu
|
|
// clang-format on
|
|
|
|
/*
|
|
* Example OpenMP program that shows that both EMI and non-EMI
|
|
* callbacks cannot be registered for the same type. In the
|
|
* current implementation, the EMI callback overrides the non-EMI
|
|
* callback.
|
|
*/
|
|
|
|
#include <omp.h>
|
|
#include <stdio.h>
|
|
|
|
#include "callbacks.h"
|
|
#include "register_both.h"
|
|
|
|
int main() {
|
|
int N = 100000;
|
|
|
|
int a[N];
|
|
int b[N];
|
|
|
|
int i;
|
|
|
|
for (i = 0; i < N; i++)
|
|
a[i] = 0;
|
|
|
|
for (i = 0; i < N; i++)
|
|
b[i] = i;
|
|
|
|
#pragma omp target parallel for
|
|
{
|
|
for (int j = 0; j < N; j++)
|
|
a[j] = b[j];
|
|
}
|
|
|
|
#pragma omp target teams distribute parallel for
|
|
{
|
|
for (int j = 0; j < N; j++)
|
|
a[j] = b[j];
|
|
}
|
|
|
|
int rc = 0;
|
|
for (i = 0; i < N; i++)
|
|
if (a[i] != b[i]) {
|
|
rc++;
|
|
printf("Wrong value: a[%d]=%d\n", i, a[i]);
|
|
}
|
|
|
|
if (!rc)
|
|
printf("Success\n");
|
|
|
|
return rc;
|
|
}
|
|
|
|
// clang-format off
|
|
/// CHECK: Callback Init:
|
|
/// CHECK: Callback Load:
|
|
/// CHECK: Callback Target EMI: kind=ompt_target endpoint=ompt_scope_begin
|
|
/// CHECK: Callback DataOp EMI: endpoint=ompt_scope_begin optype=ompt_target_data_alloc
|
|
/// CHECK: Callback DataOp EMI: endpoint=ompt_scope_end optype=ompt_target_data_alloc
|
|
/// CHECK-NOT: dest=(nil)
|
|
/// CHECK: Callback DataOp EMI: endpoint=ompt_scope_begin optype=ompt_target_data_transfer_to_device
|
|
/// CHECK: Callback DataOp EMI: endpoint=ompt_scope_end optype=ompt_target_data_transfer_to_device
|
|
/// CHECK: Callback DataOp EMI: endpoint=ompt_scope_begin optype=ompt_target_data_alloc
|
|
/// CHECK: Callback DataOp EMI: endpoint=ompt_scope_end optype=ompt_target_data_alloc
|
|
/// CHECK-NOT: dest=(nil)
|
|
/// CHECK: Callback DataOp EMI: endpoint=ompt_scope_begin optype=ompt_target_data_transfer_to_device
|
|
/// CHECK: Callback DataOp EMI: endpoint=ompt_scope_end optype=ompt_target_data_transfer_to_device
|
|
/// CHECK: Callback Submit: target_id=[[TARGET_ID:[0-9]+]] host_op_id=[[HOST_OP_ID:[0-9]+]] req_num_teams=1
|
|
/// CHECK: Callback DataOp EMI: endpoint=ompt_scope_begin optype=ompt_target_data_transfer_from_device
|
|
/// CHECK: Callback DataOp EMI: endpoint=ompt_scope_end optype=ompt_target_data_transfer_from_device
|
|
/// CHECK: Callback DataOp EMI: endpoint=ompt_scope_begin optype=ompt_target_data_transfer_from_device
|
|
/// CHECK: Callback DataOp EMI: endpoint=ompt_scope_end optype=ompt_target_data_transfer_from_device
|
|
/// CHECK: Callback DataOp EMI: endpoint=ompt_scope_begin optype=ompt_target_data_delete
|
|
/// CHECK: Callback DataOp EMI: endpoint=ompt_scope_end optype=ompt_target_data_delete
|
|
/// CHECK: Callback DataOp EMI: endpoint=ompt_scope_begin optype=ompt_target_data_delete
|
|
/// CHECK: Callback DataOp EMI: endpoint=ompt_scope_end optype=ompt_target_data_delete
|
|
/// CHECK: Callback Target EMI: kind=ompt_target endpoint=ompt_scope_end
|
|
/// CHECK: Callback Target EMI: kind=ompt_target endpoint=ompt_scope_begin
|
|
/// CHECK: Callback DataOp EMI: endpoint=ompt_scope_begin optype=ompt_target_data_alloc
|
|
/// CHECK: Callback DataOp EMI: endpoint=ompt_scope_end optype=ompt_target_data_alloc
|
|
/// CHECK-NOT: dest=(nil)
|
|
/// CHECK: Callback DataOp EMI: endpoint=ompt_scope_begin optype=ompt_target_data_transfer_to_device
|
|
/// CHECK: Callback DataOp EMI: endpoint=ompt_scope_end optype=ompt_target_data_transfer_to_device
|
|
/// CHECK: Callback DataOp EMI: endpoint=ompt_scope_begin optype=ompt_target_data_alloc
|
|
/// CHECK: Callback DataOp EMI: endpoint=ompt_scope_end optype=ompt_target_data_alloc
|
|
/// CHECK-NOT: dest=(nil)
|
|
/// CHECK: Callback DataOp EMI: endpoint=ompt_scope_begin optype=ompt_target_data_transfer_to_device
|
|
/// CHECK: Callback DataOp EMI: endpoint=ompt_scope_end optype=ompt_target_data_transfer_to_device
|
|
/// CHECK: Callback Submit: target_id=[[TARGET_ID:[0-9]+]] host_op_id=[[HOST_OP_ID:[0-9]+]] req_num_teams=0
|
|
/// CHECK: Callback DataOp EMI: endpoint=ompt_scope_begin optype=ompt_target_data_transfer_from_device
|
|
/// CHECK: Callback DataOp EMI: endpoint=ompt_scope_end optype=ompt_target_data_transfer_from_device
|
|
/// CHECK: Callback DataOp EMI: endpoint=ompt_scope_begin optype=ompt_target_data_transfer_from_device
|
|
/// CHECK: Callback DataOp EMI: endpoint=ompt_scope_end optype=ompt_target_data_transfer_from_device
|
|
/// CHECK: Callback DataOp EMI: endpoint=ompt_scope_begin optype=ompt_target_data_delete
|
|
/// CHECK: Callback DataOp EMI: endpoint=ompt_scope_end optype=ompt_target_data_delete
|
|
/// CHECK: Callback DataOp EMI: endpoint=ompt_scope_begin optype=ompt_target_data_delete
|
|
/// CHECK: Callback DataOp EMI: endpoint=ompt_scope_end optype=ompt_target_data_delete
|
|
/// CHECK: Callback Target EMI: kind=ompt_target endpoint=ompt_scope_end
|
|
/// CHECK: Callback Fini:
|