필터 지우기
필터 지우기

Info

이 질문은 마감되었습니다. 편집하거나 답변을 올리려면 질문을 다시 여십시오.

Using multiple GPU for functions

조회 수: 1 (최근 30일)
Mantas Vaitonis
Mantas Vaitonis 2018년 9월 29일
마감: Mantas Vaitonis 2018년 10월 2일
Dear All,
I have two GPU devices (GeForce GTX 1070 Ti and GeForce GTX 1060 6GB) and I have code that works great with one GPU. However when I try to implement the code on two GPUs it becomes 10x times slower. The thing is that I never workd with multiple GPUs. What is wrong with my implementation? Here is code:
clear;
delete(gcp('nocreate'));
parpool(gpuDeviceCount);
dydis=5050;
load 4.mat
[z,~]=size(test);
% in how many peaces should data be divided, due to GPU memory
z=z/dydis;
z = fix(z);
tic
%from here starts parfor, which should be used by both GPUS
parfor i=1:z
%a list of constants
comi=0.05;
ut=1;
t=0.6;
ut1=ut;
d=5001;
window=5000;
atidaryta=1000;
dydis=5050;
%create 3D array
x1(:,:,i)=test(i*dydis+1-dydis:i*dydis,:);
x=gpuArray(x1(:,:,i));
x23=x(1:end-d,:);
[n1,n2]=size(x);
n1=gpuArray(n1);
n2=gpuArray(n2);
d=gpuArray(d);
t=gpuArray(t);
window=gpuArray(window);
atidaryta=gpuArray(atidaryta);
xt=x.';
x = [];
dx=(d-window-1:d-2).' + (1:n1-d);
% function where data is sent for futher calculations
[sujn1(:,:,i),sujn2(:,:,i)]=mazinta(xt,dx,n2,n1,d,x23,t,window,atidaryta,comi);
end
toc
  댓글 수: 2
Joss Knight
Joss Knight 2018년 9월 30일
Please format this code to make it readable.
Mantas Vaitonis
Mantas Vaitonis 2018년 9월 30일
Is it ok now?

답변 (0개)

이 질문은 마감되었습니다.

Community Treasure Hunt

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

Start Hunting!

Translated by