Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compiler setup blocks usage of CLANG for CUDA #182

Open
PhilipDeegan opened this issue Sep 8, 2021 · 1 comment
Open

Compiler setup blocks usage of CLANG for CUDA #182

PhilipDeegan opened this issue Sep 8, 2021 · 1 comment

Comments

@PhilipDeegan
Copy link
Contributor

PhilipDeegan commented Sep 8, 2021

set(CMAKE_CUDA_FLAGS "${CMAKE_CUDA_FLAGS} -arch ${CUDA_ARCH} --expt-extended-lambda --expt-relaxed-constexpr")

my cmake config is here

@PhilipDeegan
Copy link
Contributor Author

PhilipDeegan commented Oct 29, 2021

would a compiler detection PR be considered here?

if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "PGI")

    # Set specific options for CUDA if enabled
    if (ENABLE_RAJA AND ENABLE_CUDA)
      # RAJA requires some experimental features
      set(CMAKE_CUDA_FLAGS "${CMAKE_CUDA_FLAGS} -arch ${CUDA_ARCH} --expt-extended-lambda --expt-relaxed-constexpr")
    endif ()
    
    # TODO Ensure openmp flags are not enabled twice!
    if (ENABLE_OPENMP AND ENABLE_CUDA)
      # CMAKE_CUDA_FLAGS does not pass OpenMP_CXX_FLAGS to the host compiler by default
      set(CMAKE_CUDA_FLAGS "${CMAKE_CUDA_FLAGS} -Xcompiler ${OpenMP_CXX_FLAGS}")
    endif ()

endif() 

I've commented out both calls to "set" locally and it all still compiles with -DCMAKE_CUDA_FLAGS="-x cuda"

or perhaps here it should detect clang and add "-x cuda"?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant