我已经创建了一些基准程序来测试OpenCL的一些特性。这已经在几个平台上运行:核心i7-920 / nvidia 1060和双Xeon-2660 / Radeon 480.这一切都运行良好。当我在表面3 pro上运行时,我得到以下输出:
Platform Intel(R) OpenCL contains 2 devices
Device does not support double precision, skipped: CLDevice [id: 3642688 name: Intel(R) HD Graphics 5000 type: GPU profile: FULL_PROFILE]
CLDevice [id: 3632160 name: Intel(R) Core(TM) i7-4650U CPU @ 1.70GHz type: CPU profile: FULL_PROFILE]
Platform: plIntel, processor: ptIntel, double fp: true, AMD fp: false
Devices used:
CLDevice [id: 3632160 name: Intel(R) Core(TM) i7-4650U CPU @ 1.70GHz type: CPU profile: FULL_PROFILE]
Running benchmark for 1 devices.
Benchmarking Intel(R) Core(TM) i7: 0 1 2 3 4 4409 ms
Queue pool, tasks per queue = 16: 0 Exception in thread "main" com.jogamp.opencl.CLException$CLBuildProgramFailureException:
CLDevice [id: 3642688 name: Intel(R) HD Graphics 5000 type: GPU profile: FULL_PROFILE] build log:
:2:40: error: use of type 'double' requires cl_khr_fp64 extension to be enabled
:3:40: error: use of type 'double' requires cl_khr_fp64 extension to be enabled
:4:34: error: use of type 'double' requires cl_khr_fp64 extension to be enabled
:22:40: error: use of type 'double' requires cl_khr_fp64 extension to be enabled
:23:40: error: use of type 'double' requires cl_khr_fp64 extension to be enabled
:24:34: error: use of type 'double' requires cl_khr_fp64 extension to be enabled
:42:40: error: use of type 'double' requires cl_khr_fp64 extension to be enabled
:43:40: error: use of type 'double' requires cl_khr_fp64 extension to be enabled
:44:34: error: use of type 'double' requires cl_khr_fp64 extension to be enabled
:63:40: error: use of type 'double' requires cl_khr_fp64 extension to be enabled
:64:40: error: use of type 'double' requires cl_khr_fp64 extension to be enabled
:65:34: error: use of type 'double' requires cl_khr_fp64 extension to be enabled
error: front end compiler failed build. [error: CL_BUILD_PROGRAM_FAILURE]
at com.jogamp.opencl.CLException.newException(CLException.java:84)
您可以看到图形和处理器都被识别,但图形不支持双精度,软件会跳过它。但是处理器应该支持双精度。但是不编译。表面3 pro是否有特定的东西不能运行?它运行在Java和jocl上。
修改
该软件构建设备列表,仅选择具有cl_khr_fp64属性的设备。 Surface 3 pro(i7-4950U)的CPU确实具有此属性。在.CL代码中,第一行是:#pragma OPENCL EXTENSION cl_khr_fp64 : enable
。