CUDA Warp Divergence -


i' m developing cuda , have arithmetic problem, implement or without warp diverengence. warp divergence like:

float v1; float v2; //calculate values of v1 , v2 if(v2 != 0)   v1 += v2*complicated_math(); //store v1 

without warp divergence version looks like:

float v1; float v2; //calculate values of v1 , v2 v1 += v2*complicated_math(); //store v1 

the question is, version faster?

in other words how expensive warp disable compared calculation , addition of 0?

your question has no single answer. heavily depends on amount of calculations, divergence frequency, type of hardware, dimensions , many more aspects. best way program both , use profiling determine best solution in particular case , situation.


Comments

Popular posts from this blog

mysql - FireDac error 314 - but DLLs are in program directory -

git - How to list all releases of public repository with GitHub API V3 -

c++ - Getting C2512 "no default constructor" for `ClassA` error on the first parentheses of constructor for `ClassB`? -