Note that there are some explanatory texts on larger screens.

plurals
  1. POOpenCL - <eof> parser at end of file
    text
    copied!<p>I'm building an OpenCL-augmented application. When I was originally using ViennaCL I've found that while it compiles its internal kernels, I end up with the following:</p> <pre><code>Stack dump: 0. &lt;eof&gt; parser at end of file </code></pre> <p>I was quick to blame ViennaCL for failing me, so I've quickly thrown together a couple of OpenCL helper functions and attempted to compile a very simple vector addition kernel. </p> <p>The steps that the program makes are: </p> <ul> <li>create a platform</li> <li>select a device</li> <li>create a context</li> <li>create a queue</li> <li>push some data to device</li> <li><strong>compile a kernel</strong></li> <li>enqueue the kernel</li> <li>wait for kernel to finish </li> <li>read back the data</li> </ul> <p>After commenting out most of it, I'm left with the mandatory setup and the command to compile a kernel. The result is, however, still the same:</p> <pre><code>Stack dump: 0. &lt;eof&gt; parser at end of file </code></pre> <p>This is the offending function:</p> <pre><code>void createProgram(std::string progstr) { const char ** conv = new const char*[1]; conv[0] = progstr.c_str(); cl_int error = 0; program = clCreateProgramWithSource(context, 1, conv, NULL, &amp;error); if (error != CL_SUCCESS) { cout &lt;&lt; "Error creating command queue: " &lt;&lt; oclErrorString(error) &lt;&lt; endl; exit(error); } error = clBuildProgram(program, 1, &amp;device, NULL, NULL, NULL); if (error != CL_SUCCESS) { cout &lt;&lt; "Error creating command queue: " &lt;&lt; oclErrorString(error) &lt;&lt; endl; exit(error); } char* build_log; size_t log_size; clGetProgramBuildInfo(program, device, CL_PROGRAM_BUILD_LOG, 0, NULL, &amp;log_size); build_log = new char[log_size+1]; clGetProgramBuildInfo(program, device, CL_PROGRAM_BUILD_LOG, log_size, build_log, NULL); build_log[log_size] = '\0'; cout &lt;&lt; build_log &lt;&lt; endl; delete[] build_log; } </code></pre> <p><code>context</code> and <code>device</code> are defined and valid, <code>program</code> is a <code>cl_program</code>.</p> <p>I'm currently testing with a stock vector addition kernel:</p> <pre><code>__kernel void vector_add_gpu (__global const float* src_a, __global const float* src_b, __global float* res, const int num) { const int idx = get_global_id(0); if (idx &lt; num) res[idx] = src_a[idx] + src_b[idx]; } </code></pre> <p>I do not have access to another OpenCL-capable device to verify whether this might be something that I'm doing wrong.</p> <p>I'm at a complete loss now. I've googled up a single thread on an AMD forum that suggests this might be caused by bad drivers, but I'd like a second opinion.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload