numbox.utils

numbox.utils.highlevel

numbox.utils.highlevel.cres(sig, **kwargs)[source]

Returns Python proxy to FunctionType rather than CPUDispatcher returned by njit

numbox.utils.highlevel.determine_field_index(struct_ty, field_name)[source]
numbox.utils.highlevel.hash_type(ty: Type)[source]
numbox.utils.highlevel.prune_type(ty)[source]

numbox.utils.lowlevel

numbox.utils.lowlevel.cast(source, dest_ty)[source]

Cast source to the type dest_ty

numbox.utils.lowlevel.deref_payload(p, ty)[source]

Dereference payload of structref p as type ty

numbox.utils.lowlevel.extract_struct_member(context: BaseContext, builder: IRBuilder, struct_fe_ty: StructRef, struct_obj, member_name: str, incref: bool = False)[source]

For the given struct object of the given numba (front-end) type extract member with the given name (must be literal, available at compile time)

numbox.utils.lowlevel.get_func_p_as_int_from_func_struct(func_)[source]
numbox.utils.lowlevel.get_func_p_from_func_struct(builder: IRBuilder, func_struct)[source]

Extract void* function pointer from the low-level FunctionType structure

numbox.utils.lowlevel.get_func_tuple(func)[source]
numbox.utils.lowlevel.get_ll_func_sig(context: BaseContext, func_ty: FunctionType)[source]
numbox.utils.lowlevel.get_str_from_p_as_int(p)[source]

Given pointer to null-terminated array of characters as an integer p, return unicode string object copying the original string’s data

numbox.utils.lowlevel.get_unicode_data_p(s)[source]

Given Python unicode string, return pointer to its data payload, array of null-terminated characters. See https://github.com/numba/numba/blob/release0.61/numba/cpython/unicode.py#L83

numbox.utils.lowlevel.populate_structref(context, builder, structref_type_, args, data_pointer, ordered_args_names)[source]

Store args with the corresponding ordered names ordered_args_names in structref with type structref_type_ and payload at data_pointer.

This is not a substitute for ‘setattr’ and is only to be used when initializing a new structref, as it does not take care of decref’ing of any possible MemInfo that might be already referenced by a member of the structref. (On the other hand, it appears that neither does numba <=0.61 standard implementation)

numbox.utils.lowlevel.tuple_of_struct_ptrs_as_int(tup)[source]
numbox.utils.lowlevel.uniformize_tuple_of_structs(tup, uniform_ty=numba.VoidTypeClass())[source]

numbox.utils.timer

class numbox.utils.timer.Timer[source]

Bases: object

times = {}