| { | |
| "name": "loop_104", | |
| "op_type": "loop_104", | |
| "description": "Compute byte-value frequency histogram using segmented counting", | |
| "tags": [ | |
| "simd-loop" | |
| ], | |
| "axes": { | |
| "n": { | |
| "type": "var", | |
| "description": "axis n" | |
| }, | |
| "histogram_size": { | |
| "type": "const", | |
| "value": 256, | |
| "description": "const histogram_size" | |
| } | |
| }, | |
| "inputs": { | |
| "data": { | |
| "shape": [ | |
| "n" | |
| ], | |
| "dtype": "uint8" | |
| } | |
| }, | |
| "outputs": { | |
| "histogram": { | |
| "shape": [ | |
| "histogram_size" | |
| ], | |
| "dtype": "uint32", | |
| "description": "Output array" | |
| } | |
| }, | |
| "reference": "import numpy as np\n\ndef run(data):\n return np.bincount(data.astype(np.int64), minlength=256)[:256].astype(np.uint32)\n", | |
| "simd_loop_meta": { | |
| "output_inplace": false, | |
| "array_pad": 0, | |
| "scratch": [], | |
| "axes_order": [ | |
| "histogram_size", | |
| "n" | |
| ] | |
| } | |
| } | |