Skip to content

Commit

Permalink
issue AvtechScientific#31 – Implicit conversions between built-in vec…
Browse files Browse the repository at this point in the history
…tor data types (here double to float) are disallowed in OpenCL 1.2, and LLVM does enforce this. Therefore explicitly coerce ACL constants to float.
  • Loading branch information
cyclaero committed Nov 12, 2017
1 parent a38f1d4 commit 0de54a8
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/acl/DataTypes/aclConstant.h
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,11 @@ namespace acl

template <typename T> std::string Constant<T>::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
}


Expand Down

0 comments on commit 0de54a8

Please sign in to comment.