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).
49 lines
1.3 KiB
C
49 lines
1.3 KiB
C
// RUN: %libomptarget-compile-run-and-check-generic
|
|
// REQUIRES: nvptx64-nvidia-cuda
|
|
|
|
#include <assert.h>
|
|
#include <omp.h>
|
|
#include <stdint.h>
|
|
#include <stdio.h>
|
|
#include <stdlib.h>
|
|
|
|
typedef void *cudaStream_t;
|
|
|
|
int main() {
|
|
|
|
int device_id = omp_get_default_device();
|
|
|
|
#pragma omp parallel master
|
|
{
|
|
|
|
double D0, D2;
|
|
omp_interop_t interop;
|
|
|
|
#pragma omp interop init(targetsync : interop) device(device_id) nowait
|
|
assert(interop != NULL);
|
|
|
|
int err;
|
|
for (int i = omp_ipr_first; i < 0; i++) {
|
|
const char *n =
|
|
omp_get_interop_name(interop, (omp_interop_property_t)(i));
|
|
long int li =
|
|
omp_get_interop_int(interop, (omp_interop_property_t)(i), &err);
|
|
const void *p =
|
|
omp_get_interop_ptr(interop, (omp_interop_property_t)(i), &err);
|
|
const char *s =
|
|
omp_get_interop_str(interop, (omp_interop_property_t)(i), &err);
|
|
const char *n1 =
|
|
omp_get_interop_type_desc(interop, (omp_interop_property_t)(i));
|
|
}
|
|
#pragma omp interop use(interop) depend(in : D0, D2)
|
|
|
|
cudaStream_t stream =
|
|
(omp_get_interop_ptr(interop, omp_ipr_targetsync, NULL));
|
|
assert(stream != NULL);
|
|
|
|
#pragma omp interop destroy(interop) depend(in : D0, D2) device(device_id)
|
|
}
|
|
printf("PASS\n");
|
|
}
|
|
// CHECK: PASS
|