Skip to content

sort!(x, dims=2) doesn't work #1030

Description

@efaulhaber

MWE:

julia> x = AMDGPU.rand(100, 100);

julia> sort!(x, dims=2)
ERROR: MethodError: no method matching _sort_impl!(::ROCArray{Float32, 2, AMDGPU.Runtime.Mem.HIPBuffer}, ::ROCBackend; dims::Int64)
This method does not support all of the given keyword arguments (and may not support any).

Closest candidates are:
  _sort_impl!(::AbstractArray, ::KernelAbstractions.Backend; lt, by, rev, order, max_tasks, min_elems, prefer_threads, block_size, temp) got unsupported keyword argument "dims"
   @ AcceleratedKernels ~/.julia/packages/AcceleratedKernels/AdYRJ/src/sort/sort.jl:81

Stacktrace:
 [1] kwerr(::@NamedTuple{dims::Int64}, ::Function, ::ROCArray{Float32, 2, AMDGPU.Runtime.Mem.HIPBuffer}, ::ROCBackend)
   @ Base ./error.jl:175
 [2] sort!(v::ROCArray{Float32, 2, AMDGPU.Runtime.Mem.HIPBuffer}, backend::ROCBackend; kwargs::@Kwargs{dims::Int64})
   @ AcceleratedKernels ~/.julia/packages/AcceleratedKernels/AdYRJ/src/sort/sort.jl:74
 [3] sort!(x::ROCArray{Float32, 2, AMDGPU.Runtime.Mem.HIPBuffer}; kwargs::@Kwargs{dims::Int64})
   @ AMDGPU ~/.julia/packages/AMDGPU/1CdUx/src/kernels/sorting.jl:1
 [4] top-level scope
   @ REPL[7]:1
julia> versioninfo()
Julia Version 1.12.5
Commit 5fe89b8ddc1 (2026-02-09 16:05 UTC)
Build Info:
  Official https://julialang.org release
Platform Info:
  OS: Linux (x86_64-linux-gnu)
  CPU: 128 × AMD EPYC 7713 64-Core Processor
  WORD_SIZE: 64
  LLVM: libLLVM-18.1.7 (ORCJIT, znver3)
  GC: Built with stock GC
Threads: 1 default, 1 interactive, 1 GC (on 128 virtual cores)

julia> AMDGPU.versioninfo()
AMDGPU versioninfo
┌───────────┬──────────────────┬───────────┬─────────────────────────────────────────────────────────────────────────────────────────┐
│ Available │ Name             │ Version   │ Path                                                                                    │
├───────────┼──────────────────┼───────────┼─────────────────────────────────────────────────────────────────────────────────────────┤
│     +     │ LLD              │ -/opt/rocm-6.4.4/lib/llvm/bin/ld.lld                                                     │
│     +     │ Device Libraries │ -/home/efaulha2/.julia/artifacts/0a0cad46b7dacc66387ed19e8c0f45b097f46691/amdgcn/bitcode │
│     +     │ HIP              │ 6.4.43484/opt/rocm-6.4.4/lib/libamdhip64.so                                                      │
│     +     │ rocBLAS          │ 4.4.1/opt/rocm-6.4.4/lib/librocblas.so                                                       │
│     +     │ rocSOLVER        │ 3.28.2/opt/rocm-6.4.4/lib/librocsolver.so                                                     │
│     +     │ rocSPARSE        │ 3.4.0/opt/rocm-6.4.4/lib/librocsparse.so                                                     │
│     +     │ rocRAND          │ 3.3.0/opt/rocm-6.4.4/lib/librocrand.so                                                       │
│     +     │ rocFFT           │ 1.0.32/opt/rocm-6.4.4/lib/librocfft.so                                                        │
│     -     │ MIOpen           │ --                                                                                       │
└───────────┴──────────────────┴───────────┴─────────────────────────────────────────────────────────────────────────────────────────┘

AMDGPU devices
┌────┬────────────────────┬────────────────────────┬───────────┬────────────┬───────────────┐
│ Id │               Name │               GCN arch │ Wavefront │     Memory │ Shared Memory │
├────┼────────────────────┼────────────────────────┼───────────┼────────────┼───────────────┤
│  1 │ AMD Instinct MI210 │ gfx90a:sramecc+:xnack-6463.984 GiB │    64.000 KiB │
└────┴────────────────────┴────────────────────────┴───────────┴────────────┴───────────────┘

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions