replaced custom PI by OpenCL M_PI constant
authorIlya Lavrenov <ilya.lavrenov@itseez.com>
Sun, 10 Nov 2013 20:53:26 +0000 (00:53 +0400)
committerIlya Lavrenov <ilya.lavrenov@itseez.com>
Sun, 10 Nov 2013 20:55:59 +0000 (00:55 +0400)
modules/ocl/src/opencl/arithm_phase.cl
modules/ocl/src/opencl/arithm_polarToCart.cl

index f9835948c4b8bc4f14151292a4925c35b1bf9034..978fd3b97f6d446715c311126bd8856f60bdb408 100644 (file)
 //
 
 #if defined (DOUBLE_SUPPORT)
-    #ifdef cl_khr_fp64
-        #pragma OPENCL EXTENSION cl_khr_fp64:enable
-    #elif defined (cl_amd_fp64)
+    #ifdef cl_amd_fp64
         #pragma OPENCL EXTENSION cl_amd_fp64:enable
+    #elif defined (cl_khr_fp64)
+        #pragma OPENCL EXTENSION cl_khr_fp64:enable
     #endif
-    #define CV_PI 3.1415926535897932384626433832795
-    #define CV_2PI 2*CV_PI
+    #define CV_PI M_PI
+    #define CV_2PI (2 * CV_PI)
 #else
-    #define CV_PI 3.1415926535897932384626433832795f
-    #define CV_2PI 2*CV_PI
+    #define CV_PI M_PI_F
+    #define CV_2PI (2 * CV_PI)
 #endif
 
 /**************************************phase inradians**************************************/
index 8469cdb0970bb667cdf2149f201526115555b259..9e2e860e7f966f3ba36abaf5d1f5930d469998bf 100644 (file)
 //M*/
 
 #ifdef DOUBLE_SUPPORT
-    #pragma OPENCL EXTENSION cl_khr_fp64:enable
-    #define CV_PI   3.1415926535897932384626433832795
+    #ifdef cl_amd_fp64
+        #pragma OPENCL EXTENSION cl_amd_fp64:enable
+    #elif defined (cl_khr_fp64)
+        #pragma OPENCL EXTENSION cl_khr_fp64:enable
+    #endif
+    #define CV_PI M_PI
 #else
-    #define CV_PI   3.1415926535897932384626433832795f
+    #define CV_PI M_PI_F
 #endif
 
 /////////////////////////////////////////////////////////////////////////////////////////////////////