Skip to content

tests: portable popcount in arclab_init_hadamard (MSVC build) - #362

Merged
bri-prism merged 1 commit into
PrismML-Eng:prismfrom
professorpalmer:fix-msvc-popcount
Oct 15, 2026
Merged

bri-prism merged 1 commit into
PrismML-Eng:prismfrom
professorpalmer:fix-msvc-popcount

Conversation

@professorpalmer

Copy link
Copy Markdown

Overview

tests/test-backend-ops.cpp does not compile with MSVC since #356: arclab_init_hadamard uses __builtin_popcountll, which is GCC/Clang only (error C3861: '__builtin_popcountll': identifier not found). This replaces it with a small portable popcount (clear the lowest set bit until zero). The Hadamard sign is the parity of r & i, so the values are unchanged.

Additional information

Tested on Windows, MSVC 2022, CUDA 13, RTX 4070: test-backend-ops builds; -o FLASH_ATTN_EXT -b CUDA0 4335/4335 passed.

Requirements

  • I have read and agree with the contributing guidelines
  • AI usage disclosure: YES. An AI agent found the build error and wrote the replacement under my direction; I reviewed the change (a standard bit-count loop) and the test run.

@bri-prism
bri-prism merged commit b858f3b into PrismML-Eng:prism Oct 15, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants