Skip to content

Instantly share code, notes, and snippets.

@gmarkall
Created April 15, 2015 12:02
Show Gist options
  • Save gmarkall/1fad69775ae6e23e2523 to your computer and use it in GitHub Desktop.
Save gmarkall/1fad69775ae6e23e2523 to your computer and use it in GitHub Desktop.
inspect types, llvm, and asm in Numba
import numpy as np
from numba import njit
@njit
def f(arr1, arr2):
for i in range(len(arr1)):
arr1[i] += arr2[i]
a = np.arange(10)
b = np.arange(10)
f(a, b)
f.inspect_types()
llvm = f.inspect_llvm()
for k, v in llvm.items():
print(k)
print(v)
print()
asm = f.inspect_asm()
for k, v in asm.items():
print(k)
print(v)
print()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment