Skip to content

[SYCL] Fix build after 1db2a088d8fd#22674

Open
wenju-he wants to merge 1 commit into
intel:syclfrom
wenju-he:cmplrllvm-76994-wunused-template
Open

[SYCL] Fix build after 1db2a088d8fd#22674
wenju-he wants to merge 1 commit into
intel:syclfrom
wenju-he:cmplrllvm-76994-wunused-template

Conversation

@wenju-he

Copy link
Copy Markdown
Contributor

The new fp4 extension unittest added by 1db2a088d8fd ([SYCL] Implement sycl_ext_oneapi_fp4 extension) includes float_4bit/types.hpp, which pulls in <sycl/marray.hpp> and thereby <sycl/detail/common.hpp>. That translation unit never instantiates the static function template convertToArrayOfN, so under -Werror,-Wunused-template (enabled by 1529d35) the build fails:

include/sycl/detail/common.hpp:60:18: error: unused function template
'convertToArrayOfN' [-Werror,-Wunused-template]

Remove the internal-linkage 'static' specifier from the template. This gives it external linkage, which suppresses -Wunused-template for a never-instantiated template (mirroring the fix in PR #22583 for other SYCL header templates) while keeping the existing callers in image.hpp and accessor_image.hpp working.

Fixes: CMPLRLLVM-76994

The new fp4 extension unittest added by 1db2a088d8fd
([SYCL] Implement sycl_ext_oneapi_fp4 extension) includes
float_4bit/types.hpp, which pulls in <sycl/marray.hpp> and thereby
<sycl/detail/common.hpp>. That translation unit never instantiates the
static function template convertToArrayOfN, so under -Werror,-Wunused-template
(enabled by 1529d35) the build fails:

  include/sycl/detail/common.hpp:60:18: error: unused function template
  'convertToArrayOfN' [-Werror,-Wunused-template]

Remove the internal-linkage 'static' specifier from the template. This
gives it external linkage, which suppresses -Wunused-template for a
never-instantiated template (mirroring the fix in PR intel#22583 for other
SYCL header templates) while keeping the existing callers in image.hpp
and accessor_image.hpp working.

Fixes: CMPLRLLVM-76994

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@wenju-he
wenju-he requested a review from a team as a code owner July 19, 2026 02:05
@wenju-he
wenju-he requested a review from sergey-semenov July 19, 2026 02:05
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.

2 participants