Download solutions/simd-loop/reference-scalar/loop_006/reference-scalar_loop_006.json from l3lab/KernelShift: direct link, hf CLI and curl.
- Browser
- Download file 2.01 kB
-
https://huggingface.co/datasets/l3lab/KernelShift/resolve/main/solutions/simd-loop/reference-scalar/loop_006/reference-scalar_loop_006.json
- Command line
-
hf download hf://datasets/l3lab/KernelShift/solutions/simd-loop/reference-scalar/loop_006/reference-scalar_loop_006.json
-
curl -L -o reference-scalar_loop_006.json https://huggingface.co/datasets/l3lab/KernelShift/resolve/main/solutions/simd-loop/reference-scalar/loop_006/reference-scalar_loop_006.json
2.01 kB
| { | |
| "name": "reference-scalar_loop_006", | |
| "definition": "loop_006", | |
| "dataset": "simd-loop", | |
| "author": "reference-scalar", | |
| "spec": { | |
| "language": "cpp", | |
| "target_hardware": [ | |
| "aarch64" | |
| ], | |
| "entry_point": "kernel.cpp::inner_loop_006", | |
| "dependencies": [], | |
| "isa_features": [], | |
| "compile_flags": [ | |
| "-O2", | |
| "-std=c++14" | |
| ], | |
| "link_flags": [] | |
| }, | |
| "sources": [ | |
| { | |
| "path": "loop_006.h", | |
| "content": "// Auto-generated by scripts/gen_simd_loop_harness.py — do not hand-edit.\n#pragma once\n#include <stdint.h>\n\nstruct loop_006_data {\n uint8_t *p;\n uint8_t *lmt;\n uint32_t checksum;\n};\n\n#ifdef __cplusplus\nextern \"C\" {\n#endif\nint kernelshift_entry_loop_006(void *p, int64_t n, void *res_out);\n#ifdef __cplusplus\n}\n#endif\n" | |
| }, | |
| { | |
| "path": "loop_006.cpp", | |
| "content": "// Auto-generated by scripts/gen_simd_loop_harness.py — do not hand-edit.\n#include \"loop_006.h\"\n#include <stdint.h>\n\nextern \"C\" void inner_loop_006(struct loop_006_data *data);\n\nextern \"C\" int kernelshift_entry_loop_006(void *p, int64_t n, void *res_out) {\n struct loop_006_data _kd;\n _kd.p = static_cast<uint8_t *>(p);\n _kd.lmt = static_cast<uint8_t *>(p) + n;\n _kd.checksum = 0;\n inner_loop_006(&_kd);\n *static_cast<uint32_t *>(res_out) = _kd.checksum;\n return 0;\n}\n" | |
| }, | |
| { | |
| "path": "kernel.cpp", | |
| "content": "#include \"loop_006.h\"\n#include <cstring>\n#include <stdint.h>\n\nextern \"C\" void inner_loop_006(struct loop_006_data *data) {\n uint8_t *p = data->p; uint8_t *lmt = data->lmt;\n uint32_t res = 0;\n while (p < lmt) {\n uint32_t len = (uint32_t)strlen((const char *)p);\n p += len + 1; res += 1; res ^= (len % 0xffff) << 16;\n }\n data->checksum = res;\n}\n" | |
| } | |
| ], | |
| "description": "Scalar reference for loop_006, built at -O2 with no -march (baseline NEON auto-vectorization applies; no SVE). Baseline for speedup measurement." | |
| } | |