File size: 980 Bytes
f25167e | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 | {
"name": "loop_102",
"op_type": "loop_102",
"description": "Count the frequency of each byte value in a large buffer (histogram)",
"tags": [
"simd-loop"
],
"axes": {
"num_records": {
"type": "var",
"description": "axis num_records"
},
"histogram_size": {
"type": "const",
"value": 128,
"description": "const histogram_size"
}
},
"inputs": {
"records": {
"shape": [
"num_records"
],
"dtype": "uint32"
}
},
"outputs": {
"histogram": {
"shape": [
"histogram_size"
],
"dtype": "uint32",
"description": "Output array"
}
},
"reference": "import numpy as np\n\ndef run(records):\n return np.bincount(records.astype(np.int64), minlength=128)[:128].astype(np.uint32)\n",
"simd_loop_meta": {
"output_inplace": false,
"array_pad": 0,
"scratch": [],
"axes_order": [
"histogram_size",
"num_records"
]
}
}
|