OpenCL编译器错误(动态分配)

时间:2015-01-26 06:49:58

标签: c opencl

我在编译OpenCL内核时遇到问题,无法解释为什么会这样。

我收到以下错误:

Cannot select: 0x7ff1a9871610: i64,ch = dynamic_stackalloc 0x7ff1ab114cb0, 0x7ff1a9870f10, 0x7ff1a9870710 [ORD=12] [ID=21]
  0x7ff1a9870f10: i64 = bitcast 0x7ff1a9871710 [ID=19]
    0x7ff1a9871710: v2i32 = IGILISD::MOVSWZ 0x7ff1a9870d10, 0x7ff1a986eb10, 0x7ff1a986eb10, 0x7ff1a986eb10 [ID=15]
      0x7ff1a9870d10: i32 = Constant<8> [ID=12]
      0x7ff1a986eb10: i32 = Constant<0> [ID=9]
      0x7ff1a986eb10: i32 = Constant<0> [ID=9]
      0x7ff1a986eb10: i32 = Constant<0> [ID=9]
  0x7ff1a9870710: i64 = bitcast 0x7ff1a9871110 [ID=18]
    0x7ff1a9871110: v2i32 = IGILISD::MOVSWZ 0x7ff1a986eb10, 0x7ff1a986eb10, 0x7ff1a986eb10, 0x7ff1a986eb10 [ID=14]
      0x7ff1a986eb10: i32 = Constant<0> [ID=9]
      0x7ff1a986eb10: i32 = Constant<0> [ID=9]
      0x7ff1a986eb10: i32 = Constant<0> [ID=9]
      0x7ff1a986eb10: i32 = Constant<0> [ID=9]
In function: mmul
ERROR: Build Program (-11)

我知道是由以下两行之一引起的(如果我删除它们,内核编译文件)

uchar valc = valuec[j] ^ ((block_b[(k+i) + block_size * ty] >> (8*j)) & 0xff) ;

 value = value | ((int) valuec[j] << (8*j)) ;

其中定义了valuec:

  __private uchar valuec[bytes];

和block_b是内核的参数

..,__local int* restrict block_b)

有什么想法吗?它与数组valuec [j]和移位运算符的组合有关。 我可以用行

编译内核
valuec[j] = 0

或使用

   uchar hello = 0;
   uchar valc = hello ^ ((block_b[(k+i) + block_size * ty] >> (8*j)) & 0xff) ;

但不包含

   uchar hello = valuec[j];
   uchar valc = hello ^ ((block_b[(k+i) + block_size * ty] >> (8*j)) & 0xff) ;

或与行(其中valuec [j]绝对等于0)

    for (int i = 0 ; i < bytes ; i++) [
        valuec[i]=0;
     }
    uchar hello = valuec[j];
    uchar valc = hello ^ ((block_b[(k+i) + block_size * ty] >> (8*j)) & 0xff) ;

0 个答案:

没有答案