Author SHA1 Message Date
z 28eec9e02f merge(refactor/bindgen-ffi-types): consolidate onto master 2026-07-21 17:18:53 -07:00
z 758650441e merge(pr/gpu-sort-feature-gate): consolidate onto master 2026-07-21 17:18:53 -07:00
z a68faeede4 merge(fix/windows-msvc-abi-enum-types): consolidate onto master 2026-07-21 17:18:53 -07:00
z b8165d4fc9 merge(fix/edition-2024-unsafe-fn): consolidate onto master 2026-07-21 17:18:53 -07:00
z b1e6ea55f7 merge(chore/fork-hygiene-notice): consolidate onto master 2026-07-21 17:18:53 -07:00
z e69d157c31 refactor: use bindgen FFI status/enum types instead of hardcoded u32
Return/param sites used literal u32 where bindgen emits typed aliases
(rocblas_status, rocrand_rng_type, rocfft_status). No-op on Linux where the
alias is u32; correct on the native Windows/MSVC ABI where it is i32. Public
Error types stay byte-identical via explicit 'as u32'.
2026-06-24 17:37:54 +00:00
z 51d135c87d fix: wrap rocblas wrapper bodies in unsafe blocks for edition 2024
Edition 2024 promotes unsafe_op_in_unsafe_fn to deny-by-default; the rocblas
level1/2/3 forwarders call FFI without an explicit unsafe block (hard E0133 on
MSVC). Wrap the bodies; no behavior change on any platform.
2026-06-24 17:37:53 +00:00
z c577f94389 feat: gate amdgcn GPU-sort kernel behind default-on 'gpu-sort' feature
The kernel is built at compile time by the external amdgpu_kernel_finalize!
proc-macro via a nested nightly+build-std cargo build, which drops off nightly
on Windows/MSVC (E0463 can't find crate for core). GPU sort is unused by
inference, so gating the kernel (empty fallback) lets the crate build on every
host while keeping it default-on. No call sites change.
2026-06-24 17:37:52 +00:00
z aa4da62dea Use bindgen enum/status types for native Windows (MSVC) ABI
C enums whose values are all non-negative are compiled as unsigned int
(u32) by GCC/Clang on Linux but as signed int (i32) by MSVC on Windows.
bindgen follows the platform ABI, so every generated status/enum alias
(rocblas_status, rocrand_status, rocrand_rng_type, rocrand_ordering,
rocfft_status_e, rocfft_transform_type, ...) is u32 on Linux and i32 on
Windows. The crate hardcoded a literal u32 at FFI return types,
Error::new sites, and enum-typed parameters, which produced ~50
error[E0308] 'expected u32, found i32' on a native MSVC build while
building fine on Linux.

Fix: reference the bindgen-generated type instead of a literal u32
(ffi::rocblas_status, bindings::rocrand_rng_type, ...). This is a no-op
on Linux (the alias is u32 there) and correct on MSVC. Error variants
that store the raw code keep an explicit 'as u32' so the public Error
type is identical across platforms.

Also wrap the thin rocBLAS level1/2/3 'pub unsafe fn' forwarders' calls
to their unsafe trait methods in 'unsafe { }' blocks. The crate is
edition 2024, where unsafe_op_in_unsafe_fn is deny-by-default; MSVC
enforced it as a hard error[E0133] (17 sites). The wrap is identical on
both platforms and is arguably a correctness fix Linux should enforce too.

Generated bindings.rs is intentionally not included (it is a per-toolchain
build artifact regenerated by bindgen against the locally-installed ROCm
headers).

Verified: 'cargo check' reaches Finished on Linux for both
--no-default-features --features macros and default features (proving the
type changes are no-ops there); the downstream consumer builds and runs on
native Windows/MSVC with ROCm 7.13 (gfx1151).
2026-06-22 21:46:27 -07:00

Diff Content Not Available