필터 지우기
필터 지우기

From multi-core CPU to GPU

조회 수: 1 (최근 30일)
Alexandre
Alexandre 2014년 7월 14일
편집: Matt J 2014년 7월 17일
Hi everyone,
I have a code that currently runs on a CPU which has 4 physical cores. This is done by using somewhere in my code a parfor loop.
I wanted to see if i could take any advantage of my GPU by running the code on my 576 Cuda cores instead of my 4 CPU cores. I created/sent all the variables inside the GPU and run the exact same code. However :
- when it comes to the parfor loop, Matlab says :
"Error using parfor_range_check (line 17)
The range of a parfor statement must be numeric. See Parallel Computing Toolbox, "parfor"."
Here is my parfor initialization :
"n_row_max=gpuArray.colon(1,1,576);
parfor row_Rubber=n_row_max"
- if i use a mere "for", it works perfectly but sloooowly, so i assume only 1 cuda core is running ?
I would like to do exactly like the parfor, but on the GPU : have 576 workers (instead of 4) doing the job.
Thanks in advance for any help,
Alex

채택된 답변

Matt J
Matt J 2014년 7월 14일
편집: Matt J 2014년 7월 17일
PARFOR is meant for parallelizing tasks on CPU cores, not on the GPU. You cannot use GPU cores to parallelize complex MCode for-loops. They aren't the appropriate hardware for that.

추가 답변 (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