Coverage Report

Created: 2026-03-30 09:00

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/src/gdal/port/cpl_cpu_features.h
Line
Count
Source
1
/******************************************************************************
2
 *
3
 * Project:  CPL - Common Portability Library
4
 * Purpose:  Prototypes, and definitions for of CPU features detection
5
 * Author:   Even Rouault, <even dot rouault at spatialys dot com>
6
 *
7
 ******************************************************************************
8
 * Copyright (c) 2016, Even Rouault <even dot rouault at spatialys dot com>
9
 *
10
 * SPDX-License-Identifier: MIT
11
 ****************************************************************************/
12
13
#ifndef CPL_CPU_FEATURES_H
14
#define CPL_CPU_FEATURES_H
15
16
#include "cpl_port.h"
17
#include "cpl_string.h"
18
19
//! @cond Doxygen_Suppress
20
21
#ifdef HAVE_SSE_AT_COMPILE_TIME
22
#if (defined(_M_X64) || defined(__x86_64))
23
#define HAVE_INLINE_SSE
24
25
static bool inline CPLHaveRuntimeSSE()
26
0
{
27
0
    return true;
28
0
}
Unexecuted instantiation: gdaldataset.cpp:CPLHaveRuntimeSSE()
Unexecuted instantiation: rasterio.cpp:CPLHaveRuntimeSSE()
Unexecuted instantiation: cpl_cpu_features.cpp:CPLHaveRuntimeSSE()
Unexecuted instantiation: gdalgrid.cpp:CPLHaveRuntimeSSE()
29
#else
30
bool CPLHaveRuntimeSSE();
31
#endif
32
#endif
33
34
#ifdef USE_NEON_OPTIMIZATIONS
35
static bool inline CPLHaveRuntimeSSSE3()
36
{
37
    return true;
38
}
39
#elif defined(HAVE_SSSE3_AT_COMPILE_TIME)
40
#if __SSSE3__
41
#define HAVE_INLINE_SSSE3
42
43
static bool inline CPLHaveRuntimeSSSE3()
44
{
45
#ifdef DEBUG
46
    if (!CPLTestBool(CPLGetConfigOption("GDAL_USE_SSSE3", "YES")))
47
        return false;
48
#endif
49
    return true;
50
}
51
#else
52
#if defined(__GNUC__) && !defined(DEBUG)
53
extern bool bCPLHasSSSE3;
54
55
static bool inline CPLHaveRuntimeSSSE3()
56
168k
{
57
168k
    return bCPLHasSSSE3;
58
168k
}
Unexecuted instantiation: gdaldataset.cpp:CPLHaveRuntimeSSSE3()
rasterio.cpp:CPLHaveRuntimeSSSE3()
Line
Count
Source
56
168k
{
57
168k
    return bCPLHasSSSE3;
58
168k
}
Unexecuted instantiation: cpl_cpu_features.cpp:CPLHaveRuntimeSSSE3()
Unexecuted instantiation: gdalgrid.cpp:CPLHaveRuntimeSSSE3()
59
#else
60
bool CPLHaveRuntimeSSSE3();
61
#endif
62
#endif
63
#endif
64
65
#ifdef HAVE_AVX_AT_COMPILE_TIME
66
#if __AVX__
67
#define HAVE_INLINE_AVX
68
69
static bool inline CPLHaveRuntimeAVX()
70
{
71
    return true;
72
}
73
#elif defined(__GNUC__)
74
extern bool bCPLHasAVX;
75
76
static bool inline CPLHaveRuntimeAVX()
77
90
{
78
90
    return bCPLHasAVX;
79
90
}
Unexecuted instantiation: gdaldataset.cpp:CPLHaveRuntimeAVX()
Unexecuted instantiation: rasterio.cpp:CPLHaveRuntimeAVX()
cpl_cpu_features.cpp:CPLHaveRuntimeAVX()
Line
Count
Source
77
90
{
78
90
    return bCPLHasAVX;
79
90
}
Unexecuted instantiation: gdalgrid.cpp:CPLHaveRuntimeAVX()
80
#else
81
bool CPLHaveRuntimeAVX();
82
#endif
83
#endif
84
85
#ifdef HAVE_AVX2_AT_COMPILE_TIME
86
#if __AVX2__
87
#define HAVE_INLINE_AVX2
88
89
static bool inline CPLHaveRuntimeAVX2()
90
{
91
    return true;
92
}
93
#elif defined(__GNUC__)
94
extern bool bCPLHasAVX2;
95
96
static bool inline CPLHaveRuntimeAVX2()
97
121k
{
98
121k
    return bCPLHasAVX2;
99
121k
}
Unexecuted instantiation: gdaldataset.cpp:CPLHaveRuntimeAVX2()
rasterio.cpp:CPLHaveRuntimeAVX2()
Line
Count
Source
97
121k
{
98
121k
    return bCPLHasAVX2;
99
121k
}
Unexecuted instantiation: cpl_cpu_features.cpp:CPLHaveRuntimeAVX2()
100
#else
101
bool CPLHaveRuntimeAVX2();
102
#endif
103
104
#endif
105
106
//! @endcond
107
108
#endif  // CPL_CPU_FEATURES_H