Skip to content

utilities: fix the aarch64 build of mfence() - #1045

Open
joshuaswarren wants to merge 1 commit into
intel:masterfrom
joshuaswarren:aarch64-mfence-build-fix
Open

joshuaswarren wants to merge 1 commit into
intel:masterfrom
joshuaswarren:aarch64-mfence-build-fix

Conversation

@joshuaswarren

Copy link
Copy Markdown

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.

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>
@joshuaswarren

Copy link
Copy Markdown
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?

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.

1 participant