host.c --serve --pack <dir> serves a pack read at run time (packfile.h), whatever pack the exe was built against: the first pair is built and self-tested like a prepared one (pairBuffers, pairSelfTest), prepared pairs are self-tested too, the ready line says path prebuilt-generic. cl_dynamic.h (IGNEUM_CL_DYNAMIC) opens OpenCL.dll with LoadLibrary and fills a function pointer per entry point, so the mingw build links no import library. test-generic.sh checks the mode through Apple OpenCL with the packs of the CUDA emulation test: PASS (192 found, prepare and swap, 15 sampled hashes equal igneum-pow hash-bound), built against a different placeholder pack than it served. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
20 lines
1.6 KiB
Bash
Executable file
20 lines
1.6 KiB
Bash
Executable file
#!/usr/bin/env bash
|
|
# Checks the generic serve mode of host.c (--serve --pack <dir>, the one-click AMD worker's mode) on this Mac through
|
|
# Apple's OpenCL runtime: the exe is built against one pack as a placeholder and then serves two others read at run
|
|
# time, with the same protocol script as the CUDA emulation (proto-cuda/nvrtc/emu/serve-check.sh): jobs on pack A,
|
|
# a background prepare of pack B with its self-test, the swap, the refusal after the swap, and a sample of found
|
|
# hashes against igneum-pow hash-bound. Apple OpenCL is a correctness check only, not an AMD number.
|
|
# Usage: ./test-generic.sh (needs proto-cuda/nvrtc/emu/test.sh to have run once: it writes pack-a and pack-b)
|
|
set -euo pipefail
|
|
cd "$(dirname "$0")"
|
|
ROOT="$(cd .. && pwd)"
|
|
EMUB="$ROOT/proto-cuda/nvrtc/emu/build"
|
|
[ -f "$EMUB/pack-a/seeds.txt" ] && [ -f "$EMUB/pack-b/seeds.txt" ] || { echo "run proto-cuda/nvrtc/emu/test.sh first (it writes $EMUB/pack-a and pack-b)" >&2; exit 1; }
|
|
PLACEHOLDER="../proto-cuda/packs/igneum-genesis-mh" # a different pack on purpose: the exe must not depend on it
|
|
CC="${CC:-cc}"
|
|
"$CC" -std=c99 -O2 -Wall -Wextra -Wno-deprecated-declarations -I "$PLACEHOLDER" -DIGNEUM_KERNEL_PATH="\"$PLACEHOLDER/kernel.cl\"" \
|
|
-o igneum-bench-cl-generic-test host.c -framework OpenCL
|
|
echo "built ./igneum-bench-cl-generic-test (placeholder pack $PLACEHOLDER, Apple OpenCL)"
|
|
"$ROOT/proto-cuda/nvrtc/emu/serve-check.sh" "$EMUB/pack-a" "$EMUB/pack-b" "$PWD/generic-test.log" \
|
|
./igneum-bench-cl-generic-test --serve --pack "$EMUB/pack-a" --batch-log2 13
|
|
grep '^ready\|^info first pack\|^prepared' generic-test.log
|