clMathLibraries / clBLAS

a software library containing BLAS functions written in OpenCL
Apache License 2.0
839 stars 240 forks source link

if statement containing a for loop, wont this be quite slow? #110

Closed hughperkins closed 9 years ago

hughperkins commented 9 years ago

Hi,

In sger kernel, we have:

if( row + float4size < numrows ) {
   // use vector maths
} else {
   for( i = row; i < numrows; i++ ) {
      // use scalar maths
   }
}

Per my understanding:

hughperkins commented 9 years ago

Ok I played with this by commenting out these various ifs and stuff, and speed was the same.

=>closing for now.