Browse Source

Merge pull request #3820 from martin-frbg/lapack700

Add print format macros for 64bit integer builds to LAPACKE (Reference-LAPACK PR 700)
tags/v0.3.22^2
Martin Kroeker GitHub 2 years ago
parent
commit
26b5009ebc
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 20 additions and 12 deletions
  1. +2
    -4
      lapack-netlib/LAPACKE/example/example_DGESV_colmajor.c
  2. +2
    -4
      lapack-netlib/LAPACKE/example/example_DGESV_rowmajor.c
  3. +1
    -1
      lapack-netlib/LAPACKE/example/lapacke_example_aux.c
  4. +15
    -3
      lapack-netlib/LAPACKE/include/lapacke_config.h

+ 2
- 4
lapack-netlib/LAPACKE/example/example_DGESV_colmajor.c View File

@@ -25,11 +25,9 @@

LAPACKE_dgesv (col-major, high-level) Example Program Results

-- LAPACKE Example routine (version 3.7.0) --
-- LAPACKE Example routine --
-- LAPACK is a software package provided by Univ. of Tennessee, --
-- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
December 2016

*/
/* Includes */
#include <stdlib.h>
@@ -94,7 +92,7 @@ int main(int argc, char **argv) {
/* Check for the exact singularity */
if( info > 0 ) {
printf( "The diagonal element of the triangular factor of A,\n" );
printf( "U(%i,%i) is zero, so that A is singular;\n", info, info );
printf( "U(%" LAPACK_IFMT ",%" LAPACK_IFMT ") is zero, so that A is singular;\n", info, info );
printf( "the solution could not be computed.\n" );
exit( 1 );
}


+ 2
- 4
lapack-netlib/LAPACKE/example/example_DGESV_rowmajor.c View File

@@ -25,11 +25,9 @@

LAPACKE_dgesv (row-major, high-level) Example Program Results

-- LAPACKE Example routine (version 3.7.0) --
-- LAPACKE Example routine --
-- LAPACK is a software package provided by Univ. of Tennessee, --
-- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
December 2016

*/
#include <stdlib.h>
#include <stdio.h>
@@ -91,7 +89,7 @@ int main(int argc, char **argv) {
/* Check for the exact singularity */
if( info > 0 ) {
printf( "The diagonal element of the triangular factor of A,\n" );
printf( "U(%i,%i) is zero, so that A is singular;\n", info, info );
printf( "U(%" LAPACK_IFMT ",%" LAPACK_IFMT ") is zero, so that A is singular;\n", info, info );
printf( "the solution could not be computed.\n" );
exit( 1 );
}


+ 1
- 1
lapack-netlib/LAPACKE/example/lapacke_example_aux.c View File

@@ -28,6 +28,6 @@ void print_matrix_colmajor( char* desc, lapack_int m, lapack_int n, double* mat,
void print_vector( char* desc, lapack_int n, lapack_int* vec ) {
lapack_int j;
printf( "\n %s\n", desc );
for( j = 0; j < n; j++ ) printf( " %6i", vec[j] );
for( j = 0; j < n; j++ ) printf( " %6" LAPACK_IFMT, vec[j] );
printf( "\n" );
}

+ 15
- 3
lapack-netlib/LAPACKE/include/lapacke_config.h View File

@@ -42,17 +42,29 @@ extern "C" {

#include <stdlib.h>
#include <stdint.h>
#include <inttypes.h>

#ifndef lapack_int
#if defined(LAPACK_ILP64)
#define lapack_int int64_t
#define lapack_int int64_t
#else
#define lapack_int int32_t
#define lapack_int int32_t
#endif
#endif

/*
* Integer format string
*/
#ifndef LAPACK_IFMT
#if defined(LAPACK_ILP64)
#define LAPACK_IFMT PRId64
#else
#define LAPACK_IFMT PRId32
#endif
#endif

#ifndef lapack_logical
#define lapack_logical lapack_int
#define lapack_logical lapack_int
#endif

#ifndef LAPACK_COMPLEX_CUSTOM


Loading…
Cancel
Save