arm-bench-trace / solutions /simd-loop /reference-scalar /loop_128 /reference-scalar_loop_128.json
awu12's picture
Add simd-loop reference-scalar solutions (self-contained, harness embedded)
85bd925 verified
Raw
History Blame
1.85 kB
{
"name": "reference-scalar_loop_128",
"definition": "loop_128",
"dataset": "simd-loop",
"author": "reference-scalar",
"spec": {
"language": "cpp",
"target_hardware": [
"aarch64"
],
"entry_point": "kernel.cpp::inner_loop_128",
"dependencies": [],
"isa_features": [],
"compile_flags": [
"-O2",
"-std=c++14"
],
"link_flags": []
},
"sources": [
{
"path": "loop_128.h",
"content": "// Auto-generated by scripts/gen_simd_loop_harness.py \u2014 do not hand-edit.\n#pragma once\n#include <stdint.h>\n\nstruct loop_128_data {\n uint32_t *a;\n uint32_t *b;\n uint32_t *c;\n int n;\n};\n\n#ifdef __cplusplus\nextern \"C\" {\n#endif\nint armbench_entry_loop_128(void *a, void *b, int64_t n, void *res_out);\n#ifdef __cplusplus\n}\n#endif\n"
},
{
"path": "loop_128.cpp",
"content": "// Auto-generated by scripts/gen_simd_loop_harness.py \u2014 do not hand-edit.\n#include \"loop_128.h\"\n#include <stdint.h>\n\nextern \"C\" void inner_loop_128(struct loop_128_data *data);\n\nextern \"C\" int armbench_entry_loop_128(void *a, void *b, int64_t n, void *res_out) {\n struct loop_128_data data;\n data.a = static_cast<uint32_t *>(a);\n data.b = static_cast<uint32_t *>(b);\n data.c = static_cast<uint32_t *>(res_out);\n data.n = static_cast<int>(n);\n inner_loop_128(&data);\n return 0;\n}\n"
},
{
"path": "kernel.cpp",
"content": "#include \"loop_128.h\"\n#include <stdint.h>\n\nextern \"C\" void inner_loop_128(struct loop_128_data * data) {\n uint32_t *a = data->a;\n uint32_t *b = data->b;\n uint32_t *c = data->c;\n int n = data->n;\n\n for (int i = 0; i < n; i++) {\n c[i] = a[i] + b[i];\n }\n}\n"
}
],
"description": "Scalar reference for loop_128. Baseline for speedup measurement."
}