Bug 90308

Summary: cl_khr_fp64 assumed by default in OpenCL 1.2
Product: Beignet Reporter: ilia <inferrna>
Component: BeignetAssignee: Zhigang Gong <zhigang.gong>
Severity: normal    
Priority: medium CC: inferrna
Version: unspecified   
Hardware: Other   
OS: All   
i915 platform: i915 features:

Description ilia 2015-05-05 03:28:07 UTC
While clinfo shows
  Platform Name                                   Intel Gen OCL Driver
  Platform Vendor                                 Intel
  Platform Version                                OpenCL 1.2 beignet 1.1 (git-83f8739)
  Platform Profile                                FULL_PROFILE
  Platform Extensions                             cl_khr_global_int32_base_atomics cl_khr_global_int32_extended_atomics cl_khr_local_int32_base_atomics cl_khr_local_int32_extended_atomics cl_khr_byte_addressable_store cl_khr_spir cl_khr_icd
  Platform Extensions function suffix             Intel

It won't to compile an kernel with naive double usage.
/tmp/mw7NyE.cl:12:69: error: use of type 'double' requires cl_khr_fp64 extension to be enabled

Same time khronos.org doesn't shows cl_khr_fp64 extension available for OpenCL 1.2 platform - seems like it assumes to be enabled by default.

It's not a problem for me to enable it, by I have to use pyopencl that generates kernels on fly with this define
#if __OPENCL_C_VERSION__ < 120                        
#pragma OPENCL EXTENSION cl_khr_fp64: enable
Comment 1 Rebecca Palmer 2015-05-16 20:49:28 UTC
This is not a bug; OpenCL 1.2 made double precision an *optional* core feature, which beignet doesn't support because until Broadwell the hardware didn't: http://lists.freedesktop.org/archives/beignet/2015-March/005311.html

(Optional core features are automatically enabled when available, while extensions require an explicit #pragma, hence that pyopencl #ifdef.)

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.