Results for query "numba ctypes_support"

Swift Debounce On Touch Script

This program in swift is not working, I do not understand why this debounce does not work.var numba = 0
var debounce = false
@IBAction func ChangeTouchUp(_ sender: Any) {
if debounce == false {
debounce = true
numba = numba + 1
Fire.

The numba fibonacci function is slower and does not return the same result

This code return slow and with different output:



from numba import jit
from timeit import default_timer as timer
def fibonacci(n):
a, b = 1, 1
for i in range(n):
a, b = a+b, a
return a
fibonacci_jit = jit(fibonacci)


let start the test

start = timer()
print fibonacci(100)
duration = timer() - start


let start the test

startnext = timer()
print fibonacci_jit(100)
durationnext = timer() - startnext


print(duration, durationnext)


The result:

C:\Python27>python numba_test_003.0003879070281982422, 0.

Compute eigens with numba cuda

I found numba and tried with jit which default using CPU.I tried with target flags with cuda like this:

from numba import jit, cuda
import numpy as np
from time import time
@jit(target="cuda")
def eigens(a):
val, vec = np.