We finally got our buildbot added (to staging, at least) so we want to start running L0 tests in CI. We need `check-offload` to pass though, so XFAIL everything failing. There's a couple `UNSUPPORTED` as well, those are for sporadic fails. Also make set the `gpu` and `intelgpu` LIT variables when testing the `spirv64-intel` triple. We have no DeviceRTL yet so basically everything fails, but we manage to get ``` Total Discovered Tests: 432 Unsupported : 169 (39.12%) Passed : 67 (15.51%) Expectedly Failed: 196 (45.37%) ``` We still don't build the level zero plugin by default and these tests don't run unless the plugin was built, so this has no effect on most builds. --------- Signed-off-by: Nick Sarnie <nick.sarnie@intel.com>
104 lines
4.2 KiB
C
104 lines
4.2 KiB
C
// clang-format off
|
|
// RUN: %libomptarget-compile-run-and-check-generic
|
|
// REQUIRES: ompt
|
|
// REQUIRES: gpu
|
|
// XFAIL: intelgpu
|
|
// clang-format on
|
|
|
|
/*
|
|
* Example OpenMP program that registers non-EMI callbacks
|
|
*/
|
|
|
|
#include <omp.h>
|
|
#include <stdio.h>
|
|
|
|
#include "callbacks.h"
|
|
#include "register_non_emi.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: target_id=[[TARGET_ID:[0-9]+]] kind=ompt_target endpoint=ompt_scope_begin device_num=[[DEVICE_NUM:[0-9]+]]
|
|
/// CHECK-NOT: code=(nil)
|
|
/// CHECK: code=[[CODE1:.*]]
|
|
/// CHECK: Callback DataOp: target_id=[[TARGET_ID:[0-9]+]] host_op_id=[[HOST_OP_ID:[0-9]+]] optype=ompt_target_data_alloc
|
|
/// CHECK: code=[[CODE1]]
|
|
/// CHECK: Callback DataOp: target_id=[[TARGET_ID:[0-9]+]] host_op_id=[[HOST_OP_ID:[0-9]+]] optype=ompt_target_data_transfer_to_device
|
|
/// CHECK: code=[[CODE1]]
|
|
/// CHECK: Callback DataOp: target_id=[[TARGET_ID:[0-9]+]] host_op_id=[[HOST_OP_ID:[0-9]+]] optype=ompt_target_data_alloc
|
|
/// CHECK: code=[[CODE1]]
|
|
/// CHECK: Callback DataOp: target_id=[[TARGET_ID:[0-9]+]] host_op_id=[[HOST_OP_ID:[0-9]+]] optype=ompt_target_data_transfer_to_device
|
|
/// CHECK: code=[[CODE1]]
|
|
/// CHECK: Callback Submit: target_id=[[TARGET_ID:[0-9]+]] host_op_id=[[HOST_OP_ID:[0-9]+]] req_num_teams=1
|
|
/// CHECK: Callback DataOp: target_id=[[TARGET_ID:[0-9]+]] host_op_id=[[HOST_OP_ID:[0-9]+]] optype=ompt_target_data_transfer_from_device
|
|
/// CHECK: code=[[CODE1]]
|
|
/// CHECK: Callback DataOp: target_id=[[TARGET_ID:[0-9]+]] host_op_id=[[HOST_OP_ID:[0-9]+]] optype=ompt_target_data_transfer_from_device
|
|
/// CHECK: code=[[CODE1]]
|
|
/// CHECK: Callback DataOp: target_id=[[TARGET_ID:[0-9]+]] host_op_id=[[HOST_OP_ID:[0-9]+]] optype=ompt_target_data_delete
|
|
/// CHECK: code=[[CODE1]]
|
|
/// CHECK: Callback DataOp: target_id=[[TARGET_ID:[0-9]+]] host_op_id=[[HOST_OP_ID:[0-9]+]] optype=ompt_target_data_delete
|
|
/// CHECK: code=[[CODE1]]
|
|
/// CHECK: Callback Target: target_id=[[TARGET_ID:[0-9]+]] kind=ompt_target endpoint=ompt_scope_end device_num=[[DEVICE_NUM]] code=[[CODE1]]
|
|
|
|
/// CHECK: Callback Target: target_id=[[TARGET_ID:[0-9]+]] kind=ompt_target endpoint=ompt_scope_begin device_num=[[DEVICE_NUM]]
|
|
/// CHECK-NOT: code=(nil)
|
|
/// CHECK: code=[[CODE2:.*]]
|
|
/// CHECK: Callback DataOp: target_id=[[TARGET_ID:[0-9]+]] host_op_id=[[HOST_OP_ID:[0-9]+]] optype=ompt_target_data_alloc
|
|
/// CHECK: code=[[CODE2]]
|
|
/// CHECK: Callback DataOp: target_id=[[TARGET_ID:[0-9]+]] host_op_id=[[HOST_OP_ID:[0-9]+]] optype=ompt_target_data_transfer_to_device
|
|
/// CHECK: code=[[CODE2]]
|
|
/// CHECK: Callback DataOp: target_id=[[TARGET_ID:[0-9]+]] host_op_id=[[HOST_OP_ID:[0-9]+]] optype=ompt_target_data_alloc
|
|
/// CHECK: code=[[CODE2]]
|
|
/// CHECK: Callback DataOp: target_id=[[TARGET_ID:[0-9]+]] host_op_id=[[HOST_OP_ID:[0-9]+]] optype=ompt_target_data_transfer_to_device
|
|
/// CHECK: code=[[CODE2]]
|
|
/// CHECK: Callback Submit: target_id=[[TARGET_ID:[0-9]+]] host_op_id=[[HOST_OP_ID:[0-9]+]] req_num_teams=0
|
|
/// CHECK: Callback DataOp: target_id=[[TARGET_ID:[0-9]+]] host_op_id=[[HOST_OP_ID:[0-9]+]] optype=ompt_target_data_transfer_from_device
|
|
/// CHECK: code=[[CODE2]]
|
|
/// CHECK: Callback DataOp: target_id=[[TARGET_ID:[0-9]+]] host_op_id=[[HOST_OP_ID:[0-9]+]] optype=ompt_target_data_transfer_from_device
|
|
/// CHECK: code=[[CODE2]]
|
|
/// CHECK: Callback DataOp: target_id=[[TARGET_ID:[0-9]+]] host_op_id=[[HOST_OP_ID:[0-9]+]] optype=ompt_target_data_delete
|
|
/// CHECK: code=[[CODE2]]
|
|
/// CHECK: Callback DataOp: target_id=[[TARGET_ID:[0-9]+]] host_op_id=[[HOST_OP_ID:[0-9]+]] optype=ompt_target_data_delete
|
|
/// CHECK: code=[[CODE2]]
|
|
/// CHECK: Callback Target: target_id=[[TARGET_ID:[0-9]+]] kind=ompt_target endpoint=ompt_scope_end device_num=[[DEVICE_NUM]] code=[[CODE2]]
|
|
/// CHECK: Callback Fini:
|