icicle icon indicating copy to clipboard operation
icicle copied to clipboard

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

Open jeremyfelder opened this issue 1 year ago • 0 comments

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 avatar Aug 27 '23 10:08 jeremyfelder