From af435b7f8309dd7b4a7eac0004dd40326debce9e Mon Sep 17 00:00:00 2001 From: Martin Bauer <martin.bauer@fau.de> Date: Thu, 2 Nov 2017 13:28:35 +0100 Subject: [PATCH] Bugfixes in CUDA indexed kernels - alignment of index array when using additional data - data types have been hashed incorrectly --- data_types.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/data_types.py b/data_types.py index 6ac97023a..7b084f684 100644 --- a/data_types.py +++ b/data_types.py @@ -59,7 +59,7 @@ class TypedSymbol(sp.Symbol): def _hashable_content(self): superClassContents = list(super(TypedSymbol, self)._hashable_content()) - return tuple(superClassContents + [hash(str(self._dtype))]) + return tuple(superClassContents + [hash(self._dtype)]) def __getnewargs__(self): return self.name, self.dtype @@ -232,6 +232,7 @@ if ir: np.dtype(np.float64): ir.DoubleType(), } + def peelOffType(dtype, typeToPeelOff): while type(dtype) is typeToPeelOff: dtype = dtype.baseType @@ -465,7 +466,7 @@ class VectorType(Type): raise NotImplementedError() def __hash__(self): - return hash(str(self)) + return hash((self.baseType, self.width)) class PointerType(Type): @@ -502,7 +503,7 @@ class PointerType(Type): return str(self) def __hash__(self): - return hash(str(self)) + return hash((self._baseType, self.const, self.restrict)) class StructType(object): -- GitLab