Added basic support for device/isa context selector.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
Thanks for working on this! One nit and one concern below.
clang/include/clang/Sema/Sema.h | ||
---|---|---|
9322 | I would like to avoid the Any type here and I hope we can if we don't allow "strings". See also my last comment. | |
clang/lib/CodeGen/CGOpenMPRuntime.cpp | ||
11147 | should we normalize the names here? at least .lower might be useful. | |
clang/test/OpenMP/nvptx_declare_variant_device_isa_codegen.cpp | ||
49 | I'm not sure we want these to be strings. I would have assumed isa(nvptx64), similar to vendor(arm), or kind(host) and kind(gpu) |
clang/test/OpenMP/nvptx_declare_variant_device_isa_codegen.cpp | ||
---|---|---|
49 | Here is the message from Joachim Protze: vendor and kind are special, because we define the kind-name and vendor-name in the context definition side document. (We could change that to "kind-name" or define kind-name as any of "cpu", "gpu", "fpga" ???) For the others, according to the syntax diagram in the OpenMP Context section, the content of the () can only be string or const-int-exp. - Joachim That's why we need to represent them as strings, this is per OpenMP standard. |
Build result: pass - 60340 tests passed, 0 failed and 732 were skipped.
Log files: console-log.txt, CMakeCache.txt
clang/include/clang/Sema/Sema.h | ||
---|---|---|
9322 | Should we define a struct to be used as variant here maybe? If we only have <5 different types we might not want to go to Any or Expr directly. | |
clang/test/OpenMP/nvptx_declare_variant_device_isa_codegen.cpp | ||
49 | While you say it, I wanted to mention that we moved the discussion on the openmp-lang list. |
clang/include/clang/Sema/Sema.h | ||
---|---|---|
9322 | What is the difference between using Any and a struct? |
clang/include/clang/Sema/Sema.h | ||
---|---|---|
9322 | Any is generic (anything). |
clang/include/clang/Sema/Sema.h | ||
---|---|---|
9322 | It is not quite so. Anyway, I'm going to switch to Expr* since it is the only possible way to represent traits as identifiers/string literals. |
I would like to avoid the Any type here and I hope we can if we don't allow "strings". See also my last comment.