Repository navigation
utilities: fix the aarch64 build of mfence() - #1045
Open
joshuaswarren wants to merge 1 commit into
Open
joshuaswarren wants to merge 1 commit into
joshuaswarren wants to merge 1 commit into
Conversation
mfence() calls _mm_mfence() unconditionally. sse2neon does not provide _mm_mfence (verified against upstream sse2neon.h), so linking current master for aarch64 fails. Guard the intrinsic with __ARM_ARCH and use __sync_synchronize(), which provides the same full ordering barrier on ARM. Built and verified on aarch64 Linux (Arch ARM, GCC 16) as part of a full compute-runtime build for an Arc Pro B60. Signed-off-by: Joshua Warren <816217+joshuaswarren@users.noreply.github.com>
Author
|
On a 16-inch M1 Max running aarch64 Linux, the build linked and OpenCL enumerated an Arc Pro B60 with this change and two local host-specific changes. What additional test would help review? |
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.
mfence() in shared/source/utilities/cpuintrinsics.cpp calls _mm_mfence() unconditionally. sse2neon does not provide _mm_mfence (checked against upstream sse2neon.h), so linking current master for aarch64 Linux fails at this call.
This guards the intrinsic with __ARM_ARCH and uses __sync_synchronize(), which provides the same full ordering barrier on ARM.
Verified on aarch64 Linux (Arch ARM, GCC 16): with this one-line guard, the full compute-runtime build for aarch64 links and initializes an Arc Pro B60 (OpenCL 3.0 platform enumerates the device). The other two aarch64 changes we needed are host-policy patches and stay out of this PR.