diff --git a/contrib/fortran-to-opencl/translate.py b/contrib/fortran-to-opencl/translate.py index a9dd33fdb56fa3d2de2b1b2c355693cb1b98275e..c1c72c6927de8d4189202797abc431d06072f358 100644 --- a/contrib/fortran-to-opencl/translate.py +++ b/contrib/fortran-to-opencl/translate.py @@ -127,7 +127,16 @@ class FortranExpressionParser(ExpressionParserBase): else: dtype = np.float32 - return TypedLiteral(value.replace("d", "e"), dtype) + value = value.replace("d", "e") + if value.startswith("."): + prev_value = value + value = "0"+value + print value, prev_value + elif value.startswith("-."): + prev_value = value + value = "-0"+value[1:] + print value, prev_value + return TypedLiteral(value, dtype) elif next_tag is _identifier: name = pstate.next_str_and_advance() @@ -1121,9 +1130,6 @@ class F2CLTranslator(FTreeWalkerBase): from pymbolic import var rhs = var("fromreal")(rhs) - if lhs_name == "cd": - print lhs_dtype, rhs_dtype, rhs - return cgen.Assign(self.gen_expr(lhs), self.gen_expr(rhs)) def map_Allocate(self, node):