Skip to content

Document that 64-bit floating-point types are enabled by default - #1738

Merged
rjodinchr merged 3 commits into
google:mainfrom
cyrne1-7208:p2-docs-fp64
Nov 11, 2026
Merged

rjodinchr merged 3 commits into
google:mainfrom
cyrne1-7208:p2-docs-fp64

Conversation

@cyrne1-7208

@cyrne1-7208 cyrne1-7208 commented Nov 11, 2026 •

Copy link
Copy Markdown
Contributor

The 64-bit types section still says double types must not be used, but
-fp64 defaults to on. Update the section to reflect the current
behavior, document -fp64=0, and rename the heading to
64-Bit Floating-Point Types since long/ulong are unaffected by
-fp64.

FP64 support is still incomplete (#321). Document all double
scalar/vector types, including double8/double16 (which require
-long-vector), and note the current limitations of
degrees()/radians() and native math built-ins.

Verified with the local clspv build:

  • A double kernel compiles and passes spirv-val by default.
  • The same kernel fails to compile with -fp64=0.
  • A float kernel still compiles with -fp64=0.
  • long/ulong still compile and pass spirv-val with -fp64=0.
  • double8/double16 compile and pass spirv-val with -long-vector,
    and fail to compile without it or with -fp64=0.
  • degrees()/radians() on double fail spirv-val even with default
    options.
  • sin()/exp() on double fail spirv-val with -cl-native-math or
    -use-native-builtins.

@rjodinchr rjodinchr left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Thanks for catching that this section was outdated regarding -fp64! Because FP64 support in clspv is still partial (#321) — e.g. degrees/radians and --cl-native-math still emit invalid SPIR-V for double — I left a couple of suggestions to document FP64 as partially supported across all double scalar/vector types and clarify the section heading.

Comment thread docs/OpenCLCOnVulkan.md Resolved
Comment thread docs/OpenCLCOnVulkan.md Resolved
The 64-bit types section still says `double` types must not be used, but
`-fp64` defaults to on. Update the section to reflect the current
behavior, document `-fp64=0`, and rename the heading to
`64-Bit Floating-Point Types` since `long`/`ulong` are unaffected by
`-fp64`.

FP64 support is still incomplete (google#321). Document all `double`
scalar/vector types, including `double8`/`double16` (which require
`-long-vector`), and note the current limitations of
`degrees()`/`radians()` and native math built-ins.

Verified with the local clspv build:
- A `double` kernel compiles and passes `spirv-val` by default.
- The same kernel fails to compile with `-fp64=0`.
- A `float` kernel still compiles with `-fp64=0`.
- `long`/`ulong` still compile and pass `spirv-val` with `-fp64=0`.
- `double8`/`double16` compile and pass `spirv-val` with `-long-vector`,
  and fail to compile without it or with `-fp64=0`.
- `degrees()`/`radians()` on `double` fail `spirv-val` even with default
  options.
- `sin()`/`exp()` on `double` fail `spirv-val` with `-cl-native-math` or
  `-use-native-builtins`.
Comment thread docs/OpenCLCOnVulkan.md Resolved
Co-authored-by: Romaric Jodin <rjodin@chromium.org>
Comment thread docs/OpenCLCOnVulkan.md Resolved
Co-authored-by: Romaric Jodin <rjodin@chromium.org>
@rjodinchr
rjodinchr enabled auto-merge (squash) November 11, 2026 10:26
@cyrne1-7208

Copy link
Copy Markdown
Contributor Author

Thanks @rjodinchr for the helpful suggestions and the approval! The general FP64 note is cleaner and less likely to go stale as individual built-ins are fixed, and the heading now correctly scopes the section to floating-point types. I appreciate the review.

@rjodinchr
rjodinchr merged commit 67b3640 into google:main Nov 11, 2026
17 of 18 checks passed
@cyrne1-7208
cyrne1-7208 deleted the p2-docs-fp64 branch November 11, 2026 15:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants