Improve Speed of Matrix Multiplication by Taking Advantage of GPUArray

조회 수: 4 (최근 30일)
Chimalume Atuchukwu
Chimalume Atuchukwu 2015년 6월 19일
댓글: Edric Ellis 2015년 6월 19일
I actually want to improve the speed of the multiplication of matrix A (m-by-n) and vector x (n-by-1) using GPUArray. Using:
gpuA = gpuArray(A);
gpux = gpuArray(x);
gpuC = gpuA * gpux
C = gather(gpuC)
didn't give me the needed improvement in speed. Any ideas on how I can achieve this?
  댓글 수: 5
Chimalume Atuchukwu
Chimalume Atuchukwu 2015년 6월 19일
Hi Azzi. Thanks for your contribution. I have edited the question to make it clearer. Any assistance you can offer me will be highly appreciated.
Edric Ellis
Edric Ellis 2015년 6월 19일
How large is A? What GPU device do you have? Also, note that ideally you'd compare timings for only the matrix multiplication portion - you shouldn't time the data transfers too as you shouldn't need to keep transferring data. I would compare:
timeit(@() A * x);
against
gputimeit(@() gpuA * gpux);
On my K20 GPU I see break-even when A is about 1000x1000.

댓글을 달려면 로그인하십시오.

답변 (0개)

카테고리

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

제품

Community Treasure Hunt

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

Start Hunting!

Translated by