what is the role of streaming multiprocessor(multiprocessorcount in gpuDevice()) on GPU coder?
4 views (last 30 days)
Show older comments
lim daehee on 13 Jan 2020
Answered: Aditya Patil on 12 Jul 2021
I use the GPU coder app with my graphic card, GeForce GTX 1070Ti and I found an issue from the result.
I simulated my code with 1000, 1200, 1400, 1600, 1800 and 1900 nodes.
The elapsed time goes shorter when the number of nodes are small until the number of noes is 1800.
However, when I simulated with 1900 nodes, the elapsed time is much faster than the simulation with 1000 nodes.
I suppose that this becomes due to the MultiprocessorCount of my graphic card and the MultiprocessorCount of my graphic card is 19.
I wonder what is the role of MultiprocessorCount and I want to know the exact reason why the elapsed time with 1900 nodes is faster than the elapsed time of 1000 nodes.
Also, here is my code.
function [D, N, B, R] = fcn_PRM_DH_complete(node_PRM,PosMap,Map_Obs,Obs_mat,CR) %#codegen
n = length(node_PRM);
D = coder.nullcopy(zeros(n));
N = coder.nullcopy(zeros(n));
B = coder.nullcopy(ones(n));
R = coder.nullcopy(zeros(n));
D(i1,j1) = dist;
C = collisionCheck_SP8(pos_mat(i1,:), pos_mat(j1,:));
Aditya Patil on 12 Jul 2021
Streaming Multiprocessors (SMs) is a concept from Nvidia GPUs, where each SM processes threads in parallel. More the number of SMs, more the computational power of the GPU.
As to the reason for performance increase, there can be many distinct reasons, which can be difficult to predict based on the MATLAB code itself and requires looking at the generate code and benchmarking it. However, one reason can be that this specific number of nodes avoids some memory contentions (where there are reads/writes to same memory bank).
Find more on Get Started with GPU Coder in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!Start Hunting!