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>
62 lines
1.2 KiB
C
62 lines
1.2 KiB
C
// RUN: %libomptarget-compileopt-run-and-check-generic
|
|
//
|
|
// REQUIRES: gpu
|
|
// XFAIL: intelgpu
|
|
|
|
#include <omp.h>
|
|
#include <ompx.h>
|
|
#include <stdio.h>
|
|
#include <stdlib.h>
|
|
#include <string.h>
|
|
|
|
struct info {
|
|
int tid, bid, tdim;
|
|
};
|
|
|
|
int main(int argc, char **argv) {
|
|
int N = 1 << 20;
|
|
if (argc > 1)
|
|
N = atoi(argv[1]);
|
|
|
|
struct info *X = (struct info *)malloc(sizeof(*X) * N);
|
|
memset(X, '0', sizeof(*X) * N);
|
|
|
|
int TL = 256;
|
|
int NT = (N + TL - 1) / TL;
|
|
|
|
#pragma omp target data map(tofrom : X [0:N])
|
|
#pragma omp target teams num_teams(NT) thread_limit(TL)
|
|
{
|
|
#pragma omp parallel
|
|
{
|
|
int tid = ompx_thread_id_x();
|
|
int bid = ompx_block_id_x();
|
|
int tdim = ompx_block_dim_x();
|
|
int gid = tid + bid * tdim;
|
|
if (gid < N) {
|
|
X[gid].tid = tid;
|
|
X[gid].bid = bid;
|
|
X[gid].tdim = tdim;
|
|
};
|
|
}
|
|
}
|
|
|
|
int tid = 0, bid = 0, tdim = 256;
|
|
for (int i = 0; i < N; i++) {
|
|
if (X[i].tid != tid || X[i].bid != bid || X[i].tdim != tdim) {
|
|
printf("%i: %i vs %i, %i vs %i, %i vs %i\n", i, X[i].tid, tid, X[i].bid,
|
|
bid, X[i].tdim, tdim);
|
|
return 1;
|
|
}
|
|
tid++;
|
|
if (tid == tdim) {
|
|
tid = 0;
|
|
bid++;
|
|
}
|
|
}
|
|
|
|
// CHECK: OK
|
|
printf("OK");
|
|
return 0;
|
|
}
|