私はpyclblas(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)
これは私にエラーを与える:
は、ここに私のコードです。 問題の内容を知っている人はいますか? ありがとう!