From 0de54a8102ad0d696ca78fe27adec098203f6c80 Mon Sep 17 00:00:00 2001 From: Rolf Jansen Date: Sun, 12 Nov 2017 00:27:49 -0200 Subject: [PATCH] =?UTF-8?q?issue=20#31=20=E2=80=93=20Implicit=20conversion?= =?UTF-8?q?s=20between=20built-in=20vector=20data=20types=20(here=20double?= =?UTF-8?q?=20to=20float)=20are=20disallowed=20in=20OpenCL=201.2,=20and=20?= =?UTF-8?q?LLVM=20does=20enforce=20this.=20Therefore=20explicitly=20coerce?= =?UTF-8?q?=20ACL=20constants=20to=20float.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/acl/DataTypes/aclConstant.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/acl/DataTypes/aclConstant.h b/src/acl/DataTypes/aclConstant.h index 09832c8..7602a90 100644 --- a/src/acl/DataTypes/aclConstant.h +++ b/src/acl/DataTypes/aclConstant.h @@ -57,7 +57,11 @@ namespace acl template std::string Constant::str(const KernelConfiguration & kernelConfig) const { - return valueStr; + #ifdef __llvm__ + return (typeid(T) == typeid(float) || typeid(T) == typeid(double)) ? "(float)"+valueStr : valueStr; + #else + return valueStr; + #endif }