This is an archive of the discontinued LLVM Phabricator instance.

Fix OpenCL 1.2 double as an optional core feature behaviour
ClosedPublic

Authored by sheredom on Jan 29 2015, 2:39 AM.

Details

Summary

In OpenCL 1.2, using double no longer requires using the pragma cl_khr_fp64, instead a kernel is allowed to use double, but must first have queried clGetDeviceInfo's CL_DEVICE_DOUBLE_FP_CONFIG.

Page 197, section 6.1.1 of the OpenCL 1.2 specification has a footnote 23 describing this behaviour.

I've also added test cases such that the pragma must be used if targeting OpenCL 1.0 or 1.1, but is ignored in 1.2 and 2.0.

Diff Detail

Repository
rL LLVM

Event Timeline

sheredom updated this revision to Diff 18944.Jan 29 2015, 2:39 AM
sheredom retitled this revision from to Fix OpenCL 1.2 double as an optional core feature behaviour.
sheredom updated this object.
sheredom edited the test plan for this revision. (Show Details)
sheredom added a reviewer: rsmith.
sheredom edited the test plan for this revision. (Show Details)
sheredom added a subscriber: Unknown Object (MLST).

Are those if conditions that span to the next line indented correctly?

Apart from this nitpick, LGTM.

sheredom updated this revision to Diff 18953.Jan 29 2015, 4:58 AM

Ran clang-format on the file, and there was a TON of line changes out-with the patch. Extracted the formatted lines from my original patch only, and updated the patch.

This revision is now accepted and ready to land.Jan 29 2015, 9:43 AM
This revision was automatically updated to reflect the committed changes.