[beignet] 08/09: More user-friendly 'type not supported' messages.

Rebecca Palmer rnpalmer-guest at moszumanska.debian.org
Sat Oct 28 07:34:14 UTC 2017


This is an automated email from the git hooks/post-receive script.

rnpalmer-guest pushed a commit to branch master
in repository beignet.

commit 599ada3a4d41e2747e67e5debc527183f8acd4f6
Author: Rebecca N. Palmer <rebecca_palmer at zoho.com>
Date:   Sat Oct 28 08:14:26 2017 +0100

    More user-friendly 'type not supported' messages.
---
 debian/changelog                         |   3 +-
 debian/patches/clearer-type-errors.patch | 118 +++++++++++++++++++++++++++++++
 debian/patches/series                    |   1 +
 3 files changed, 121 insertions(+), 1 deletion(-)

diff --git a/debian/changelog b/debian/changelog
index 2825eae..68373b2 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -8,8 +8,9 @@ beignet (1.3.2-1) unstable; urgency=medium
   * Fix grammar in documentation.
   * Bump Standards-Version to 4.1.1 (no changes -
     we can't yet be reproducible due to #877359).
+  * More user-friendly 'type not supported' messages.
 
- -- Rebecca N. Palmer <rebecca_palmer at zoho.com>  Fri, 27 Oct 2017 22:15:59 +0100
+ -- Rebecca N. Palmer <rebecca_palmer at zoho.com>  Sat, 28 Oct 2017 07:43:26 +0100
 
 beignet (1.3.1-1) unstable; urgency=medium
 
diff --git a/debian/patches/clearer-type-errors.patch b/debian/patches/clearer-type-errors.patch
new file mode 100644
index 0000000..09fc534
--- /dev/null
+++ b/debian/patches/clearer-type-errors.patch
@@ -0,0 +1,118 @@
+Description: More user-friendly "type not supported" errors
+
+(It would be even better if these returned build failure
+rather than asserting, but that's not as easy)
+     
+Author: Rebecca N. Palmer <rebecca_palmer at zoho.com>
+Forwarded: https://lists.freedesktop.org/archives/beignet/2017-September/009169.html
+
+--- a/backend/src/backend/gen_insn_selection.cpp
++++ b/backend/src/backend/gen_insn_selection.cpp
+@@ -5253,7 +5253,7 @@ extern bool OCL_DEBUGINFO; // first defi
+           write64Stateless(sel, address, src);
+         sel.pop();
+       } else {
+-        GBE_ASSERT(sel.hasLongType());
++        GBE_ASSERTM(sel.hasLongType(), "Long (int64) not supported on this device");
+         write64Stateless(sel, address, src);
+       }
+     }
+@@ -5838,7 +5838,7 @@ extern bool OCL_DEBUGINFO; // first defi
+ 
+         /* The special case, when dst is half, float->word->half will lose accuracy. */
+         if (dstType == TYPE_HALF) {
+-          GBE_ASSERT(sel.hasHalfType());
++          GBE_ASSERTM(sel.hasHalfType(), "Half precision not supported on this device");
+           type = GEN_TYPE_HF;
+         }
+ 
+@@ -5879,7 +5879,7 @@ extern bool OCL_DEBUGINFO; // first defi
+ 
+       if (dstType == TYPE_HALF) {
+         /* There is no MOV for Long <---> Half. So Long-->Float-->half. */
+-        GBE_ASSERT(sel.hasLongType());
++        GBE_ASSERTM(sel.hasLongType(), "Long (int64) not supported on this device");
+         GBE_ASSERT(sel.hasHalfType());
+         sel.push();
+         if (sel.isScalarReg(insn.getSrc(0))) {
+@@ -6181,7 +6181,7 @@ extern bool OCL_DEBUGINFO; // first defi
+         }
+       } else if (srcType == ir::TYPE_HALF) {
+         /* No need to consider old platform. if we support half, we must have native long. */
+-        GBE_ASSERT(sel.hasLongType());
++        GBE_ASSERTM(sel.hasLongType(), "Long (int64) not supported on this device");
+         GBE_ASSERT(sel.hasHalfType());
+         uint32_t type = dstType == TYPE_U64 ? GEN_TYPE_UD : GEN_TYPE_D;
+         GenRegister tmp = GenRegister::retype(sel.selReg(sel.reg(FAMILY_DWORD, sel.isScalarReg(insn.getSrc(0))), TYPE_U32), type);
+@@ -6205,7 +6205,7 @@ extern bool OCL_DEBUGINFO; // first defi
+           sel.MOV(dst, tmp);
+         }
+       } else if (src.type == GEN_TYPE_DF) {
+-        GBE_ASSERT(sel.hasDoubleType());
++        GBE_ASSERTM(sel.hasDoubleType(), "Double precision not supported on this device");
+         GBE_ASSERT(sel.hasLongType()); //So far, if we support double, we support native long.
+ 
+         // Just Mov
+@@ -6224,7 +6224,7 @@ extern bool OCL_DEBUGINFO; // first defi
+       const GenRegister dst = sel.selReg(insn.getDst(0), dstType);
+       const GenRegister src = sel.selReg(insn.getSrc(0), srcType);
+ 
+-      GBE_ASSERT(sel.hasDoubleType());
++      GBE_ASSERTM(sel.hasDoubleType(), "Double precision not supported on this device (if this is a literal, use '1.0f' not '1.0')");
+ 
+       if (sel.isScalarReg(insn.getDst(0))) {
+         // dst is scalar, just MOV and nothing more.
+@@ -6263,7 +6263,7 @@ extern bool OCL_DEBUGINFO; // first defi
+       const GenRegister dst = sel.selReg(insn.getDst(0), dstType);
+       const GenRegister src = sel.selReg(insn.getSrc(0), srcType);
+ 
+-      GBE_ASSERT(sel.hasDoubleType());
++      GBE_ASSERTM(sel.hasDoubleType(), "Double precision not supported on this device (if this is a literal, use '1.0f' not '1.0')");
+       GBE_ASSERT(sel.hasHalfType()); //So far, if we support double, we support half.
+ 
+       if (sel.isScalarReg(insn.getDst(0))) { // uniform case.
+@@ -6329,7 +6329,7 @@ extern bool OCL_DEBUGINFO; // first defi
+       // Special case, half -> char/short.
+       /* [DevBDW+]:	Format conversion to or from HF (Half Float) must be DWord-aligned and
+          strided by a DWord on the destination. */
+-      GBE_ASSERT(sel.hasHalfType());
++      GBE_ASSERTM(sel.hasHalfType(), "Half precision not supported on this device");
+       GenRegister tmp;
+       sel.push();
+       if (sel.isScalarReg(insn.getSrc(0))) {
+@@ -6361,7 +6361,7 @@ extern bool OCL_DEBUGINFO; // first defi
+       // Special case, char/uchar -> half
+       /* [DevBDW+]:  Format conversion to or from HF (Half Float) must be DWord-aligned and
+          strided by a DWord on the destination. */
+-      GBE_ASSERT(sel.hasHalfType());
++      GBE_ASSERTM(sel.hasHalfType(), "Half precision not supported on this device");
+       GenRegister tmp = GenRegister::retype(sel.unpacked_uw(sel.reg(FAMILY_DWORD, sel.isScalarReg(insn.getSrc(0)))), GEN_TYPE_HF);
+       sel.push();
+       if (sel.isScalarReg(insn.getSrc(0))) {
+@@ -6383,7 +6383,7 @@ extern bool OCL_DEBUGINFO; // first defi
+       const GenRegister src = sel.selReg(insn.getSrc(0), srcType);
+       const RegisterFamily dstFamily = getFamily(dstType);
+ 
+-      GBE_ASSERT(sel.hasDoubleType());
++      GBE_ASSERTM(sel.hasDoubleType(), "Double precision not supported on this device (if this is a literal, use '1.0f' not '1.0')");
+       GBE_ASSERT(sel.hasHalfType()); //So far, if we support double, we support half.
+       if (sel.isScalarReg(insn.getDst(0))) {
+         // dst is scalar, just MOV and nothing more.
+@@ -6427,7 +6427,7 @@ extern bool OCL_DEBUGINFO; // first defi
+       const GenRegister dst = sel.selReg(insn.getDst(0), dstType);
+       const GenRegister src = sel.selReg(insn.getSrc(0), srcType);
+ 
+-      GBE_ASSERT(sel.hasDoubleType());
++      GBE_ASSERTM(sel.hasDoubleType(), "Double precision not supported on this device");
+       GBE_ASSERT(sel.hasLongType()); //So far, if we support double, we support native long.
+       // Just Mov
+       sel.MOV(dst, src);
+@@ -6442,7 +6442,7 @@ extern bool OCL_DEBUGINFO; // first defi
+       const GenRegister src = sel.selReg(insn.getSrc(0), srcType);
+       const RegisterFamily srcFamily = getFamily(srcType);
+ 
+-      GBE_ASSERT(sel.hasDoubleType());
++      GBE_ASSERTM(sel.hasDoubleType(), "Double precision not supported on this device");
+       GBE_ASSERT(sel.hasLongType()); //So far, if we support double, we support native long.
+ 
+       if (sel.hasLongType() && sel.hasLongRegRestrict()) {
diff --git a/debian/patches/series b/debian/patches/series
index 5bf0f9d..6c08657 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -9,3 +9,4 @@ cl_accelerator_intel.patch
 add-appstream-metadata.patch
 static-llvm.patch
 grammar.patch
+clearer-type-errors.patch

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-opencl/beignet.git



More information about the Pkg-opencl-commits mailing list