File tree Expand file tree Collapse file tree 1 file changed +16
-0
lines changed
include/boost/compute/algorithm/detail Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -71,7 +71,22 @@ struct radix_sort_value_type<8>
7171 typedef ulong_ type;
7272};
7373
74+ template <typename T>
75+ inline const char * enable_double ()
76+ {
77+ return " -DT2_double=0" ;
78+ }
79+
80+ template <>
81+ inline const char * enable_double<double >()
82+ {
83+ return " -DT2_double=1" ;
84+ }
85+
7486const char radix_sort_source[] =
87+ " #if T2_double\n "
88+ " #pragma OPENCL EXTENSION cl_khr_fp64 : enable\n "
89+ " #endif\n "
7590" #define K2_BITS (1 << K_BITS)\n "
7691" #define RADIX_MASK ((((T)(1)) << K_BITS) - 1)\n "
7792" #define SIGN_BIT ((sizeof(T) * CHAR_BIT) - 1)\n "
@@ -259,6 +274,7 @@ inline void radix_sort_impl(const buffer_iterator<T> first,
259274 if (sort_by_key){
260275 options << " -DSORT_BY_KEY" ;
261276 options << " -DT2=" << type_name<T2>();
277+ options << enable_double<T2>();
262278 }
263279
264280 // load (or create) radix sort program
You can’t perform that action at this time.
0 commit comments