Skip to content

resample! is slow on the gpu #106

@stepholinger

Description

@stepholinger

At the moment, resample! is quite slow on the gpu. Optimizing code therefore requires designing a workflow in which data is resampled before being moved to the gpu so other preprocessing steps can enjoy the gpu speedup. This may not be ideal in all cases. The example below should demonstrate the issue.

# choose original fs and new fs
fs = 100.
resample_fs = 10.

# generate some 'data'
data = rand(500,500)

# resample on cpu
C = CorrData(corr=data,fs=fs)
cpu_time = @elapsed resample!(C,resample_fs)

# resample on gpu
C = CorrData(corr=data,fs=fs) |> gpu
gpu_time = @elapsed resample!(C,resample_fs)

# print results
print("CPU time: ", cpu_time, " s\n")
print("GPU time: ", gpu_time, " s\n")

CPU time: 0.029605658 s
GPU time: 108.995494081 s

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