필터 지우기
필터 지우기

movsum slower than conv2 in GPU

조회 수: 1 (최근 30일)
Mir Amid Hashemi
Mir Amid Hashemi 2019년 10월 14일
답변: Joss Knight 2019년 10월 15일
Hello,
I have this code that tests how both movsum and conv2 perform under GPU.
A=rand(1e4,1e4,'single','gpuArray');
n=10;f=ones(1,n,'single','gpuArray');
gputimeit(@() conv2(f,A))
gputimeit(@() movsum(A,n))
ans =
0.0051
ans =
0.0102
Turns out conv2 takes 5ms whereas movsum takes 10ms.
movsum should have a simpler algorithm than conv2, no?
Amid.

답변 (1개)

Joss Knight
Joss Knight 2019년 10월 15일
One might theorize, perhaps, that movsum literally uses the same kernels as conv2, but first has to construct the filter of ones which takes extra time. I'm not saying that's what happens, but it's a theory. By making more generic kernels, MATLAB saves space, which is important for download times and the MATLAB Compiler Runtime.

카테고리

Help CenterFile Exchange에서 GPU Computing에 대해 자세히 알아보기

태그

제품


릴리스

R2019a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by