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

[FEAT]: Allow overriding compiler's chosen GPU arch via cmake #167

Closed
jeremyfelder opened this issue Aug 27, 2023 · 0 comments · Fixed by #518
Closed

[FEAT]: Allow overriding compiler's chosen GPU arch via cmake #167

jeremyfelder opened this issue Aug 27, 2023 · 0 comments · Fixed by #518

Comments

@jeremyfelder
Copy link
Collaborator

jeremyfelder commented Aug 27, 2023

Description

There should be a flexible way to provide/override the compiler's chosen arch. Maybe the following would be best for that:

if(DEFINED CUDA_ARCH) // user defined arch takes priority
    set(CMAKE_CUDA_ARCHITECTURES ${CUDA_ARCH})
elseif(${CMAKE_VERSION} VERSION_GREATER_EQUAL "3.24.0") // otherwise, use native to detect GPU arch
    set(CMAKE_CUDA_ARCHITECTURES native)
endif() // otherwise fallback to compiler's chosen arch

See #159 and #163 for additional details

Motivation

We should have a flexible way to provide/override the compiler's chosen arch.

jeremyfelder added a commit that referenced this issue May 19, 2024
## Describe the changes

This PR modifies icicle/cmake/Common.cmake to set
CMAKE_CUDA_ARCHITECTURES to ${CUDA_ARCH} if the user defines the arch,
to set CMAKE_CUDA_ARCHITECTURES to native if the cmake version is
greater than or equal to 3.24.0. This change has been successfully
tested with cmake 3.22.0 and 3.25.2.

## Linked Issues

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

Successfully merging a pull request may close this issue.

2 participants