141 Commits
Author SHA1 Message Date
zeekayandHanzo Dev 5626ba6e6a ci: fix the gate to assert the code, not the runner image
kv named the wrong server binary (kv-server, not valkey-server) and assumed a C
compiler the reusable installs only for Go callers; forum assumed a ruby the
reusable never provisions; rocm-rs left gpu-sort on, whose nested nightly
build-std step no stock runner can do; insights-rs asked for --all-features,
which selects the live-endpoint e2e feature.

Co-authored-by: Hanzo Dev <[email protected]>
2026-08-06 02:39:59 -07:00
zeekayandHanzo Dev 9260fbc462 ci: canonical pair — hanzo.yml + forge caller
github.com has no runner for hanzo-build-linux-amd64, so a caller under
.github/workflows is a gate that can never be scheduled. This is the ~7-line
caller on the plane that can (git.hanzo.ai git-runner fleet), pinned @v1.

Co-authored-by: Hanzo Dev <[email protected]>
2026-08-06 02:34:31 -07:00
zeekay e3ef8555b3 merge(refactor/bindgen-ffi-types): consolidate onto master 2026-07-21 17:18:53 -07:00
zeekay 6203990209 merge(pr/gpu-sort-feature-gate): consolidate onto master 2026-07-21 17:18:53 -07:00
zeekay e6f055012c merge(fix/windows-msvc-abi-enum-types): consolidate onto master 2026-07-21 17:18:53 -07:00
zeekay 6e1a1e4774 merge(fix/edition-2024-unsafe-fn): consolidate onto master 2026-07-21 17:18:53 -07:00
zeekay d7a8cdfbab merge(chore/fork-hygiene-notice): consolidate onto master 2026-07-21 17:18:53 -07:00
zeekay 743194fdfc chore(notice): add rocm-rs provenance and deviations 2026-07-13 16:07:41 -07:00
zeekay 92e1a4c3eb chore: OSS attribution — rocm-rs (MIT) LICENSE + NOTICE 2026-07-02 12:46:26 -07:00
zeekay a04acd2a14 docs(brand): add hero banner 2026-06-28 20:11:54 -07:00
zeekay e5321a64e1 chore(brand): dynamic hero banner 2026-06-28 20:11:53 -07:00
zeekay 62c171b688 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
zeekay 7b0b2f9438 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
zeekay aa047ca41c 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
zeekay 5c8c10dbd2 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
zeekay 8b99dfa648 rename crate rocm-rs -> hanzo-rocm; publish to crates.io 0.5.2
Publish the Windows/MSVC-portable fork as a first-class crate (hanzo-rocm) so
downstream depends on a proper crates.io crate instead of a git patch. Examples
alias the package (their code still uses rocm_rs::).
2026-06-22 17:29:03 -07:00
zeekay 27c2459d3c release v0.5.2: native Windows/MSVC support + upstream PR notes
Bump 0.5.1 -> 0.5.2. Adds UPSTREAM_PR_NOTES.md documenting the MSVC
portability fixes (enum signedness, edition-2024 unsafe, gated amdgcn
GPU-sort kernel) for a future PR to RustNSparks/rocm-rs.
v0.5.2
2026-06-22 15:39:04 -07:00
zeekay 3089482c2d rocrand/rocarray: bindgen enum types for Windows ABI; edition-2024 unsafe blocks in rocblas wrappers
Windows/MSVC bindgen emits C enums with only non-negative values as
signed c_int (i32) where Linux GCC/Clang emit c_uint (u32). Two classes
of failure surfaced only on the MSVC build:

E0308 (enum signedness, 31 sites, all in rocrand):
- rocrand/mod.rs: rng_type, ordering, direction_vector_set constants
  were hand-typed "u32"; retype to the exact bindgen aliases
  rocrand_rng_type / rocrand_ordering / rocrand_direction_vector_set.
- rocrand/generator.rs: PseudoRng::new/new_host and QuasiRng::new take
  rocrand_rng_type; Generator::set_ordering takes rocrand_ordering.
- rocarray/random.rs: RandomUtils::seeded_generator rng_type param
  follows PseudoRng::new (rocrand_rng_type).
These are no-ops on Linux (c_uint == u32) and correct on MSVC (i32).

