[PR #4600] [Engine] iq_kernels.cu: drop redundant alignas to fix hip build #5105

Open
opened 2026-11-07 16:32:44 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Niko1221/Strata/pull/4600
Author: @suvayu
Created: 10/29/2026
Status: 🔄 Open

Base: main ← Head: main


📝 Commits (1)

  • 961e0a6 iq_kernels.cu: drop redundant alignas to fix hip build

📊 Changes

1 file changed (+4 additions, -2 deletions)

View changed files

📝 src/kernels/cuda/iq_kernels.cu (+4 -2)

📄 Description

Declaration: I used DeepSeek v4.1 to find the fix.

Problem and result

Strata is not compiling against ROCm. Compilation error:

 src/kernels/cuda/iq_kernels.cu:2571:16: error: 'alignas' attribute cannot be applied to types
  2571 |     __shared__ alignas(16) int4 s_u[ED_NC * 2 * ED_XB];
       |                ^
 src/kernels/cuda/iq_kernels.cu:2758:16: error: 'alignas' attribute cannot be applied to types
  2758 |     __shared__ alignas(16) int4 s_u[ED_NC * 2 * ED_HB];
       |                ^

#4589

Approach

clang's HIP frontend rejects alignas in that position: it parses the attribute as appertaining to the type rather than to the declared entity → 'alignas' attribute cannot be applied to types.

This build failure was already known, as documented by the following comment on line 1869 in the same file.

// #778: `__shared__ alignas(16)` does not compile for gfx1030 (HIP); the attribute after the declarator does, but nvcc
// with MSVC as host does not take it.  Same layout either way.

Not sure I understand the MSVC comment.

Validation

My environment:

$ uname -r
7.2.13-200.fc44.x86_64
$ sudo dnf info --installed rocm-core
Installed packages
Name            : rocm-core
Epoch           : 0
Version         : 7.1.1
Release         : 4.fc44
Architecture    : x86_64
Installed size  : 20.4 KiB
Source          : rocm-core-7.1.1-4.fc44.src.rpm
From repository : fedora
Summary         : A utility to get the ROCm release version
URL             : https://github.com/ROCm/rocm-systems
License         : MIT
Description     : A utility to get the ROCm release version
Vendor          : Fedora Project

Passed:
A ROCm build now succeeds.

Failed:
none observed

Not run:
I have not checked if this still compiles with nvcc.

Limits

NA


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/Niko1221/Strata/pull/4600 **Author:** [@suvayu](https://github.com/suvayu) **Created:** 10/29/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `main` --- ### 📝 Commits (1) - [`961e0a6`](https://github.com/Niko1221/Strata/commit/961e0a60a2b760e662dec0bbe70642183ff87b16) iq_kernels.cu: drop redundant alignas to fix hip build ### 📊 Changes **1 file changed** (+4 additions, -2 deletions) <details> <summary>View changed files</summary> 📝 `src/kernels/cuda/iq_kernels.cu` (+4 -2) </details> ### 📄 Description Declaration: I used DeepSeek v4.1 to find the fix. ## Problem and result Strata is not compiling against ROCm. Compilation error: ``` src/kernels/cuda/iq_kernels.cu:2571:16: error: 'alignas' attribute cannot be applied to types 2571 | __shared__ alignas(16) int4 s_u[ED_NC * 2 * ED_XB]; | ^ src/kernels/cuda/iq_kernels.cu:2758:16: error: 'alignas' attribute cannot be applied to types 2758 | __shared__ alignas(16) int4 s_u[ED_NC * 2 * ED_HB]; | ^ ``` ## Related discussion #4589 ## Approach clang's HIP frontend rejects alignas in that position: it parses the attribute as appertaining to the type rather than to the declared entity → 'alignas' attribute cannot be applied to types. This build failure was already known, as documented by the following comment on line 1869 in the same file. ``` // #778: `__shared__ alignas(16)` does not compile for gfx1030 (HIP); the attribute after the declarator does, but nvcc // with MSVC as host does not take it. Same layout either way. ``` Not sure I understand the MSVC comment. ## Validation <!-- Exact commands, the revision and the environment tested, what you saw. Keep the three lists apart. --> My environment: ``` $ uname -r 7.2.13-200.fc44.x86_64 $ sudo dnf info --installed rocm-core Installed packages Name : rocm-core Epoch : 0 Version : 7.1.1 Release : 4.fc44 Architecture : x86_64 Installed size : 20.4 KiB Source : rocm-core-7.1.1-4.fc44.src.rpm From repository : fedora Summary : A utility to get the ROCm release version URL : https://github.com/ROCm/rocm-systems License : MIT Description : A utility to get the ROCm release version Vendor : Fedora Project ``` **Passed:** A ROCm build now succeeds. **Failed:** none observed **Not run:** I have not checked if this still compiles with `nvcc`. ## Limits <!-- Known limitations or remaining work. --> NA --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Niko1221/Strata#5105
No description provided.