awu12's picture
Replace pre-PR#15 conv2d-only trace with current simd-loop set (definitions + workloads + reference/autovec solutions)
f25167e verified
Raw
History Blame Contribute Delete
1.35 kB
{
"name": "loop_110",
"op_type": "loop_110",
"description": "Compute complex dot product of two arrays of uint32 complex numbers",
"tags": [
"simd-loop"
],
"axes": {
"size": {
"type": "var",
"description": "axis size"
},
"size2": {
"type": "var",
"description": "axis size2"
},
"cdim": {
"type": "const",
"value": 2,
"description": "const cdim"
}
},
"inputs": {
"a0": {
"shape": [
"size2",
"cdim"
],
"dtype": "int8"
},
"b0": {
"shape": [
"size2",
"cdim"
],
"dtype": "int8"
}
},
"outputs": {
"c0": {
"shape": [
"size",
"cdim"
],
"dtype": "int32",
"description": "Output array"
}
},
"reference": "import numpy as np\n\ndef run(a0, b0):\n a = a0.astype(np.int64); b = b0.astype(np.int64)\n ae, ao = a[0::2], a[1::2]; be, bo = b[0::2], b[1::2]\n cr = (ae[:, 0]*be[:, 0] - ae[:, 1]*be[:, 1]) + (ao[:, 0]*bo[:, 0] - ao[:, 1]*bo[:, 1])\n ci = (ae[:, 1]*be[:, 0] + ae[:, 0]*be[:, 1]) + (ao[:, 1]*bo[:, 0] + ao[:, 0]*bo[:, 1])\n return np.stack([cr, ci], axis=1).astype(np.int32)\n",
"simd_loop_meta": {
"output_inplace": false,
"array_pad": 0,
"scratch": [],
"axes_order": [
"size"
]
}
}