title: using clamp function in OpenCL code
body: <p>In my OpenCL code (which is not coded by myself, it's just an example code from internet), there is the following sentence to use the function of clamp. </p>
  
  <pre><code>return clamp(color,0,1);
  </code></pre>
  
  <p>However it seems that this makes error during compilation, so I got the error info message by using CL_PROGRAM_BUILD_LOG from clGetProgramBuildInfo.</p>
  
  <pre><code>Error during compilation! (-11)
  4483
  build log
  :211:9: error: call to 'clamp' is ambiguous
          return clamp(color,0,1);
                 ^~~~~
  &lt;built-in&gt;:3558:26: note: candidate function
  float4  __OVERLOADABLE__ clamp(float4 x, float min, float max)   ;
                           ^
  &lt;built-in&gt;:3577:25: note: candidate function
  float4 __OVERLOADABLE__ clamp(float4, float4, float4);
                          ^
  &lt;built-in&gt;:3556:26: note: candidate function
  float3  __OVERLOADABLE__ clamp(float3 x, float min, float max)   ;
                           ^
  &lt;built-in&gt;:3575:25: note: candidate function
  float3 __OVERLOADABLE__ clamp(float3, float3, float3);
                          ^
  :296:52: error: address expression must be an lvalue or a function designator
                                  r.origin = matrixVectorMultiply(viewTransform, &amp;(float3)(0, 0, -1));
                                                                                 ^~~~~~~~~~~~~~~~~~
  :297:62: error: address expression must be an lvalue or a function designator
                                  r.dir    = normalize(matrixVectorMultiply(viewTransform, &amp;(float3)(x, y, 0)) - r.origin);
                                                                                           ^~~~~~~~~~~~~~~~~
  </code></pre>
  
  <p>Is there any necessary keyword for using clamp function in OpenCL code? BTW, I'm using the environment of the Linux Ubuntu 10.04 64bit.</p>