copapy.jit#

copapy.jit(func)#

Just-in-time compile a function for the copapy target.

Arguments with the buffer protocol (bytes, bytearray, memoryview, numpy arrays) are mapped to copapy arrays. Byte, 32 bit int and 32 bit float arrays are supported without conversion.

The function is compiled for each combination of types and shapes of the arguments. Arrays are returned as nested lists, arrays marked with map_to_buffer or map_to_numpy as memoryview or numpy array.

Parameters:

func (Callable[..., Any]) – Function to compile

Return type:

Callable[..., Any]

Returns:

A callable that runs the compiled function.