IntelLabs / RiverTrail

An API for data parallelism in JavaScript
Other
748 stars 71 forks source link

idf-demo raises "unused variable" OpenCL compiler warning on Mac #49

Closed lkuper closed 9 years ago

lkuper commented 9 years ago

idf-demo raises this error for me on Mac (on Linux I can't run it at all because of unrelated WebGL issues):

uncaught exception: The OpenCL compiler failed. Log was `<program source>:1:174: warning: unused variable '_sel_idx_tmp'
__kernel void RT_buildOneElement(__global int *_FAILRET, __global unsigned /* clamped */ char* RTl_aPA, int RTl_aPA__offset,__global float* retVal, int retVal__offset) {int _sel_idx_tmp; int _FAIL = 0;int _id_0 = (int)get_global_id(0);int _id_1 = (int)get_global_id(1);int _id_2 = (int)get_global_id(2);int _writeoffset = 0+1 * _id_2+4 * _id_1+1152 * _id_0;_writeoffset += retVal__offset;float  tempResult; __private int RTl_idx[3] =  { (int) _id_0, (int) _id_1, (int) _id_2};RTl_aPA = &RTl_aPA[RTl_aPA__offset];;{ tempResult = ((float)  ( RTl_aPA[0  + 1 * (RTl_idx[ 2]) + 4 * (RTl_idx[ 0]) + 1600 * (RTl_idx[ 1])]));retVal[_writeoffset] =  tempResult;if (_FAIL) {*_FAILRET = _FAIL;} return; ;}}
                                                                                                                                                                             ^
'.

Are we treating warnings as errors?

(For what it's worth, this is not the error I was getting yesterday, which was one of the OpenCL functions returning a non-zero error code. I think that it was clGetProgramBuildInfo and the error was -30, aka CL_INVALID_VALUE. But, as of today, I'm no longer able to reproduce that.)

lkuper commented 9 years ago

OK, this is a very strange issue. I can only duplicate it by interrupting a run of liquid-resize and then running idf-demo (I happen to be running them in the same browser tab, although I don't know if it matters). buildOneElement is a liquid-resize function name. So I guess that this warning was always happening with liquid-resize and the buildlog isn't getting cleared before idf-demo runs.

lkuper commented 9 years ago

With the build log thing cleared up, now we just have the original issue to deal with, which is that clGetProgramBuildInfo (in compileKernel) is returning -30. Working on this...

lkuper commented 9 years ago

OK, this seems to be working again as of a74d1b3. The issue may have been that the build log size was too small (it was 16K bytes, and one of the build logs was 20259 bytes). So we're now doing an OpenCL call to look up the size of the build log before reading it into an appropriately sized buffer.