cb424d7448
verify-patch-sanity.py validates every active recipe .patch has internally- consistent hunk line counts — catching the 'malformed patch at line N' failure at commit/CI/preflight time instead of hours into a cook. This cycle hit that class three times (qtwaylandscanner, sddm, xwayland), each only discovered when cookbook tried to apply the patch. Running it across the repo found 29 latent malformed patches (validated against GNU patch: e.g. relibc/P3-sysv-ipc reproduces 'malformed patch at line 22'). They were harmless only because they sit in vendored recipes (baked, not re- applied) — but would fail on any version-bump re-derivation. --fix recounts the hunk headers (body untouched) and repaired all 29. Wired into build-preflight.sh (Phase 1.0D) and redbear-ci.yml, with a unit test (test-patch-sanity.sh). Skips archived/legacy trees and unvalidatable formats (empty placeholders, bare-@@ git hunks).
102 lines
3.6 KiB
C
102 lines
3.6 KiB
C
// RUN: %libomptarget-compile-run-and-check-generic
|
|
// REQUIRES: ompt
|
|
// REQUIRES: gpu
|
|
|
|
/*
|
|
* 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=1 endpoint=1 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=1
|
|
/// CHECK: code=[[CODE1]]
|
|
/// CHECK: Callback DataOp: target_id=[[TARGET_ID:[0-9]+]] host_op_id=[[HOST_OP_ID:[0-9]+]] optype=2
|
|
/// CHECK: code=[[CODE1]]
|
|
/// CHECK: Callback DataOp: target_id=[[TARGET_ID:[0-9]+]] host_op_id=[[HOST_OP_ID:[0-9]+]] optype=1
|
|
/// CHECK: code=[[CODE1]]
|
|
/// CHECK: Callback DataOp: target_id=[[TARGET_ID:[0-9]+]] host_op_id=[[HOST_OP_ID:[0-9]+]] optype=2
|
|
/// 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=3
|
|
/// CHECK: code=[[CODE1]]
|
|
/// CHECK: Callback DataOp: target_id=[[TARGET_ID:[0-9]+]] host_op_id=[[HOST_OP_ID:[0-9]+]] optype=3
|
|
/// CHECK: code=[[CODE1]]
|
|
/// CHECK: Callback DataOp: target_id=[[TARGET_ID:[0-9]+]] host_op_id=[[HOST_OP_ID:[0-9]+]] optype=4
|
|
/// CHECK: code=[[CODE1]]
|
|
/// CHECK: Callback DataOp: target_id=[[TARGET_ID:[0-9]+]] host_op_id=[[HOST_OP_ID:[0-9]+]] optype=4
|
|
/// CHECK: code=[[CODE1]]
|
|
/// CHECK: Callback Target: target_id=[[TARGET_ID:[0-9]+]] kind=1 endpoint=2 device_num=[[DEVICE_NUM]] code=[[CODE1]]
|
|
|
|
/// CHECK: Callback Target: target_id=[[TARGET_ID:[0-9]+]] kind=1 endpoint=1
|
|
/// 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=1
|
|
/// CHECK: code=[[CODE2]]
|
|
/// CHECK: Callback DataOp: target_id=[[TARGET_ID:[0-9]+]] host_op_id=[[HOST_OP_ID:[0-9]+]] optype=2
|
|
/// CHECK: code=[[CODE2]]
|
|
/// CHECK: Callback DataOp: target_id=[[TARGET_ID:[0-9]+]] host_op_id=[[HOST_OP_ID:[0-9]+]] optype=1
|
|
/// CHECK: code=[[CODE2]]
|
|
/// CHECK: Callback DataOp: target_id=[[TARGET_ID:[0-9]+]] host_op_id=[[HOST_OP_ID:[0-9]+]] optype=2
|
|
/// 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=3
|
|
/// CHECK: code=[[CODE2]]
|
|
/// CHECK: Callback DataOp: target_id=[[TARGET_ID:[0-9]+]] host_op_id=[[HOST_OP_ID:[0-9]+]] optype=3
|
|
/// CHECK: code=[[CODE2]]
|
|
/// CHECK: Callback DataOp: target_id=[[TARGET_ID:[0-9]+]] host_op_id=[[HOST_OP_ID:[0-9]+]] optype=4
|
|
/// CHECK: code=[[CODE2]]
|
|
/// CHECK: Callback DataOp: target_id=[[TARGET_ID:[0-9]+]] host_op_id=[[HOST_OP_ID:[0-9]+]] optype=4
|
|
/// CHECK: code=[[CODE2]]
|
|
/// CHECK: Callback Target: target_id=[[TARGET_ID:[0-9]+]] kind=1 endpoint=2 device_num=[[DEVICE_NUM]] code=[[CODE2]]
|
|
/// CHECK: Callback Fini:
|