Package: beignet
Version: 0.9.3~dfsg-2
(That version is only in Alioth as yet, but as I haven't touched
anything related to this, I suspect the problem is upstream)
If an OpenCL kernel attempts to call a non-existent function (e.g.
"b[i]=cossss(a[i])", as in the attached), pocl returns a helpful
"undefined symbol: cossss" error message, but beignet simply crashes
with "Segmentation fault".
gdb backtrace:
#0 0x00007ffff26b7eb1 in llvm::Function::getIntrinsicID() const ()
from /usr/lib/beignet//libgbe.so
No symbol table info available.
#1 0x00007ffff18419e2 in ?? () from /usr/lib/beignet//libgbe.so
No symbol table info available.
#2 0x00007ffff2702c07 in
llvm::FPPassManager::runOnFunction(llvm::Function&)
() from /usr/lib/beignet//libgbe.so
No symbol table info available.
#3 0x00007ffff250b433 in ?? () from /usr/lib/beignet//libgbe.so
No symbol table info available.
#4 0x00007ffff2705649 in
llvm::legacy::PassManagerImpl::run(llvm::Module&) ()
from /usr/lib/beignet//libgbe.so
No symbol table info available.
#5 0x00007ffff18446a9 in ?? () from /usr/lib/beignet//libgbe.so
No symbol table info available.
#6 0x00007ffff17eeb02 in ?? () from /usr/lib/beignet//libgbe.so
No symbol table info available.
#7 0x00007ffff18a5f10 in ?? () from /usr/lib/beignet//libgbe.so
No symbol table info available.
#8 0x00007ffff17f325b in ?? () from /usr/lib/beignet//libgbe.so
No symbol table info available.
#9 0x00007ffff5a0386d in ?? () from /usr/lib/beignet/libcl.so
No symbol table info available.
---Type <return> to continue, or q <return> to quit---
#10 0x00007ffff59fbdf5 in clBuildProgram () from /usr/lib/beignet/libcl.so
No symbol table info available.
from __future__ import division,print_function
import pyopencl
import pyopencl.array
import numpy as np
import time
import pyopencl.clmath
ctx1=pyopencl.create_some_context()
cq1=pyopencl.CommandQueue(ctx1)
a=np.random.randn(1e6).astype(np.dtype('float32'))
aCL=pyopencl.array.to_device(cq1,a)
bCL=pyopencl.array.to_device(cq1,a)
flist=[pyopencl.elementwise.ElementwiseKernel(ctx1,pyopencl.tools.dtype_to_ctype(aCL.dtype)+" *a,"+pyopencl.tools.dtype_to_ctype(aCL.dtype)+" *b","b[i]=cos(a[i])+/-","badsyntax"),pyopencl.elementwise.ElementwiseKernel(ctx1,pyopencl.tools.dtype_to_ctype(aCL.dtype)+" *a,"+pyopencl.tools.dtype_to_ctype(aCL.dtype)+" *b","b[i]=cos(aaaaa[i])","badvar"),pyopencl.elementwise.ElementwiseKernel(ctx1,pyopencl.tools.dtype_to_ctype(aCL.dtype)+" *a,"+pyopencl.tools.dtype_to_ctype(aCL.dtype)+" *b","b[i]=cossss(a[i])","badfunc")]
for f in flist:
try:
f(aCL,bCL).wait()
print("success")
except pyopencl.RuntimeError as e:
print("error:",e)
print("end")