|
28 | 28 | # |
29 | 29 | # * Find MKL implementation via FFTW_ENABLE_MKL |
30 | 30 | # |
31 | | -# * If FFTW_ENABLE_MKL is explicitely set to ON, only MKL is considered |
32 | | -# * If FFTW_ENABLE_MKL is explictely set to OFF, MKL will not be considered |
33 | | -# * If FFTW_ENABLE_MKL is undefined, MKL is preferred unless ENABLE_MKL is explicitely set to OFF |
| 31 | +# * If FFTW_ENABLE_MKL is explicitly set to ON, only MKL is considered |
| 32 | +# * If FFTW_ENABLE_MKL is explicitly set to OFF, MKL will not be considered |
| 33 | +# * If FFTW_ENABLE_MKL is undefined, MKL is preferred unless ENABLE_MKL is explicitly set to OFF |
34 | 34 | # * Note: MKLROOT environment variable helps to detect MKL (See FindMKL.cmake) |
35 | 35 | # |
36 | | -# * Find official FFTW impelementation |
| 36 | +# * Find ARMPL or NVPL implementations, via FFTW_ENABLE_ARMPL or FFTW_ENABLE_NVPL, with behaviour as for MKL |
| 37 | +# |
| 38 | +# * Find official FFTW implementation |
37 | 39 | # |
38 | 40 | # * FFTW_ROOT variable / environment variable helps to detect FFTW |
39 | 41 | # |
|
72 | 74 | # :FFTW_LIBRARIES: User overriden FFTW libraries |
73 | 75 | # :FFTW_INCLUDE_DIRS: User overriden FFTW includes directories |
74 | 76 | # :FFTW_ENABLE_MKL: User requests use of MKL implementation |
| 77 | +# :FFTW_ENABLE_ARMPL: User requests use of ARMPL implementation |
| 78 | +# :FFTW_ENABLE_NVPL: User requests use of NVPL implementation |
75 | 79 | # |
76 | 80 | ############################################################################## |
77 | 81 |
|
@@ -150,6 +154,96 @@ if( NOT FFTW_FOUND_ALL_COMPONENTS ) |
150 | 154 | endif() |
151 | 155 | endif() |
152 | 156 |
|
| 157 | +### Check ARMPL |
| 158 | +FFTW_CHECK_ALL_COMPONENTS() |
| 159 | +if( NOT FFTW_FOUND_ALL_COMPONENTS ) |
| 160 | + |
| 161 | + if( NOT DEFINED FFTW_ENABLE_ARMPL AND NOT DEFINED ENABLE_ARMPL ) |
| 162 | + set( FFTW_ENABLE_ARMPL ON ) |
| 163 | + set( FFTW_FindARMPL_OPTIONS QUIET ) |
| 164 | + elseif( FFTW_ENABLE_ARMPL ) |
| 165 | + set( FFTW_ARMPL_REQUIRED TRUE ) |
| 166 | + elseif( ENABLE_ARMPL AND NOT DEFINED FFTW_ENABLE_ARMPL ) |
| 167 | + set( FFTW_ENABLE_ARMPL ON ) |
| 168 | + endif() |
| 169 | + |
| 170 | + if( FFTW_ENABLE_ARMPL ) |
| 171 | + if( NOT ARMPL_FOUND ) |
| 172 | + find_package( ARMPL ${FFTW_FindARMPL_OPTIONS} ) |
| 173 | + endif() |
| 174 | + if( ARMPL_FOUND ) |
| 175 | + if( NOT FFTW_INCLUDE_DIRS ) |
| 176 | + set( FFTW_INCLUDE_DIRS ${ARMPL_INCLUDE_DIRS} ) |
| 177 | + endif() |
| 178 | + if( NOT FFTW_LIBRARIES ) |
| 179 | + set( FFTW_LIBRARIES ${ARMPL_LIBRARIES} ) |
| 180 | + endif() |
| 181 | + |
| 182 | + foreach( _component ${FFTW_FIND_COMPONENTS} ) |
| 183 | + set( FFTW_${_component}_FOUND TRUE ) |
| 184 | + set( FFTW_${_component}_LIBRARIES ${ARMPL_LIBRARIES} ) |
| 185 | + endforeach() |
| 186 | + else() |
| 187 | + if( FFTW_ARMPL_REQUIRED ) |
| 188 | + if( FFTW_FIND_REQUIRED ) |
| 189 | + message(CRITICAL "FindFFTW: ARMPL required, but was not found" ) |
| 190 | + else() |
| 191 | + if( NOT FFTW_ARMPL_FIND_QUIETLY ) |
| 192 | + message(STATUS "FindFFTW: ARMPL required, but was not found" ) |
| 193 | + endif() |
| 194 | + set( FFTW_FOUND FALSE ) |
| 195 | + return() |
| 196 | + endif() |
| 197 | + endif() |
| 198 | + endif() |
| 199 | + endif() |
| 200 | +endif() |
| 201 | + |
| 202 | +### Check NVPL |
| 203 | +FFTW_CHECK_ALL_COMPONENTS() |
| 204 | +if( NOT FFTW_FOUND_ALL_COMPONENTS ) |
| 205 | + |
| 206 | + if( NOT DEFINED FFTW_ENABLE_NVPL AND NOT DEFINED ENABLE_NVPL ) |
| 207 | + set( FFTW_ENABLE_NVPL ON ) |
| 208 | + set( FFTW_FindNVPL_OPTIONS QUIET ) |
| 209 | + elseif( FFTW_ENABLE_NVPL ) |
| 210 | + set( FFTW_NVPL_REQUIRED TRUE ) |
| 211 | + elseif( ENABLE_NVPL AND NOT DEFINED FFTW_ENABLE_NVPL ) |
| 212 | + set( FFTW_ENABLE_NVPL ON ) |
| 213 | + endif() |
| 214 | + |
| 215 | + if( FFTW_ENABLE_NVPL ) |
| 216 | + if( NOT NVPL_FOUND ) |
| 217 | + find_package( NVPL ${FFTW_FindNVPL_OPTIONS} ) |
| 218 | + endif() |
| 219 | + if( NVPL_FOUND ) |
| 220 | + if( NOT FFTW_INCLUDE_DIRS ) |
| 221 | + set( FFTW_INCLUDE_DIRS ${NVPL_INCLUDE_DIRS} ) |
| 222 | + endif() |
| 223 | + if( NOT FFTW_LIBRARIES ) |
| 224 | + set( FFTW_LIBRARIES ${NVPL_LIBRARIES} ) |
| 225 | + endif() |
| 226 | + |
| 227 | + foreach( _component ${FFTW_FIND_COMPONENTS} ) |
| 228 | + set( FFTW_${_component}_FOUND TRUE ) |
| 229 | + set( FFTW_${_component}_LIBRARIES ${NVPL_LIBRARIES} ) |
| 230 | + endforeach() |
| 231 | + else() |
| 232 | + if( FFTW_NVPL_REQUIRED ) |
| 233 | + if( FFTW_FIND_REQUIRED ) |
| 234 | + message(CRITICAL "FindFFTW: NVPL required, but NVPL was not found" ) |
| 235 | + else() |
| 236 | + if( NOT FFTW_NVPL_FIND_QUIETLY ) |
| 237 | + message(STATUS "FindFFTW: NVPL required, but NVPL was not found" ) |
| 238 | + endif() |
| 239 | + set( FFTW_FOUND FALSE ) |
| 240 | + return() |
| 241 | + endif() |
| 242 | + endif() |
| 243 | + endif() |
| 244 | + endif() |
| 245 | +endif() |
| 246 | + |
153 | 247 | ### Standard FFTW |
154 | 248 | if( (NOT FFTW_ROOT) AND EXISTS $ENV{FFTW_ROOT} ) |
155 | 249 | set( FFTW_ROOT $ENV{FFTW_ROOT} ) |
|
0 commit comments