E0133 (edition 2024 unsafe_op_in_unsafe_fn, 17 sites): the rocblas
level1/2/3 thin forwarders are "pub unsafe fn" but called their unsafe
trait method with no "unsafe { }" block. MSVC denies this lint as a hard
error; wrap each forwarding call. Required identically on both platforms.

rocblas enum args (rocblas_operation/fill/side/diagonal) already convert
via From impls in types.rs and stay correct on both ABIs; rocfft enums
are already bindgen-typed. Generated bindings.rs left untouched.

Verified: cargo check Finishes on Linux for both --features macros and
default features; zero E0308, zero E0133.
2026-06-21 21:45:37 -07:00
zeekay 8e7a802800 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; that nested build
inherits the parent rustc env and drops off nightly on Windows/MSVC
(E0463 can't find crate for core). GPU sort is unused by LLM inference, so
gating the kernel (empty fallback) lets the crate build on every host while
keeping it default-on for native Linux users.
2026-06-21 21:32:53 -07:00
zeekay 490346c497 rocrand/rocfft: use bindgen status/enum types, not hardcoded u32
C enums with only non-negative values are unsigned int (u32) under Linux
GCC/Clang but signed int (i32) under MSVC. bindgen follows the platform ABI,
so the generated status/enum types are u32 on Linux and i32 on Windows.
Hand-coding u32 at status/enum-handling sites mismatched the bindgen type on
Windows, producing E0308 'expected u32, found i32'.

Fix is uniform: stop hardcoding u32; use the module's bindgen type. No-op on
Linux (the alias is u32 there), correct on Windows.

rocrand/error.rs:
  from_status(status: bindings::rocrand_status)   // was u32
  Unknown(other as u32)                           // keep error variant u32-stable

rocfft/error.rs:
  impl From<bindings::rocfft_status_e> for Error   // was From<u32>
  check_error(status: bindings::rocfft_status_e)   // was u32
  check_compatible_types(transform_type: rocfft_transform_type,
                         in/out_array_type: rocfft_array_type)  // was u32
  Unknown(code as u32)                             // keep error variant u32-stable

rocfft/plan.rs + rocfft/description.rs:
  From<TransformType>  for rocfft_transform_type     // was for u32
  From<Precision>      for rocfft_precision          // (enum-typed FFI args:
  From<PlacementType>  for rocfft_result_placement   //  the .into() targets
  From<ArrayType>      for rocfft_array_type         //  rocfft_plan_create etc.
  From<CommType>       for rocfft_comm_type          //  expect the enum type)

rocsparse/rocarray/hip already used bindgen types (or genuine u32 flags/dims/
counts) and need no change. Verified: cargo check --no-default-features
--features macros reaches Finished on Linux (ROCm 7.13).
2026-06-21 21:21:56 -07:00
zeekay 69577a9110 rocblas: use ffi::rocblas_status return type, not hardcoded u32
MSVC compiles the rocblas_status enum as signed int (i32); GCC/Clang on Linux
make the all-positive enum u32. Hardcoding -> u32 in the FFI fn-pointer type
broke native-Windows builds (136 E0308 mismatches vs Error::new(ffi::rocblas_status)).
Referencing the bindgen-generated type is a no-op on Linux and correct on Windows.
2026-06-21 21:02:25 -07:00
PTFOPlayer 6a873cc32d chore: update dependencies and versioning for rocm_kernel_macros and rocm_smi_lib; adjust HIP version constants and bindings 2026-05-05 15:55:04 +02:00
PTFOPlayer 85f3c88faf feat: update dependencies and versioning, add new examples and kernel attributes 2026-03-25 08:51:46 +01:00
WhiskyAKMandGitHub 391ee4065a Add disclaimer regarding affiliation
Added a disclaimer about project affiliation with AMD.
2026-01-02 16:54:20 +01:00
Diaconu Radu Mihai 6caf91eb3d docs: update README to reflect rocSOLVER safe wrappers 2025-12-31 15:07:07 +02:00
Diaconu Radu Mihai 7faf78259a feat: implement safe wrappers for rocSOLVER
Add comprehensive safe Rust wrappers for rocSOLVER (AMD's LAPACK implementation)
following the proven architecture patterns from rocBLAS.

New files:
- error.rs: Error handling wrapping rocblas_status
- types.rs: Type-safe enums (Svect, Evect, Storev, Direct, Workmode, Complex32/64)
- ffi.rs: Selective FFI re-exports
- lapack/mod.rs: LAPACK module structure
- lapack/decompositions.rs: Matrix factorizations (geqrf, getrf, potrf, gebrd)
- lapack/solvers.rs: Linear system solvers (gesv, getrs, posv, gels)
- lapack/svd.rs: Singular Value Decomposition (gesvd)
- lapack/eigenvalue.rs: Eigenvalue computations (syev, heev)
- lapack/orthogonal.rs: Orthogonal/Unitary operations (orgqr, ungqr, ormqr, unmqr)

Features:
- Reuses rocBLAS Handle for seamless interoperability
- Trait-based generics for all 4 precision types (f32, f64, Complex32, Complex64)
- Regular, batched, and strided_batched variants where available
- Type-safe error handling with Result<T>
- Full documentation with examples
2025-12-31 15:06:54 +02:00
Patryk 814e6a884f fix: ommit kernel_sources dir from publishing 2025-12-24 12:26:31 +01:00
Patryk b0258920c1 feat: update to rocm 7.0.0, new release 2025-12-24 12:23:19 +01:00
Patryk ce1d0bae30 fix: workflows 2025-12-20 15:50:43 +01:00
Patryk 899d269eda feat: Implement multi-tensor neural network example 2025-12-20 15:46:08 +01:00
Patryk 7341b03d83 refactor: remove dead code 2025-12-17 10:47:34 +01:00
Patryk 2f53636755 fix: Fix panic when using Stream::add_callback 2025-12-17 10:24:37 +01:00
Patryk 403d269864 fix: remove Sync and Send impls
Removing Sync and Send unsafe impl, those where here for testing only. Because it was introducing unnecessary unsafety now those are removed.
2025-12-16 20:35:43 +01:00
Patryk c306bdf185 refactor: simplyfing basic miopen api 2025-12-15 23:16:26 +01:00
Patryk 31c83d1a0d docs: miopen example (subject to change) 2025-12-11 21:03:15 +01:00
Patryk c023851a6c feat: update rocarray sorting api to use new MemoryExt api 2025-11-24 09:52:58 +01:00
Patryk 0eac10927c feat: ability to check if array is sorted (ascending) 2025-11-23 20:40:03 +01:00
Patryk 71a971becc refactor: Improve memory_ext sorting, adapt rocarray to use memory_ext api for simple ascending sort 2025-11-16 21:27:18 +01:00
Patryk 2fd9c86153 refactor: Simplify rocrand utils 2025-11-16 21:10:16 +01:00
Patryk 139881ffbe feat: Introduce ability to cast DeviceMemory<T> (https://github.com/RustNSparks/rocm-rs/pull/12#issuecomment-3529399008) 2025-11-13 22:07:31 +01:00
Patryk b120630846 refactor: better code organisation 2025-11-05 16:45:42 +01:00
Patryk 4dd7a0fa01 feat: Implementing ascending and descending odd-even sort using rust kernels 2025-11-04 21:16:50 +01:00
Patryk cf954817e2 docs: improving readme, removing unused function from build.rs 2025-10-12 09:24:26 +02:00
Patryk 96b0d54f9f fix: load_data and load_with_options now take correct arguments, removing unsafe launch_kernel
kernel::launch_kernel is removed because it was redundand with kernel::Function::launch, Function can now be created from raw ptr
2025-10-11 10:47:24 +02:00
Patryk 58b24f91c0 feat: update macros to 0.4.1, Stream is now created by calling device.stream to make sure that device is created before stream initialization 2025-10-08 20:27:45 +02:00
Patryk 963c27dd2c refactor: changing trait KernelArg to AsKernelArgs, introducing kernel_args macro, removing unused (and unsafe) launch_kernel macro 2025-10-08 19:05:38 +02:00
Patryk 7a114788b6 feat: re exporting rocm_kernel_macros behind feature flag, new release 2025-09-22 21:00:36 +02:00
Patryk 0539518adc refactor: introducing features system to speedup compilation by limiting number of default components 2025-09-15 21:52:43 +02:00
Patryk 96e3c1fb13 docs: introducing example showing usage of stream and async memory ops 2025-09-15 19:43:09 +02:00
Patryk 4f6438120b docs: improving readme 2025-09-13 11:34:31 +02:00