Returns CLFFT_SUCCESS if the fp64 is present, CLFFT_DEVICE_NO_DOUBLE if it is not found.
| 179 | |
| 180 | // Returns CLFFT_SUCCESS if the fp64 is present, CLFFT_DEVICE_NO_DOUBLE if it is not found. |
| 181 | clfftStatus checkDevExt( std::string ext, const cl_device_id &device ) |
| 182 | { |
| 183 | size_t deviceExtSize = 0; |
| 184 | OPENCL_V( ::clGetDeviceInfo( device, CL_DEVICE_EXTENSIONS, 0, NULL, &deviceExtSize ), |
| 185 | "Getting CL_DEVICE_EXTENSIONS Platform Info string size ( ::clGetDeviceInfo() )" ); |
| 186 | |
| 187 | std::vector< char > szDeviceExt( deviceExtSize ); |
| 188 | OPENCL_V( ::clGetDeviceInfo( device, CL_DEVICE_EXTENSIONS, deviceExtSize, &szDeviceExt[ 0 ], NULL ), |
| 189 | "Getting CL_DEVICE_EXTENSIONS Platform Info string ( ::clGetDeviceInfo() )" ); |
| 190 | |
| 191 | std::string strDeviceExt = &szDeviceExt[ 0 ]; |
| 192 | |
| 193 | if( strDeviceExt.find( ext.c_str( ), 0 ) == std::string::npos ) |
| 194 | return CLFFT_DEVICE_NO_DOUBLE; |
| 195 | |
| 196 | |
| 197 | return CLFFT_SUCCESS; |
| 198 | } |
| 199 | |
| 200 | clfftStatus clfftCreateDefaultPlanInternal( clfftPlanHandle* plHandle, cl_context context, const clfftDim dim, |
| 201 | const size_t* clLengths ) |