rod*_*ing 1 python numpy opencl pyopencl
今天醒来突然发现
C:\Python27\lib\site-packages\pyopencl\__init__.py:61: CompilerWarning: Non-empty compiler output encountered. Set the environment variable PYOPENCL_COMPILER_OUTPUT=1 to see more.
"to see more.", CompilerWarning)
C:\Python27\lib\site-packages\pyopencl\cache.py:101: UserWarning: could not obtain cache lock--delete 'c:\users\User\appdata\local\temp\pyopencl-compiler-cache-v2-uiduser-py2.7.3.final.0\lock' if necessary
% self.lock_file)
Run Code Online (Sandbox Code Playgroud)
当我运行任何类型的 PqOpenCL 代码时,例如:
import numpy
import pyopencl as cl
import pyopencl.array as clarray
from pyopencl.reduction import ReductionKernel
ctx = cl.create_some_context()
queue = cl.CommandQueue(ctx)
krnl = ReductionKernel(ctx, numpy.float32, neutral="0",
reduce_expr="a+b", map_expr="x[i]*y[i]",
arguments="__global float *x, __global float *y")
x = clarray.arange(queue, 400, dtype=numpy.float32)
y = clarray.arange(queue, 400, dtype=numpy.float32)
m = krnl(x, y).get()
Run Code Online (Sandbox Code Playgroud)
样品和部分解决方案来自这里
解决方案建议回滚 numpy,我从 1.8.0 执行到 1.7.2 但仍然存在同样的问题
编辑1
根据建议添加
import os
os.environ['PYOPENCL_COMPILER_OUTPUT'] = '1'
C:\Python27\lib\site-packages\pyopencl\__init__.py:57: CompilerWarning: From-source build succeeded, but resulted in non-empty logs:
Build on <pyopencl.Device 'Intel(R) HD Graphics 4000' on 'Intel(R) OpenCL' at 0x51eadff0> succeeded, but said:
fcl build 1 succeeded.
fcl build 2 succeeded.
bcl build succeeded.
warn(text, CompilerWarning)
Run Code Online (Sandbox Code Playgroud)
import os
os.environ['PYOPENCL_COMPILER_OUTPUT'] = '1'
Run Code Online (Sandbox Code Playgroud)
执行此操作以查看编译器输出,我之前收到过相同的消息。只是英特尔 opencl 编译器说它已经对 opencl 内核进行了矢量化\优化。
| 归档时间: |
|
| 查看次数: |
5284 次 |
| 最近记录: |