Skip to content

Commit 1ed3298

Browse files
committed
Fix simd_test rename and arch detect on gcc
1 parent db38a3a commit 1ed3298

File tree

3 files changed

+13
-9
lines changed

3 files changed

+13
-9
lines changed

cmake/ArchDetect.cmake

+2-5
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,12 @@ function(target_architecture output_arch output_arch_ver)
1212
# #error preprocessor directives... but by exploiting the preprocessor in this
1313
# way, we can detect the correct target architecture even when cross-compiling,
1414
# since the program itself never needs to be run (only the compiler/preprocessor)
15-
try_run(
16-
run_result_unused
15+
try_compile(
1716
compile_result_unused
1817
"${CMAKE_BINARY_DIR}"
1918
"${FastSIMD_SOURCE_DIR}/cmake/ArchDetect.cpp"
20-
COMPILE_OUTPUT_VARIABLE COMPILE_OUTPUT
21-
CMAKE_FLAGS CMAKE_OSX_ARCHITECTURES=${CMAKE_OSX_ARCHITECTURES}
19+
OUTPUT_VARIABLE COMPILE_OUTPUT
2220
)
23-
2421
#message(STATUS ${COMPILE_OUTPUT})
2522

2623
# Parse the architecture name from the compiler output

cmake/ArchDetect.cpp

+8-1
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,15 @@
33
#define TO_LITERAL_( string ) #string
44
#define TO_LITERAL( string ) TO_LITERAL_( string )
55

6-
#if !defined( TEST_FEATURE_SET_ACTIVE ) || FASTSIMD_FEATURE_VALUE( TEST_FEATURE_SET_ACTIVE ) > 0
6+
#if !defined( TEST_FEATURE_SET_ACTIVE )
7+
#define FASTSIMD_DETECT_SUCCESS
8+
#else
9+
#if FASTSIMD_FEATURE_VALUE( TEST_FEATURE_SET_ACTIVE ) > 0
10+
#define FASTSIMD_DETECT_SUCCESS
11+
#endif
12+
#endif
713

14+
#ifdef FASTSIMD_DETECT_SUCCESS
815
static_assert( 0, "FASTSIMD_ARCH<" TO_LITERAL( FASTSIMD_ARCH_NAME() ) ">" );
916

1017
// Needed for MacOS clang, it doesn't evaluate macros in static assert errors

tests/test.cpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -67,11 +67,11 @@ struct TestRunner
6767
};
6868

6969
template<FastSIMD::FeatureSet HEAD, FastSIMD::FeatureSet... TAIL>
70-
struct TestOrganiser<FastSIMD::FeatureSetList<HEAD, TAIL...>>
70+
struct TestOrganiser<FastSIMD::FeatureSetList<0, HEAD, TAIL...>>
7171
{
7272
static TestCollection GetCollections()
7373
{
74-
TestCollection collections = TestOrganiser<FastSIMD::FeatureSetList<TAIL...>>::GetCollections();
74+
TestCollection collections = TestOrganiser<FastSIMD::FeatureSetList<0, TAIL...>>::GetCollections();
7575

7676
if( HEAD <= FastSIMD::DetectCpuMaxFeatureSet() )
7777
{
@@ -280,7 +280,7 @@ struct TestRunner
280280
{
281281
std::cout << "Starting Tests - Register Size: " << RegisterBytes * 8 << " (" << RegisterBytes << "b)" << std::endl;
282282

283-
TestSet testSet = TestOrganiser<FastSIMD::test_simd::CompiledFeatureSets>::GetSet();
283+
TestSet testSet = TestOrganiser<FastSIMD::simd_test::CompiledFeatureSets>::GetSet();
284284

285285
for( auto& test : testSet )
286286
{

0 commit comments

Comments
 (0)