OpenCL: rename Z61 fma() to z61_fma() for AMD COMGR overload resolution#2
Open
jcoxdco wants to merge 1 commit intogwoltman:masterfrom
Open
OpenCL: rename Z61 fma() to z61_fma() for AMD COMGR overload resolution#2jcoxdco wants to merge 1 commit intogwoltman:masterfrom
jcoxdco wants to merge 1 commit intogwoltman:masterfrom
Conversation
Cause With NTT_GF61 enabled (e.g. FFT3261 / FFT323161), math.cl defined an overloadable fma taking three Z61 (ulong) arguments. On AMD COMGR, overload resolution for float/F calls such as U2(fma(a, -w.y, w.x), fma(a, w.x, -w.y)) could incorrectly select fma(Z61, Z61, Z61) via implicit conversions. That makes fma return ulong, U2 become ulong2, and assignment to F2/float2 fail at compile time. Fix Rename the Z61 helper to z61_fma in both definitions in math.cl (including the alternate path behind the older #if 0 block so naming stays consistent if that block is enabled). No call sites used fma with three Z61 values, so no other source changes were required. Build note: if the build embeds OpenCL via a generated bundle.cpp, regenerate it with genbundle.sh so embedded sources match math.cl. After updating, rebuild; the FP32 chainMul4 path should compile cleanly on AMD with GF61 NTT enabled.
Author
|
I also want to add that this pull request isn't meant to insult the work you're doing. I think it's amazing and I'm a huge sceptic of any agentic AI. This pull request is really scratching an itch that is my need to understand if an agentic AI can even make sense of code this optimized and make even halfway decent recommendations. So far it's failed every attempt to make the mfakto codebase any faster on my machine. If you want to laugh as you reject this PR, I totally understand. Either way, thank you. |
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
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I got this error when running tune after building the project from your repo:
In file included from C:\Users\jeffr\AppData\Local\Temp\comgr-49671b\input\CompileSource:1:
In file included from C:\Users\jeffr\AppData\Local\Temp\comgr-49671b\include\fftp.cl:7:
In file included from C:\Users\jeffr\AppData\Local\Temp\comgr-49671b\include\fftwidth.cl:4:
C:\Users\jeffr\AppData\Local\Temp\comgr-49671b\include\fftbase.cl:528:8: error: assigning to '__private F2' (aka '__private float2') from incompatible type 'ulong2' (vector of 2 'ulong' values)
528 | base = U2(fma(a, -w.y, w.x), fma(a, w.x, -w.y));
| ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The below was obviously written by AI, so take it with a grain of salt for sure, but the changes compiled and it did allow me to get through a --tune cycle. I'm on windows with an AMD 7700 XT