diff options
| author | Tom Stellard <thomas.stellard@amd.com> | 2015-03-02 15:29:39 +0000 |
|---|---|---|
| committer | Tom Stellard <thomas.stellard@amd.com> | 2015-03-02 15:29:39 +0000 |
| commit | 1f28b14bba45cda0a00071eae464f31bd4a6fd38 (patch) | |
| tree | cfc52fb46330512d6af0bf95266cf684d4326c33 /libclc/generic/include/clc | |
| parent | f5e5b0171d8f6ed70dc97394565a91ed284efc80 (diff) | |
| download | bcm5719-llvm-1f28b14bba45cda0a00071eae464f31bd4a6fd38.tar.gz bcm5719-llvm-1f28b14bba45cda0a00071eae464f31bd4a6fd38.zip | |
Implement smoothstep builtin v2
This has been tested with piglit, OpenCV, and the ocl conformance tests.
v2:
- Fix typo in smoothstep.h
llvm-svn: 230969
Diffstat (limited to 'libclc/generic/include/clc')
| -rw-r--r-- | libclc/generic/include/clc/clc.h | 1 | ||||
| -rw-r--r-- | libclc/generic/include/clc/common/smoothstep.h | 25 | ||||
| -rw-r--r-- | libclc/generic/include/clc/common/smoothstep.inc | 28 |
3 files changed, 54 insertions, 0 deletions
diff --git a/libclc/generic/include/clc/clc.h b/libclc/generic/include/clc/clc.h index 2848e591ba3..4a2d29e7b30 100644 --- a/libclc/generic/include/clc/clc.h +++ b/libclc/generic/include/clc/clc.h @@ -111,6 +111,7 @@ #include <clc/common/degrees.h> #include <clc/common/radians.h> #include <clc/common/sign.h> +#include <clc/common/smoothstep.h> /* 6.11.5 Geometric Functions */ #include <clc/geometric/cross.h> diff --git a/libclc/generic/include/clc/common/smoothstep.h b/libclc/generic/include/clc/common/smoothstep.h new file mode 100644 index 00000000000..7a270dce89b --- /dev/null +++ b/libclc/generic/include/clc/common/smoothstep.h @@ -0,0 +1,25 @@ +/* + * Copyright (c) 2014,2015 Advanced Micro Devices, Inc. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#define __CLC_BODY <clc/common/smoothstep.inc> +#include <clc/math/gentype.inc> +#undef __CLC_BODY diff --git a/libclc/generic/include/clc/common/smoothstep.inc b/libclc/generic/include/clc/common/smoothstep.inc new file mode 100644 index 00000000000..286eeac47d4 --- /dev/null +++ b/libclc/generic/include/clc/common/smoothstep.inc @@ -0,0 +1,28 @@ +/* + * Copyright (c) 2014,2015 Advanced Micro Devices, Inc. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +_CLC_OVERLOAD _CLC_DECL __CLC_GENTYPE smoothstep(__CLC_GENTYPE edge0, __CLC_GENTYPE edge1, __CLC_GENTYPE x); +_CLC_OVERLOAD _CLC_DECL __CLC_GENTYPE smoothstep(float edge0, float edge1, __CLC_GENTYPE x); + +#ifdef cl_khr_fp64 +_CLC_OVERLOAD _CLC_DECL __CLC_GENTYPE smoothstep(double edge0, double edge1, __CLC_GENTYPE x); +#endif |

