pyblblas (clblas에 대한 python 래퍼)를 사용하여 계산을 실행하려고했지만 약간의 문제가 발생했습니다.간단한 예제에 대한 pyclblas 사용
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/lib/python2.7/dist-packages/spyderlib/widgets/externalshell/sitecustomize.py", line 540, in runfile
execfile(filename, namespace)
File "/home/name/.spyder2/.temp.py", line 49, in <module>
res = pyclblas.clblasSscal(len(c_np), 1.0, c_g, 0, 1, queue, None)
File "/usr/local/lib/python2.7/dist-packages/pyclblas.py", line 245, in clblasSscal
return pyclblas_swig.clblasSscal(N, alpha, X, offx, incx, commandQueues, eventWaitList)
TypeError: in method 'clblasSscal', argument 6 of type 'cl_uint'
문서는 큐가 pyopencl.CommandQueue하지 'cl_uint'해야한다고 말한다 :
# imports (my python is 2.7)
from __future__ import absolute_import, print_function
import numpy as np
import pyopencl as cl
import pyclblas
# create some generic structures according to pyopencl tutorial
ctx = cl.create_some_context()
queue = cl.CommandQueue(ctx)
mf = cl.mem_flags
# create a vector and a buffer
c_np = np.random.rand(50000).astype(np.float)
c_g = cl.Buffer(ctx, mf.READ_ONLY | mf.COPY_HOST_PTR, hostbuf=c_np)
# use pyclblas to make a calculation with the vector
res = pyclblas.clblasSscal(len(c_np), 1.0, c_g, 0, 1, queue, None)
이 나에게 오류를 제공합니다
여기 내 코드입니다. 문제가 무엇인지 아는 사람이 있습니까? 감사합니다.