Skip to content

Usage example #28

Open
Open
@RomeoV

Description

@RomeoV

Hello, would it be possible to add a usage example? I couldn't find one here, nor in the Dagger.jl docs.

For example, let's say I have the following task:

# two large matrices
A = rand(1000, 1000)
B = rand(1000, 1000)
# move them to gpu and multiply there
A_gpu = CUDA.Matrix(A) 
B_gpu = CUDA.Matrix(B)
C_gpu = A_gpu*B_gpu
# move back to cpu to use there.
C = Matrix(C_gpu) 

Intuitively, with Dagger, I'd just try to write it like this:

# two large matrices
A = rand(1000, 1000)
B = rand(1000, 1000)
# move them to gpu and multiply there
A_gpu = Dagger.@spawn CUDA.Matrix(A) 
B_gpu = Dagger.@spawn CUDA.Matrix(B)
C_gpu = Dagger.@spawn A_gpu*B_gpu
# move back to cpu to use there.
C = Dagger.@spawn Matrix(C_gpu) 

What role does DaggerGPU.jl play here? It seems I could even do this with just Dagger.jl?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions