We need to be able to generate the following code in the C backend:
voidf(uint16_t*q) { for (size_ti=0; i<10; i++) {
g(&q[i])
}
}How should the Python code look like?
One idea:
@ccalldefg(a: CPtr) ->None:
pass@ccallabledeff(q_void: CPtr) ->None:
q: Pointer[i16[:]]
c_p_pointer(q_void, q)
foriinrange(10):
q2: CPtrp_c_pointer(pointer(q[i]), q2)
g(q2)
In LPython we can support this, but in CPython it might not be possible, so maybe we need to change pointer(q[i]) to pointer_index(q, i) or something like that.
We need to be able to generate the following code in the C backend:
How should the Python code look like?
One idea:
In LPython we can support this, but in CPython it might not be possible, so maybe we need to change
pointer(q[i])topointer_index(q, i)or something like that.