Commit 45c0663
authored
Fix mlasi_sve.h preprocessor guards to allow clang compilation (microsoft#28507)
### Description
The outer `#ifndef __clang__` in `mlasi_sve.h` (line 20 to line 679) was
intended to wrap the GCC-specific `#pragma GCC` directives, but it also
ends up hiding every SVE kernel declaration and the typedefs from clang.
The `#ifdef __clang__` block that defines `MLAS_SVE_TARGET` for clang's
per-function `__attribute__((target("...")))` syntax is unreachable for
the same reason.
This moves the closing `#endif` up to right after the GCC pragmas so
only the pragmas are GCC-only, and the rest of the header (typedefs,
kernel declarations, MLAS_SVE_TARGET) is visible to both compilers.
### Motivation and Context
Without this, building MLAS with clang for aarch64 fails at platform.cpp
- the `MLAS_USE_SVE` runtime-dispatch block references
`MlasSveErfKernel`, `MlasSveLogisticKernel`, and friends, all undeclared
from clang's perspective. Confirmed working with clang 20.1.8.1 parent ad6d34c commit 45c0663
1 file changed
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
| 23 | + | |
23 | 24 | | |
24 | 25 | | |
25 | 26 | | |
| |||
676 | 677 | | |
677 | 678 | | |
678 | 679 | | |
679 | | - | |
680 | 680 | | |
0 commit comments