2014-02-13 81 views
0

我是Python中NumbaPro的新手。我有以下代碼,我想在CUDA(Anaconda Accelerate)的x,y網格中並行化,但是每次運行它時,它都會在Decorator行中出現NotImplementedError,我不確定有什麼不對,有人可以幫助我嗎?非常感謝:NumbaPro(Python)裝飾器的NotImplementedError

@cuda.jit(argtypes=(float64[:,:], float64[:,:,:], float64, float64, float64), device=True) 
def computeflow(PMapping2, Array_hist2, Num_f1, p_depth1, image_width1): 
    x, y = cuda.grid(2); 
    for y in xrange(0,p_depth1): 
     for x in xrange(0,image_width1): 
      Array_H, bin_edges = numpy.histogram(Array_hist2[y,x,:], bins=Num_f1, range=None, normed=False, weights=None, density=None); 
      Array_H = (numpy.imag(numpy.fft.ifft(Array_H,n=1024))); 
      Array_H1 = Array_H[0:len(Array_H)/2]; 
      Array_H1[20:1024] = 0; 
      PMapping2[y,x] = numpy.sum(Array_H1);    
Mapping1=cuda.to_device(PMapping); 
Array_hist1=cuda.to_device(Array_hist); 
computeflow[(3,3),(3,3)](PMapping, Array_hist, Num_f, p_depth, image_width); 
PMapping1.to_host(); 
+0

可能意味着您使用的功能尚未在numbapro中實現。它仍在開發中,所以還有一些缺失的東西。錯誤消息是否說明了什麼沒有實現? – M4rtini

+0

NotImplementedError:offset = 203 opcode = 2b opname = STORE_SLICE + 3 這是我得到的錯誤,謝謝! – Kyle

回答

0

NotImplementedError: offset=203 opcode=2b opname=STORE_SLICE+3

這意味着切片操作a[i:j] = b尚未實現。 ref

看着你正在嘗試使用cuda的功能,看起來你並不完全理解cuda是如何工作的。我建議你看一些例如cuda/pycudaopencl/pyopencl的一般指南,以便快速瞭解如何設計用於parallalizing的功能。這是一個太大的話題要通過這裏。這些文件對於這些類型的東西在代理頁面上非常糟糕。可能是因爲仍然有很多發展正在進行。

+0

感謝您的回答! – Kyle