Page MenuHomePhabricator

opencl-c.h: add 3.0 optional extension support for a few more bits
ClosedPublic

Authored by airlied on Jul 12 2021, 4:35 PM.

Details

Summary

These 3 are fairly simple, pipes, workgroups and subgroups.

Diff Detail

Unit TestsFailed

TimeTest
1,790 msx64 debian > Clang.Headers::opencl-builtins.cl
Script: -- : 'RUN: at line 1'; /var/lib/buildkite-agent/builds/llvm-project/build/bin/clang-tblgen -gen-clang-opencl-builtin-tests /var/lib/buildkite-agent/builds/llvm-project/clang/lib/Sema/OpenCLBuiltins.td -o /var/lib/buildkite-agent/builds/llvm-project/build/tools/clang/test/Headers/Output/opencl-builtins.cl.tmp.cl
33,560 msx64 debian > libFuzzer.libFuzzer::entropic-scale-per-exec-time.test
Script: -- : 'RUN: at line 2'; /var/lib/buildkite-agent/builds/llvm-project/build/./bin/clang --driver-mode=g++ -O2 -gline-tables-only -fsanitize=address,fuzzer -I/var/lib/buildkite-agent/builds/llvm-project/compiler-rt/lib/fuzzer -m64 /var/lib/buildkite-agent/builds/llvm-project/compiler-rt/test/fuzzer/EntropicScalePerExecTimeTest.cpp -o /var/lib/buildkite-agent/builds/llvm-project/build/projects/compiler-rt/test/fuzzer/X86_64DefaultLinuxConfig/Output/entropic-scale-per-exec-time.test.tmp-EntropicScalePerExecTimeTest
2,440 msx64 debian > libarcher.critical::critical.c
Script: -- : 'RUN: at line 15'; /var/lib/buildkite-agent/builds/llvm-project/build/./bin/clang -fopenmp -pthread -fno-experimental-isel -g -O1 -fsanitize=thread -I /var/lib/buildkite-agent/builds/llvm-project/openmp/tools/archer/tests -I /var/lib/buildkite-agent/builds/llvm-project/build/projects/openmp/runtime/src -L /var/lib/buildkite-agent/builds/llvm-project/build/lib -Wl,-rpath,/var/lib/buildkite-agent/builds/llvm-project/build/lib /var/lib/buildkite-agent/builds/llvm-project/openmp/tools/archer/tests/critical/critical.c -o /var/lib/buildkite-agent/builds/llvm-project/build/projects/openmp/tools/archer/tests/critical/Output/critical.c.tmp -latomic && env TSAN_OPTIONS='ignore_noninstrumented_modules=0:ignore_noninstrumented_modules=1' /var/lib/buildkite-agent/builds/llvm-project/build/projects/openmp/tools/archer/tests/critical/Output/critical.c.tmp 2>&1 | tee /var/lib/buildkite-agent/builds/llvm-project/build/projects/openmp/tools/archer/tests/critical/Output/critical.c.tmp.log | /var/lib/buildkite-agent/builds/llvm-project/build/./bin/FileCheck /var/lib/buildkite-agent/builds/llvm-project/openmp/tools/archer/tests/critical/critical.c
2,700 msx64 debian > libarcher.critical::lock.c
Script: -- : 'RUN: at line 15'; /var/lib/buildkite-agent/builds/llvm-project/build/./bin/clang -fopenmp -pthread -fno-experimental-isel -g -O1 -fsanitize=thread -I /var/lib/buildkite-agent/builds/llvm-project/openmp/tools/archer/tests -I /var/lib/buildkite-agent/builds/llvm-project/build/projects/openmp/runtime/src -L /var/lib/buildkite-agent/builds/llvm-project/build/lib -Wl,-rpath,/var/lib/buildkite-agent/builds/llvm-project/build/lib /var/lib/buildkite-agent/builds/llvm-project/openmp/tools/archer/tests/critical/lock.c -o /var/lib/buildkite-agent/builds/llvm-project/build/projects/openmp/tools/archer/tests/critical/Output/lock.c.tmp -latomic && env TSAN_OPTIONS='ignore_noninstrumented_modules=0:ignore_noninstrumented_modules=1' /var/lib/buildkite-agent/builds/llvm-project/build/projects/openmp/tools/archer/tests/critical/Output/lock.c.tmp 2>&1 | tee /var/lib/buildkite-agent/builds/llvm-project/build/projects/openmp/tools/archer/tests/critical/Output/lock.c.tmp.log | /var/lib/buildkite-agent/builds/llvm-project/build/./bin/FileCheck /var/lib/buildkite-agent/builds/llvm-project/openmp/tools/archer/tests/critical/lock.c
2,820 msx64 debian > libarcher.parallel::parallel-firstprivate.c
Script: -- : 'RUN: at line 15'; /var/lib/buildkite-agent/builds/llvm-project/build/./bin/clang -fopenmp -pthread -fno-experimental-isel -g -O1 -fsanitize=thread -I /var/lib/buildkite-agent/builds/llvm-project/openmp/tools/archer/tests -I /var/lib/buildkite-agent/builds/llvm-project/build/projects/openmp/runtime/src -L /var/lib/buildkite-agent/builds/llvm-project/build/lib -Wl,-rpath,/var/lib/buildkite-agent/builds/llvm-project/build/lib /var/lib/buildkite-agent/builds/llvm-project/openmp/tools/archer/tests/parallel/parallel-firstprivate.c -o /var/lib/buildkite-agent/builds/llvm-project/build/projects/openmp/tools/archer/tests/parallel/Output/parallel-firstprivate.c.tmp -latomic && env TSAN_OPTIONS='ignore_noninstrumented_modules=0:ignore_noninstrumented_modules=1' /var/lib/buildkite-agent/builds/llvm-project/build/projects/openmp/tools/archer/tests/parallel/Output/parallel-firstprivate.c.tmp 2>&1 | tee /var/lib/buildkite-agent/builds/llvm-project/build/projects/openmp/tools/archer/tests/parallel/Output/parallel-firstprivate.c.tmp.log | /var/lib/buildkite-agent/builds/llvm-project/build/./bin/FileCheck /var/lib/buildkite-agent/builds/llvm-project/openmp/tools/archer/tests/parallel/parallel-firstprivate.c
View Full Test Results (25 Failed)

