[libclc] 42/58: Make min follow the OCL 1.0 specs
Andreas Boll
aboll-guest at moszumanska.debian.org
Thu Oct 6 08:16:33 UTC 2016
This is an automated email from the git hooks/post-receive script.
aboll-guest pushed a commit to branch master
in repository libclc.
commit 693817b954658d02ccaea50a9e5afc1f4504d5d0
Author: Jan Vesely <jan.vesely at rutgers.edu>
Date: Mon Jul 25 22:36:22 2016 +0000
Make min follow the OCL 1.0 specs
OpenCL 1.0: "Returns y if y < x, otherwise it returns x. If x *and* y
are infinite or NaN, the return values are undefined."
OpenCL 1.1+: "Returns y if y < x, otherwise it returns x. If x *or* y
are infinite or NaN, the return values are undefined."
The 1.0 version is stricter so use that one.
Signed-off-by: Jan Vesely <jan.vesely at rutgers.edu>
git-svn-id: https://llvm.org/svn/llvm-project/libclc/trunk@276704 91177308-0d34-0410-b5e6-96231b3b80d8
---
generic/lib/shared/min.inc | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/generic/lib/shared/min.inc b/generic/lib/shared/min.inc
index fe42864..e15e055 100644
--- a/generic/lib/shared/min.inc
+++ b/generic/lib/shared/min.inc
@@ -1,9 +1,9 @@
_CLC_OVERLOAD _CLC_DEF __CLC_GENTYPE min(__CLC_GENTYPE a, __CLC_GENTYPE b) {
- return (a < b ? a : b);
+ return (b < a ? b : a);
}
#ifndef __CLC_SCALAR
_CLC_OVERLOAD _CLC_DEF __CLC_GENTYPE min(__CLC_GENTYPE a, __CLC_SCALAR_GENTYPE b) {
- return (a < (__CLC_GENTYPE)b ? a : (__CLC_GENTYPE)b);
+ return (b < (__CLC_GENTYPE)a ? (__CLC_GENTYPE)b : a);
}
#endif
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-opencl/libclc.git
More information about the Pkg-opencl-commits
mailing list