Skip to content

Commit eac5d3e

Browse files
Adds __attribute__((const)) to LAPACKE_lsame. This change allows for optimizations on GCC. This solution was proposed by @martin-frbg
1 parent 2a39774 commit eac5d3e

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

LAPACKE/include/lapacke_utils.h

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,11 @@ extern "C" {
6666
void LAPACKE_xerbla( const char *name, lapack_int info );
6767

6868
/* Compare two chars (case-insensitive) */
69-
lapack_logical LAPACKE_lsame( char ca, char cb );
69+
lapack_logical LAPACKE_lsame( char ca, char cb )
70+
#if defined __GNUC__
71+
__attribute__((const))
72+
#endif
73+
;
7074

7175
/* Functions to convert column-major to row-major 2d arrays and vice versa. */
7276
void LAPACKE_cgb_trans( int matrix_layout, lapack_int m, lapack_int n,

0 commit comments

Comments
 (0)