Set CPU features automatically #1954
-
|
I'm using jolt on different linux machines and I noticed a crash (illegal instruction) when running on one machine but not the other. Looking at the available features with # Select X86 processor features to use (if everything is off it will be SSE2 compatible)
option(USE_SSE4_1 "Enable SSE4.1" OFF)
option(USE_SSE4_2 "Enable SSE4.2" OFF)
option(USE_AVX "Enable AVX" OFF)
...
if (SSE4_1 available)
set(USE_SSE4_1 ON)
endif()
...This would automatically disable unsupported features and only enable the supported ones. It would work on both machines without manual configuration. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
|
Auto detecting the features of the current CPU is only helpful if you are compiling the library for you. Normally you write a program so that other people can run it. You don't know what hardware they have, so you have to make a choice what the minimum should be. Therefore it doesn't make a lot of sense to auto detect the configuration in cmake. |
Beta Was this translation helpful? Give feedback.
Auto detecting the features of the current CPU is only helpful if you are compiling the library for you. Normally you write a program so that other people can run it. You don't know what hardware they have, so you have to make a choice what the minimum should be. Therefore it doesn't make a lot of sense to auto detect the configuration in cmake.