Skip to content

[libclc] Delete wrong implementation nvptx clc_isinf#205699

Merged
wenju-he merged 1 commit into
llvm:mainfrom
wenju-he:libclc-delete-nvptx-clc_isinf.cl
Jun 25, 2026
Merged

[libclc] Delete wrong implementation nvptx clc_isinf#205699
wenju-he merged 1 commit into
llvm:mainfrom
wenju-he:libclc-delete-nvptx-clc_isinf.cl

Conversation

@wenju-he

Copy link
Copy Markdown
Contributor

The file calls __nv_isinf which return 1 for true on vector input, while the generic clc_isinf which return -1 for true on vector input. Using nvptx clc_isinf in OpenCL isinf violates OpenCL spec.

Found the issue in intel/llvm#22413

The file calls __nv_isinf which return 1 for true on vector input, while
the generic clc_isinf which return -1 for true on vector input.
Using nvptx clc_isinf in OpenCL isinf violates OpenCL spec.

Found the issue in intel/llvm#22413
@wenju-he wenju-he requested review from arsenm and jhuber6 June 25, 2026 00:16
@llvmorg-github-actions llvmorg-github-actions Bot added the libclc libclc OpenCL library label Jun 25, 2026

@jhuber6 jhuber6 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Honestly we could probably replace a lot of old nv_ functions entirely. That would probably be a noble goal of this, but people may expect these functions to remain bitwise identical.

@wenju-he

Copy link
Copy Markdown
Contributor Author

some libclc nvptx math function still uses nv_ functions. yes we should probably delete them. @arsenm said before that libclc shouldn't be a wrapper over these functions.

@wenju-he wenju-he merged commit 89ac672 into llvm:main Jun 25, 2026
13 checks passed
@wenju-he wenju-he deleted the libclc-delete-nvptx-clc_isinf.cl branch June 25, 2026 00:47
@arsenm

arsenm commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

Honestly we could probably replace a lot of old nv_ functions entirely. That would probably be a noble goal of this, but people may expect these functions to remain bitwise identical.

isinf cannot go wrong. There is no legitimate reason to provide an intrinsic for it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

libclc libclc OpenCL library

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants