Skip to content

Method choice given multiple accelerators #20

Description

@jtrakk
using AcceleratedArrays
using BenchmarkTools

n = 1_000_000
xs = rand(1:big(n)^4, n)

a = accelerate(xs, UniqueHashIndex)
b = accelerate(xs, UniqueSortIndex)
ab = accelerate(a, UniqueSortIndex)
ba = accelerate(b, UniqueHashIndex)


@btime 1 in $a;
@btime 1 in $b;
@btime 1 in $ab;
@btime 1 in $ba;


julia> @btime 1 in $a;
  129.609 ns (2 allocations: 40 bytes)

julia> @btime 1 in $b;
  79.384 ns (0 allocations: 0 bytes)

julia> @btime 1 in $ab;
  203.664 ns (0 allocations: 0 bytes)

julia> @btime 1 in $ba;
  119.543 ns (2 allocations: 40 bytes)

For an array with multiple accelerators, how does it decide which is the best method for a function?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions