简体   繁体   English

PyOpenCL | 无法启动内核

[英]PyOpenCL | Fail to launch a Kernel

When I'm using PyOpenCL to run the kernel "SIMPLE_JOIN" it fails. 当我使用PyOpenCL运行内核“ SIMPLE_JOIN”时,它失败了。

HEADER OF THE KERNEL IN .CL FILE .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)

THE EXECUTION IN PyOpenCL 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]))

THE ERROR IN THE COMMAND LINE 命令行中的错误

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

The first argument to your kernel invocation should be the command queue, not the context: 内核调用的第一个参数应该是命令队列,而不是上下文:

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM