[Beignet] [PATCH 1/2] GEB/Runtime: eliminate release build warnings.

Yang Rong rong.r.yang at intel.com
Wed Dec 7 09:16:25 UTC 2016


Signed-off-by: Yang Rong <rong.r.yang at intel.com>
---
 backend/src/backend/gen_context.cpp      | 2 ++
 backend/src/backend/program.cpp          | 1 +
 backend/src/ir/lowering.cpp              | 1 +
 backend/src/llvm/ExpandLargeIntegers.cpp | 1 +
 backend/src/llvm/llvm_gen_backend.cpp    | 3 ++-
 src/cl_api.c                             | 2 ++
 src/cl_extensions.c                      | 1 +
 src/cl_kernel.c                          | 2 +-
 8 files changed, 11 insertions(+), 2 deletions(-)

diff --git a/backend/src/backend/gen_context.cpp b/backend/src/backend/gen_context.cpp
index 798fac8..f4f9998 100644
--- a/backend/src/backend/gen_context.cpp
+++ b/backend/src/backend/gen_context.cpp
@@ -2649,6 +2649,7 @@ namespace gbe
     uint32_t tsType = insn.extra.timestampType;
     GenRegister flagReg = GenRegister::flag(insn.state.flag, insn.state.subFlag);
 
+    (void) tsType;
     GBE_ASSERT(tsType == 1);
     GenRegister tmArf = GenRegister::tm0();
     GenRegister profilingReg[5];
@@ -2774,6 +2775,7 @@ namespace gbe
     GenRegister tmp = ra->genReg(insn.dst(0));
     uint32_t profilingType = insn.extra.profilingType;
     uint32_t bti = insn.extra.profilingBTI;
+    (void) profilingType;
     GBE_ASSERT(profilingType == 1);
     GenRegister flagReg = GenRegister::flag(insn.state.flag, insn.state.subFlag);
     GenRegister lastTsReg = GenRegister::toUniform(profilingReg[3], GEN_TYPE_UL);
diff --git a/backend/src/backend/program.cpp b/backend/src/backend/program.cpp
index c68d604..7c9267d 100644
--- a/backend/src/backend/program.cpp
+++ b/backend/src/backend/program.cpp
@@ -871,6 +871,7 @@ namespace gbe {
         break;
       }
     }
+    (void) findOcl;
     assert(findOcl);
     if (OCL_OUTPUT_KERNEL_SOURCE) {
       if(options) {
diff --git a/backend/src/ir/lowering.cpp b/backend/src/ir/lowering.cpp
index 07d0ee4..93bd96a 100644
--- a/backend/src/ir/lowering.cpp
+++ b/backend/src/ir/lowering.cpp
@@ -313,6 +313,7 @@ namespace ir {
         Instruction *insn = const_cast<Instruction*>(use->getInstruction());
         const Opcode opcode = insn->getOpcode();
         const uint32_t dstNum = insn->getDstNum();
+        (void) dstNum;
         GBE_ASSERT(dstNum == 1 || opcode == OP_LOAD);
         const Register dst = insn->getDst();
         auto it = addPtrInsns.find(derivedRegs[i]);
diff --git a/backend/src/llvm/ExpandLargeIntegers.cpp b/backend/src/llvm/ExpandLargeIntegers.cpp
index 55a8637..60740f5 100644
--- a/backend/src/llvm/ExpandLargeIntegers.cpp
+++ b/backend/src/llvm/ExpandLargeIntegers.cpp
@@ -438,6 +438,7 @@ static void convertInstruction(Instruction *Inst, ConversionState &State,
       State.recordConverted(Trunc, NewInst);
     } else {
       TypePair Tys = getExpandedIntTypes(Trunc->getType());
+      (void) OpTys;
       assert(Tys.Lo == OpTys.Lo);
       Value *Lo = Ops.Lo;
       Value *Hi = IRB.CreateTrunc(Ops.Hi, Tys.Hi, Twine(Name, ".hi"));
diff --git a/backend/src/llvm/llvm_gen_backend.cpp b/backend/src/llvm/llvm_gen_backend.cpp
index d6b0665..cd95c15 100644
--- a/backend/src/llvm/llvm_gen_backend.cpp
+++ b/backend/src/llvm/llvm_gen_backend.cpp
@@ -4160,7 +4160,6 @@ namespace gbe
 
   void GenWriter::emitAtomicRMWInst(AtomicRMWInst &I) {
     // Get the function arguments
-    llvm::AtomicOrdering Order = I.getOrdering();
     llvm::AtomicRMWInst::BinOp llvmOpcode = I.getOperation();
     Value *llvmPtr = I.getOperand(0);
     ir::AtomicOps opcode = atomicOpsLLVMToGen(llvmOpcode);
@@ -4897,6 +4896,7 @@ namespace gbe
             bool isFloatCoord = coordType == ir::TYPE_FLOAT;
             bool requiredFloatCoord = samplerOffset == 0;
 
+            (void) isFloatCoord;
             GBE_ASSERT(isFloatCoord == requiredFloatCoord);
 
             vector<ir::Register> dstTupleData, srcTupleData;
@@ -5272,6 +5272,7 @@ namespace gbe
             Value *bti = getBtiRegister(llvmPtr);
             GBE_ASSERT(isa<ConstantInt>(bti)); //Should never be mixed pointer.
             uint32_t index = cast<ConstantInt>(bti)->getZExtValue();
+            (void) index;
             GBE_ASSERT(btiToGen(index) == ir::MEM_GLOBAL);
             ++AI;
             GBE_ASSERT(AI != AE);
diff --git a/src/cl_api.c b/src/cl_api.c
index c4c8e6a..e1bbf73 100644
--- a/src/cl_api.c
+++ b/src/cl_api.c
@@ -573,6 +573,7 @@ clSVMAlloc (cl_context context,
 {
   cl_int err = CL_SUCCESS;
   CHECK_CONTEXT (context);
+  (void) err;
   return cl_mem_svm_allocate(context, flags, size, alignment);
 error:
   return NULL;
@@ -583,6 +584,7 @@ clSVMFree (cl_context context, void* svm_pointer)
 {
   cl_int err = CL_SUCCESS;
   CHECK_CONTEXT (context);
+  (void) err;
   return cl_mem_svm_delete(context, svm_pointer);
 error:
   return;
diff --git a/src/cl_extensions.c b/src/cl_extensions.c
index 14bdef4..a3c71ca 100644
--- a/src/cl_extensions.c
+++ b/src/cl_extensions.c
@@ -152,6 +152,7 @@ cl_intel_platform_extension_init(cl_platform_id intel_platform)
   static int ext_initialized = 0;
 
   /* The EXT should be only inited once. */
+  (void) ext_initialized;
   assert(!ext_initialized);
   check_basic_extension(&intel_platform_extensions);
   check_opt1_extension(&intel_platform_extensions);
diff --git a/src/cl_kernel.c b/src/cl_kernel.c
index 49bbaf0..6855387 100644
--- a/src/cl_kernel.c
+++ b/src/cl_kernel.c
@@ -295,7 +295,7 @@ cl_kernel_set_arg_svm_pointer(cl_kernel k, cl_uint index, const void *value)
   if (k->args[index].mem)
     cl_mem_delete(k->args[index].mem);
 
-  k->args[index].ptr = value;
+  k->args[index].ptr = (void *)value;
   k->args[index].mem = mem;
   k->args[index].is_set = 1;
   k->args[index].is_svm = 1;
-- 
2.1.4



More information about the Beignet mailing list