[all-commits] [llvm/llvm-project] e880e8: Let clang-cl support CUDA/HIP (#68921)

Yaxun (Sam) Liu via All-commits all-commits at lists.llvm.org
Thu Oct 19 08:57:10 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: e880e8aedbc17ba04c969c9426d1f2567af72e7b
      https://github.com/llvm/llvm-project/commit/e880e8aedbc17ba04c969c9426d1f2567af72e7b
  Author: Yaxun (Sam) Liu <yaxun.liu at amd.com>
  Date:   2023-10-19 (Thu, 19 Oct 2023)

  Changed paths:
    M clang/include/clang/Driver/Options.td
    M clang/lib/Driver/Driver.cpp
    A clang/test/Driver/cl-offload.cu

  Log Message:
  -----------
  Let clang-cl support CUDA/HIP (#68921)

clang-cl is a driver mode that accepts options of MSVC cl.exe as a
drop-in replacement for cl.exe. Currently clang-cl accepts mixed clang
style options and cl style options. To let clang-cl accept a clang-style
option, just need to add visibility CLOption to that option.

Currently nvcc can pass cl style options to cl.exe, which allows nvcc to
compile C++ and CUDA programs with mixed nvcc and cl style options. On
the other hand, clang cannot use mixed clang and cl style options to
compile CUDA/HIP programs.

This patch add visibility CLOption to options needed to compile CUDA/HIP
programs. This allows clang-cl to compile CUDA/HIP programs with mixed
clang and cl style options.




More information about the All-commits mailing list