Event Timeline

airlied created this revision.Jul 12 2021, 4:35 PM
airlied requested review of this revision.Jul 12 2021, 4:35 PM
Anastasia added inline comments.
clang/lib/Headers/opencl-c-base.h
329

We had a discussion with @azabaznov around features that are aliasing each other and we have discussed to use one feature macro for those. Clang should already ensure that both are set/unset simultaneously? And for those that are not set in clang we can set them correctly here in the header directly.

clang/lib/Headers/opencl-c.h
15290

I think that here guarding the OpenCL version is correct?

azabaznov added inline comments.Jul 13 2021, 9:13 AM
clang/lib/Headers/opencl-c-base.h
329

Yeah, I we did. Note that this is applicable to fp64 and 3d image writes, while __openc_c_subgroups and cl_khr_subgroups are not equivalent as extension requires subgroup-independent forward progress but subgroup-independent forward progress is optional in OpenCL C 3.0. I'll try submit a patch for 3d image writes feature macro support this week.

airlied updated this revision to Diff 359114.Jul 15 2021, 1:39 PM

fixed up missing cl_khr_subgroups checks.

airlied updated this revision to Diff 359166.Jul 15 2021, 4:41 PM

leave version checks alone since they are inside the outer extension check.

airlied marked an inline comment as done.Jul 15 2021, 4:42 PM

yeah I agree I'll drop those two changes.

Anastasia added inline comments.Jul 19 2021, 3:03 PM
clang/lib/Headers/opencl-c-base.h
329

Ok, I see so while the functions are identical they are not entirely equivalent extensions so vendors might support one but not the other? In this case I think we should keep checking both but it would be good to add a comment explaining why we are checking both macros here.

Btw do you happen to have spec reference? I can't find anything relevant.

airlied updated this revision to Diff 364372.Aug 5 2021, 12:31 AM

Added a comment on the subgroups difference.

Anastasia accepted this revision.Aug 6 2021, 10:24 AM

LGTM! Thanks

This revision is now accepted and ready to land.Aug 6 2021, 10:24 AM
This revision was landed with ongoing or failed builds.Aug 6 2021, 4:25 PM
This revision was automatically updated to reflect the committed changes.