rbc icon indicating copy to clipboard operation
rbc copied to clipboard

Can we specify Numpy array as the input?

Open jimlinntu opened this issue 11 months ago • 1 comments

I saw this example in the README.md

@rjit('double(double, double)', 'int(int, int)')
def add(x, y):
    return x + y

Is it possible to rjit a function that has Numpy array inputs?

i.e. something like

@rjit('double[:](double[:], double[:])')
def add(x, y):
    return x + y

jimlinntu avatar Jan 24 '25 00:01 jimlinntu

Yes, in principle. The rjit signature should read rjit('double[](double[], double[])').

For the heavydb backend, see test cases in https://github.com/heavyai/rbc/blob/main/rbc/tests/heavydb/test_array_math.py, for instance.

For the numpy backend, I am sure it can be made to work.

pearu avatar Jan 24 '25 08:01 pearu