Open
Description
We need to be able to generate the following code in the C backend:
void f(uint16_t *q) {
for (size_t i = 0; i < 10; i++) {
g(&q[i])
}
}
How should the Python code look like?
One idea:
@ccall
def g(a: CPtr) -> None:
pass
@ccallable
def f(q_void: CPtr) -> None:
q: Pointer[i16[:]]
c_p_pointer(q_void, q)
for i in range(10):
q2: CPtr
p_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.
Metadata
Metadata
Assignees
Labels
No labels