This is an archive of the discontinued LLVM Phabricator instance.

NVPTX: Add supported CL features
ClosedPublic

Authored by jvesely on May 18 2016, 2:57 PM.

Details

Diff Detail

Repository
rL LLVM

Event Timeline

jvesely updated this revision to Diff 57683.May 18 2016, 2:57 PM
jvesely retitled this revision from to NVPTX: Add supported CL features.
jvesely updated this object.
jvesely added a reviewer: jholewinski.
jvesely set the repository for this revision to rL LLVM.
jvesely added subscribers: llvm-commits, yaxunl.
jvesely updated this revision to Diff 57693.May 18 2016, 3:43 PM
jvesely updated this object.

add test

I have a similar, but yours is more complete. I probably will drop my patch once yours goes through.

test/Misc/nvptx.languageOptsOpenCL.cl
2 ↗(On Diff #57693)

-Werror is unnecessary, same as below

6 ↗(On Diff #57693)

should be like

#pragma OPENCL EXTENSION cl_xxx : enable

same for below

jholewinski added inline comments.May 19 2016, 7:34 AM
lib/Basic/Targets.cpp
1849 ↗(On Diff #57693)

Do you really intend to enable subgroup support?

jvesely updated this revision to Diff 57830.May 19 2016, 11:36 AM

remove subgroups support.
better tests.

note: I had to add OPENCL_VERSION defines manually, these can be removed once clang correctly reports the version

jvesely marked 3 inline comments as done.May 19 2016, 11:36 AM

note: I had to add OPENCL_VERSION defines manually, these can be removed once clang correctly reports the version

clang correctly generates OPENCL_C_VERSION and OPENCL_VERSION_x_y macros. You can use them instead. For CL 1.1/1.2/2.0, you need to use -cl-std=CLx.y to specify OpenCL version.

jvesely updated this revision to Diff 57842.May 19 2016, 12:55 PM

even better tests
use existing OPENCL_C_VERSION
use -cl-std=CL for explicit OpenCL1.0

jvesely updated this revision to Diff 58849.May 27 2016, 3:35 PM
jvesely updated this object.
jvesely added a subscriber: cfe-commits.

Report only clinfo exported extensions.

Anastasia added inline comments.Jun 1 2016, 8:32 AM
test/Misc/nvptx.languageOptsOpenCL.cl
1 ↗(On Diff #58849)

Should we check for errors on unsupported extensions for this target too?

jvesely added inline comments.Jun 1 2016, 7:05 PM
test/Misc/nvptx.languageOptsOpenCL.cl
1 ↗(On Diff #58849)

I didn't want to do that. Including unsupported extensions in these tests would imply that every OCL extension needs test in 4 places (nvptx, amdgcn, r600, extension-version.cl), possibly more if more targets are added, which seemed excessive.

jvesely updated this revision to Diff 60226.Jun 9 2016, 1:01 PM

Test all known extensions against expected nvptx outcome (add negative tests)

jvesely marked 2 inline comments as done.Jun 9 2016, 1:02 PM
jvesely updated this revision to Diff 60257.Jun 9 2016, 3:19 PM

add back require registered target

ping

@jholewinski, is the exported list of features OK with you?

@Anastasia, are the tests OK now?

jholewinski accepted this revision.Jun 17 2016, 6:49 AM
jholewinski edited edge metadata.

Looks good to me

This revision is now accepted and ready to land.Jun 17 2016, 6:49 AM
This revision was automatically updated to reflect the committed changes.