[Beignet] [PATCH 3/5] fix error in clang: variable array length is not support for non-POD element
Lu Guanqun
guanqun.lu at intel.com
Mon Apr 15 23:38:54 PDT 2013
Signed-off-by: Lu Guanqun <guanqun.lu at intel.com>
---
backend/src/backend/gen_insn_selection.cpp | 9 +++++----
1 files changed, 5 insertions(+), 4 deletions(-)
diff --git a/backend/src/backend/gen_insn_selection.cpp b/backend/src/backend/gen_insn_selection.cpp
index ecaaeeb..e0e8920 100644
--- a/backend/src/backend/gen_insn_selection.cpp
+++ b/backend/src/backend/gen_insn_selection.cpp
@@ -1621,10 +1621,10 @@ namespace gbe
{
using namespace ir;
const uint32_t valueNum = insn.getValueNum();
- GenRegister dst[valueNum];
+ vector<GenRegister> dst(valueNum);
for (uint32_t dstID = 0; dstID < valueNum; ++dstID)
dst[dstID] = GenRegister::retype(sel.selReg(insn.getValue(dstID)), GEN_TYPE_F);
- sel.UNTYPED_READ(addr, dst, valueNum, bti);
+ sel.UNTYPED_READ(addr, dst.data(), valueNum, bti);
}
void emitByteGather(Selection::Opaque &sel,
@@ -1683,12 +1683,13 @@ namespace gbe
using namespace ir;
const uint32_t valueNum = insn.getValueNum();
const uint32_t addrID = ir::StoreInstruction::addressIndex;
- GenRegister addr, value[valueNum];
+ GenRegister addr;
+ vector<GenRegister> value(valueNum);
addr = GenRegister::retype(sel.selReg(insn.getSrc(addrID)), GEN_TYPE_F);;
for (uint32_t valueID = 0; valueID < valueNum; ++valueID)
value[valueID] = GenRegister::retype(sel.selReg(insn.getValue(valueID)), GEN_TYPE_F);
- sel.UNTYPED_WRITE(addr, value, valueNum, bti);
+ sel.UNTYPED_WRITE(addr, value.data(), valueNum, bti);
}
void emitByteScatter(Selection::Opaque &sel,
More information about the Beignet
mailing list