Following code (from Eigen) crashes on compilation
Submitted by Hugh Perkins
Assigned to Zhigang Gong @gongzg
Description
Following code, from running Eigen in OpenCL (https://github.com/tensorflow/tensorflow/issues/22#issuecomment-252608921 ), crashes on compilation:
struct Eigen__TensorEvaluator { global float* f0; float f1; };
kernel void foo(global struct Eigen__TensorEvaluator* pstruct, global float* floats0) { pstruct[0].f0 = floats0; pstruct[0].f0[0] = pstruct[0].f1; }
Result:
context <pyopencl.Context at 0x3330740 on <pyopencl.Device 'Intel(R) HD Graphics 5500 BroadWell U-Processor GT2' on 'Intel Gen OCL Driver' at 0x7f32bde1dbe0>> make: 'test/eigen/generated/test_cuda_nullary-device.cl' is up to date.
compiling cl for test/eigen/generated/test_cuda_nullary-device.cl ...
ASSERTION FAILED: (isa<AllocaInst>
(ptr) || ptrCandidate.empty()) && "storing/loading pointers only support private array"
at file /home/ubuntu/git/beignet/backend/src/llvm/llvm_gen_backend.cpp, function void gbe::GenWriter::findPointerEscape(llvm::Value*, std::setllvm::Value*&, bool, std::vector<llvm::Value*, std::allocatorllvm::Value* >&), line 953
Trace/breakpoint trap
This is a blocker for porting Eigen to OpenCL. Porting Eigen to OpenCL is a pre-requisite for porting Tensorflow to OpenCL. Tensorflow is a highly popular machine learning library recently.