https://github.com/frasercrmck closed
https://github.com/llvm/llvm-project/pull/115699
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -0,0 +1,21 @@
+// TYPE sign(TYPE x) {
+// if (isnan(x)) {
+// return 0.0F;
+// }
+// if (x > 0.0F) {
+// return 1.0F;
+// }
+// if (x < 0.0F) {
+// return -1.0F;
+// }
+// return x; /* -0.0 or +0.0 */
+// }
+_CLC_DEF _CLC_OVERLOAD __CLC_GENTYPE __clc_s
https://github.com/frasercrmck updated
https://github.com/llvm/llvm-project/pull/115699
>From 44adfb0225e0f96462bdf79371e9d16a37595c0c Mon Sep 17 00:00:00 2001
From: Fraser Cormack
Date: Thu, 7 Nov 2024 12:40:56 +
Subject: [PATCH] [libclc] Move sign to the CLC builtins library
This patch n
@@ -0,0 +1,21 @@
+// TYPE sign(TYPE x) {
+// if (isnan(x)) {
+// return 0.0F;
+// }
+// if (x > 0.0F) {
+// return 1.0F;
+// }
+// if (x < 0.0F) {
+// return -1.0F;
+// }
+// return x; /* -0.0 or +0.0 */
+// }
+_CLC_DEF _CLC_OVERLOAD __CLC_GENTYPE __clc_s
@@ -0,0 +1,21 @@
+// TYPE sign(TYPE x) {
+// if (isnan(x)) {
+// return 0.0F;
+// }
+// if (x > 0.0F) {
+// return 1.0F;
+// }
+// if (x < 0.0F) {
+// return -1.0F;
+// }
+// return x; /* -0.0 or +0.0 */
+// }
+_CLC_DEF _CLC_OVERLOAD __CLC_GENTYPE __clc_s
@@ -0,0 +1,21 @@
+// TYPE sign(TYPE x) {
+// if (isnan(x)) {
+// return 0.0F;
+// }
+// if (x > 0.0F) {
+// return 1.0F;
+// }
+// if (x < 0.0F) {
+// return -1.0F;
+// }
+// return x; /* -0.0 or +0.0 */
+// }
+_CLC_DEF _CLC_OVERLOAD __CLC_GENTYPE __clc_s
@@ -0,0 +1,21 @@
+// TYPE sign(TYPE x) {
+// if (isnan(x)) {
+// return 0.0F;
+// }
+// if (x > 0.0F) {
+// return 1.0F;
+// }
+// if (x < 0.0F) {
+// return -1.0F;
+// }
+// return x; /* -0.0 or +0.0 */
+// }
+_CLC_DEF _CLC_OVERLOAD __CLC_GENTYPE __clc_s
frasercrmck wrote:
ping, thanks
https://github.com/llvm/llvm-project/pull/115699
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/frasercrmck edited
https://github.com/llvm/llvm-project/pull/115699
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/frasercrmck updated
https://github.com/llvm/llvm-project/pull/115699
>From 8144673e0338acefe13fac0c20bbaba0412b8239 Mon Sep 17 00:00:00 2001
From: Fraser Cormack
Date: Thu, 7 Nov 2024 12:40:56 +
Subject: [PATCH 1/4] [libclc] Move sign to the CLC builtins library
This pat
frasercrmck wrote:
I'll look into undoing the CMake changes and building the dependent CLC
functions for SPIR-V targets later on.
https://github.com/llvm/llvm-project/pull/115699
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.ll
https://github.com/frasercrmck updated
https://github.com/llvm/llvm-project/pull/115699
>From 9c5f79e720d0701d17f9d128b358320401baf666 Mon Sep 17 00:00:00 2001
From: Fraser Cormack
Date: Thu, 7 Nov 2024 12:40:56 +
Subject: [PATCH 1/3] [libclc] Move sign to the CLC builtins library
This pat
frasercrmck wrote:
@arsenm I've just updated this PR. It still moves the `sign` implementation to
the CLC library but now also optimizes it for vector types. There's no control
flow nor scalarizing for vectors. I trust this will be a good enough default
for the scalar form (on GPUs) though I s
https://github.com/frasercrmck updated
https://github.com/llvm/llvm-project/pull/115699
>From 9c5f79e720d0701d17f9d128b358320401baf666 Mon Sep 17 00:00:00 2001
From: Fraser Cormack
Date: Thu, 7 Nov 2024 12:40:56 +
Subject: [PATCH 1/2] [libclc] Move sign to the CLC builtins library
This pat
@@ -0,0 +1,38 @@
+#include
+#include
+#include
+
+#define CLC_SIGN(TYPE, F)
\
+ _CLC_DEF _CLC_OVERLOAD TYPE __clc_sign(TYPE x) {
\
+if (__clc_isnan(x)) {
@@ -322,22 +322,26 @@ foreach( t ${LIBCLC_TARGETS_TO_BUILD} )
if ( ARCH STREQUAL spirv OR ARCH STREQUAL spirv64 )
set( build_flags -O0 -finline-hint-functions -DCLC_SPIRV )
- set( opt_flags )
+ set( clc_opt_flags )
+ # Inline CLC functions into OpenCL
@@ -322,22 +322,26 @@ foreach( t ${LIBCLC_TARGETS_TO_BUILD} )
if ( ARCH STREQUAL spirv OR ARCH STREQUAL spirv64 )
set( build_flags -O0 -finline-hint-functions -DCLC_SPIRV )
- set( opt_flags )
+ set( clc_opt_flags )
+ # Inline CLC functions into OpenCL
@@ -322,22 +322,26 @@ foreach( t ${LIBCLC_TARGETS_TO_BUILD} )
if ( ARCH STREQUAL spirv OR ARCH STREQUAL spirv64 )
set( build_flags -O0 -finline-hint-functions -DCLC_SPIRV )
- set( opt_flags )
+ set( clc_opt_flags )
+ # Inline CLC functions into OpenCL
https://github.com/arsenm edited
https://github.com/llvm/llvm-project/pull/115699
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -0,0 +1,38 @@
+#include
+#include
+#include
+
+#define CLC_SIGN(TYPE, F)
\
+ _CLC_DEF _CLC_OVERLOAD TYPE __clc_sign(TYPE x) {
\
+if (__clc_isnan(x)) {
https://github.com/arsenm edited
https://github.com/llvm/llvm-project/pull/115699
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -322,22 +322,26 @@ foreach( t ${LIBCLC_TARGETS_TO_BUILD} )
if ( ARCH STREQUAL spirv OR ARCH STREQUAL spirv64 )
set( build_flags -O0 -finline-hint-functions -DCLC_SPIRV )
- set( opt_flags )
+ set( clc_opt_flags )
+ # Inline CLC functions into OpenCL
fooishbar wrote:
cc @karolherbst @airlied who are better contacts for CL in Mesa these days
https://github.com/llvm/llvm-project/pull/115699
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-com
@@ -322,22 +322,26 @@ foreach( t ${LIBCLC_TARGETS_TO_BUILD} )
if ( ARCH STREQUAL spirv OR ARCH STREQUAL spirv64 )
set( build_flags -O0 -finline-hint-functions -DCLC_SPIRV )
- set( opt_flags )
+ set( clc_opt_flags )
+ # Inline CLC functions into OpenCL
https://github.com/frasercrmck updated
https://github.com/llvm/llvm-project/pull/115699
>From 0a9bcdc5fb9da8ada6d2580026f498f282ca7cf7 Mon Sep 17 00:00:00 2001
From: Fraser Cormack
Date: Thu, 7 Nov 2024 12:40:56 +
Subject: [PATCH] [libclc] Move sign to the CLC builtins library
This patch n
@@ -322,22 +322,26 @@ foreach( t ${LIBCLC_TARGETS_TO_BUILD} )
if ( ARCH STREQUAL spirv OR ARCH STREQUAL spirv64 )
set( build_flags -O0 -finline-hint-functions -DCLC_SPIRV )
- set( opt_flags )
+ set( clc_opt_flags )
+ # Inline CLC functions into OpenCL
https://github.com/frasercrmck edited
https://github.com/llvm/llvm-project/pull/115699
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -322,22 +322,26 @@ foreach( t ${LIBCLC_TARGETS_TO_BUILD} )
if ( ARCH STREQUAL spirv OR ARCH STREQUAL spirv64 )
set( build_flags -O0 -finline-hint-functions -DCLC_SPIRV )
- set( opt_flags )
+ set( clc_opt_flags )
+ # Inline CLC functions into OpenCL
@@ -322,22 +322,26 @@ foreach( t ${LIBCLC_TARGETS_TO_BUILD} )
if ( ARCH STREQUAL spirv OR ARCH STREQUAL spirv64 )
set( build_flags -O0 -finline-hint-functions -DCLC_SPIRV )
- set( opt_flags )
+ set( clc_opt_flags )
+ # Inline CLC functions into OpenCL
@@ -322,22 +322,26 @@ foreach( t ${LIBCLC_TARGETS_TO_BUILD} )
if ( ARCH STREQUAL spirv OR ARCH STREQUAL spirv64 )
set( build_flags -O0 -finline-hint-functions -DCLC_SPIRV )
- set( opt_flags )
+ set( clc_opt_flags )
+ # Inline CLC functions into OpenCL
https://github.com/karolherbst edited
https://github.com/llvm/llvm-project/pull/115699
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/karolherbst edited
https://github.com/llvm/llvm-project/pull/115699
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/karolherbst edited
https://github.com/llvm/llvm-project/pull/115699
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -322,22 +322,26 @@ foreach( t ${LIBCLC_TARGETS_TO_BUILD} )
if ( ARCH STREQUAL spirv OR ARCH STREQUAL spirv64 )
set( build_flags -O0 -finline-hint-functions -DCLC_SPIRV )
- set( opt_flags )
+ set( clc_opt_flags )
+ # Inline CLC functions into OpenCL
https://github.com/fooishbar edited
https://github.com/llvm/llvm-project/pull/115699
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -0,0 +1,38 @@
+#include
+#include
+#include
+
+#define CLC_SIGN(TYPE, F)
\
+ _CLC_DEF _CLC_OVERLOAD TYPE __clc_sign(TYPE x) {
\
+if (__clc_isnan(x)) {
@@ -322,22 +322,26 @@ foreach( t ${LIBCLC_TARGETS_TO_BUILD} )
if ( ARCH STREQUAL spirv OR ARCH STREQUAL spirv64 )
set( build_flags -O0 -finline-hint-functions -DCLC_SPIRV )
- set( opt_flags )
+ set( clc_opt_flags )
+ # Inline CLC functions into OpenCL
https://github.com/frasercrmck updated
https://github.com/llvm/llvm-project/pull/115699
>From 47512ee4162318160964f1af132be90bed67c90c Mon Sep 17 00:00:00 2001
From: Fraser Cormack
Date: Thu, 7 Nov 2024 12:40:56 +
Subject: [PATCH 1/2] [libclc] Move sign to the CLC builtins library
This pat
@@ -0,0 +1,38 @@
+#include
+#include
+#include
+
+#define CLC_SIGN(TYPE, F)
\
+ _CLC_DEF _CLC_OVERLOAD TYPE __clc_sign(TYPE x) {
\
+if (__clc_isnan(x)) {
@@ -322,22 +322,26 @@ foreach( t ${LIBCLC_TARGETS_TO_BUILD} )
if ( ARCH STREQUAL spirv OR ARCH STREQUAL spirv64 )
set( build_flags -O0 -finline-hint-functions -DCLC_SPIRV )
- set( opt_flags )
+ set( clc_opt_flags )
+ # Inline CLC functions into OpenCL
https://github.com/arsenm edited
https://github.com/llvm/llvm-project/pull/115699
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -0,0 +1,38 @@
+#include
+#include
+#include
+
+#define CLC_SIGN(TYPE, F)
\
+ _CLC_DEF _CLC_OVERLOAD TYPE __clc_sign(TYPE x) {
\
+if (__clc_isnan(x)) {
@@ -322,22 +322,26 @@ foreach( t ${LIBCLC_TARGETS_TO_BUILD} )
if ( ARCH STREQUAL spirv OR ARCH STREQUAL spirv64 )
set( build_flags -O0 -finline-hint-functions -DCLC_SPIRV )
- set( opt_flags )
+ set( clc_opt_flags )
+ # Inline CLC functions into OpenCL
frasercrmck wrote:
> > So is the sign function currently implemented in the OpenCL headers?
>
> The sign function for SPIR-V/Mesa is currently implemented by libclc
> [here](https://github.com/llvm/llvm-project/blob/main/libclc/generic/lib/common/sign.cl).
> With this change, `sign` now calls
https://github.com/frasercrmck edited
https://github.com/llvm/llvm-project/pull/115699
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
frasercrmck wrote:
> So is the sign function currently implemented in the OpenCL headers?
The sign function for SPIR-V/Mesa is currently implemented by libclc
[here](https://github.com/llvm/llvm-project/blob/main/libclc/generic/lib/common/sign.cl).
With this change, `sign` now calls `__clc_sig
https://github.com/tstellar commented:
So is the sign function currently implemented in the OpenCL headers?
https://github.com/llvm/llvm-project/pull/115699
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/
frasercrmck wrote:
CC @tstellar @fooishbar who might be able to account for the Mesa/SPIR-V target?
https://github.com/llvm/llvm-project/pull/115699
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo
https://github.com/frasercrmck created
https://github.com/llvm/llvm-project/pull/115699
This patch necessitates some changes to how CLSPV and SPIR-V targets are built.
This is the first patch in this series in which an OpenCL function declaration
has been called from the CLC library for these
49 matches
Mail list logo