Difference between G2 = G .* G and G2 = G * G in Matlab GPU Computing
NickName:Aurelius Ask DateTime:2014-01-17T03:25:38

Difference between G2 = G .* G and G2 = G * G in Matlab GPU Computing

What's the difference between G2 = G .* G and G2 = G * G in the following codes? And why I get with first code GPU Load 100% and with the second I get GPU Load and Memory Controller Load sensors both at 100% on gpu-z ?

X = rand(5000, 'double');
G = gpuArray(X);
classUnderlying(G)          % Returns 'single'

for m = 1:5000
G2 = G .* G .* G .* G;         % Performed on GPU
end

whos G2                     % Result on GPU

X = rand(5000, 'double');
G = gpuArray(X);
classUnderlying(G)          % Returns 'single'

for m = 1:5000
G2 = G * G * G * G;         % Performed on GPU
end

whos G2                     % Result on GPU

Copyright Notice:Content Author:「Aurelius」,Reproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/21171006/difference-between-g2-g-g-and-g2-g-g-in-matlab-gpu-computing

Answers
Daniel 2014-01-16T19:29:59

There is matrix multiplication (mtimes) and elementwise multiplication (times)\n\nhttp://www.mathworks.de/de/help/matlab/ref/mtimes.html\n\nhttp://www.mathworks.de/de/help/matlab/ref/times.html",


More about “Difference between G2 = G .* G and G2 = G * G in Matlab GPU Computing” related questions

Difference between G2 = G .* G and G2 = G * G in Matlab GPU Computing

What's the difference between G2 = G .* G and G2 = G * G in the following codes? And why I get with first code GPU Load 100% and with the second I get GPU Load and Memory Controller Load sensors bo...

Show Detail

paintComponent(g) or paintComponent(g2)?

public void paintComponent(Graphics g){ super.paintComponent(g); Graphics2D g2 = (Graphics2D) g; g2.fillRect(0,0,25,25); } OR public void paintComponent(Graphics g){

Show Detail

#define f(g,g2) g##g2

#define f(g,g2) g##g2 main() { int var12=100; printf("%d",f(var,12)); } The above program prints 100 in c by concatenating var and 12. How does g##g2 work??

Show Detail

Is -g the same as -g2 for gcc and clang?

GCC debug option documentation is not that comprehensive. So trying to compile a binary with different options -g, -g1, -g2, -g3 I got the following result. When compiling with -g and -g2 binary ha...

Show Detail

MySql spatial: `ST_Contains(g1,g2) || ST_Touches(g1, g2)` vs `ST_distance(g1,g2)=0`

I use mysql spatial functions. I have to understand if points lies withing multipolygon.Birder must be included. My expriments showed that ST_Contains does not include border of Multipolygon So ...

Show Detail

g2 inverse in R

While solving the normal equations in Proc mixed, SAS apparently uses something called g2 inverse (Pringle and Rayner, 1971). ginv in R gives me the moore-penrose inverse which is different. Is the...

Show Detail

How to calculate the GED between g2 and q?

I am learning the networkx function named "networkx.graph_edit_distance(g2,q)". Actually, GED(g2,q) = 2.If we want to tranform g2 to q, we should do at least 2 graph edit operations"substituing (1,3)

Show Detail

Amazon Web Services GPU G2

Today I got setup with AWS GPU G2 instance (g2.2xlarge). I wanted to test out the 3d hardware capability that is offered as mentioned here http://aws.amazon.com/ec2/instance-types/ Features...

Show Detail

Why Graph G2 is not a subgraph isomorphism of graph G1

G1 G2 Hi all I am trying to see if G2 is a subgraph isomorphism of G1, if I plot them I can clearly see the isomorphism but the I get False using the function. L =[[ 0, 23.4, 30.3, 49.45, 0, ...

Show Detail

For Loop iteration for Multiple Gains , which create multiple output corresponding to Gains(G1,G2,G3,G4,G5)

Can anybody suggest what is the error in for loop.How to run successfully the below for loop ? if(testNum==1): print ("Eneter the Step up voltage (pu)") Vstepup = raw_input("Vstep_up : ") Vstepup...

Show Detail