PyOpenCL |无法启动内核

时间:2015-01-07 23:39:02

标签: python opencl gpu gpgpu pyopencl

当我使用PyOpenCL运行内核" SIMPLE_JOIN"它失败了。

.CL文件中的内容的标题

void SIMPLE_JOIN(__global const int* a, int a_col, __global const int* a_valuesPic,
                 __global const int* b, int b_col, __global const int* b_valuesPic,
                __global const int* join_valuesPic, __global int* current, const int maxVars, __global int* buffer, int joinVar)

PyOpenCL中的执行

program.SIMPLE_JOIN(context, (a_col, b_col), None,  \
                    buffer_a, np.int32(a_col), buffer_a_valPic, \
                    buffer_b, np.int32(b_col), buffer_b_valPic, \
                    buffer_join_valPic, buffer_current, np.int32(maxVars), \
                    buffer_result, np.int32(joinList[0]))

命令行中的错误

Traceback (most recent call last):
  File "C:\Program Files (x86)\JetBrains\PyCharm Community Edition 4.0.2\helpers\pydev\pydevd.py", line 2199, in <module>
    globals = debugger.run(setup['file'], None, None)
  File "C:\Program Files (x86)\JetBrains\PyCharm Community Edition 4.0.2\helpers\pydev\pydevd.py", line 1638, in run
    pydev_imports.execfile(file, globals, locals)  # execute the script
  File "C:/Users/��/Documents/��������/GAP+/gapQueryTree.py", line 213, in <module>
    res1_array, res1_ValsPic = gpu.gpu_join(p[0], p1_ValsPic, friend[0], friend1_ValsPic)
  File "C:/Users/��/Documents/��������/GAP+\gapPyOpenCl.py", line 107, in gpu_join
    buffer_result, np.int32(joinList[0]))
  File "C:\Python27\lib\site-packages\pyopencl\__init__.py", line 515, in kernel_call
    global_offset, wait_for, g_times_l=g_times_l)
Boost.Python.ArgumentError: Python argument types in
    pyopencl._cl.enqueue_nd_range_kernel(Context, Kernel, tuple, NoneType, NoneType, NoneType)
did not match C++ signature:
    enqueue_nd_range_kernel(class pyopencl::command_queue {lvalue} queue, class pyopencl::kernel {lvalue} kernel, class boost::python::api::object global_work_size, class boost::python::api::object local_work_size, class boost::python::api::object global_work_offset=None, class boost::python::api::object wait_for=None, bool g_times_l=False)

Process finished with exit code -1

1 个答案:

答案 0 :(得分:0)

内核调用的第一个参数应该是命令队列,而不是上下文:

program.SIMPLE_JOIN( queue , (a_col, b_col), None, \...