← 返回首页
More fast math by umar456 · Pull Request #3337 · arrayfire/arrayfire · GitHub
Skip to content

Navigation Menu

Toggle navigation
Sign in
Appearance settings
Search or jump to...

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Include my email address so I can be contacted

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
Resetting focus

More fast math#3337

Merged
umar456 merged 2 commits into
arrayfire:masterfrom
umar456:more_fast_math
Nov 26, 2022
Merged

More fast math#3337
umar456 merged 2 commits into
arrayfire:masterfrom
umar456:more_fast_math

Conversation

Copy link
Copy Markdown
Member

umar456 commented Nov 25, 2022

Fix tests and improve the AF_WITH_FAST_MATH option in OpenCL and CUDA

Description

  • Pass fast math flag to nvcc
  • Pass fast math flag to nvrtc
  • Pass fast math flag to OpenCL
  • Fix min and max function when AF_WITH_FAST_MATH is set because infinity doesn't exist with fast math
  • Set cuBLAS math mode to CUBLAS_TF32_TENSOR_OP_MATH when AF_WITH_FAST_MATH is set

Changes to Users

N/A

Checklist

  • Rebased on latest master
  • Code compiles
  • Tests pass
  • [ ] Functions added to unified API
  • [ ] Functions documented

Copy link
Copy Markdown
Member

9prady9 left a comment

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality Hide comment

do we have any fast mode specific tests ?

Copy link
Copy Markdown
Member Author

umar456 commented Nov 26, 2022

We don't have fast math specific tests. I am not sure how we could write one. We can lower precision but I don't think that will be helpful. A lot of tests still fail with these changes. I am not sure if we can fix all of them.

umar456 merged commit 2181739 into arrayfire:master Nov 26, 2022
umar456 deleted the more_fast_math branch November 26, 2022 18:23
Copy link
Copy Markdown
Contributor

Perhaps you could add some fastmath specific refs values using the macro :
https://stackoverflow.com/questions/43140581/how-to-use-the-gcc-preprocessor-macro-fast-math
But what I ve seen is that results with fastmath depend on many vars (os, cpu arch, compiler, ...)

This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
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

Footer

© 2026 GitHub, Inc.