mirror of
https://github.com/Kitware/CMake.git
synced 2026-01-11 16:32:14 -06:00
Find{BLAS,LAPACK}: Specify integer type in tests
This commit is contained in:
@@ -1,16 +1,18 @@
|
||||
#include <assert.h>
|
||||
#include <string.h>
|
||||
|
||||
typedef int blas_int;
|
||||
|
||||
// declare what parts of the blas C-API we need
|
||||
void dswap_(int* N, double* X, int* incX, double* Y, int* incY);
|
||||
void dswap_(blas_int* N, double* X, blas_int* incX, double* Y, blas_int* incY);
|
||||
|
||||
int main()
|
||||
{
|
||||
double x[4] = { 1, 2, 3, 4 };
|
||||
double y[4] = { 8, 7, 7, 6 };
|
||||
int N = 4;
|
||||
int incX = 1;
|
||||
int incY = 1;
|
||||
blas_int N = 4;
|
||||
blas_int incX = 1;
|
||||
blas_int incY = 1;
|
||||
dswap_(&N, x, &incX, y, &incY);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -1,8 +1,11 @@
|
||||
#include <assert.h>
|
||||
#include <string.h>
|
||||
|
||||
typedef int blas_int;
|
||||
|
||||
// declare what parts of the lapack C-API we need
|
||||
void dgesv_(int*, int*, double*, int*, int*, double*, int*, int*);
|
||||
void dgesv_(blas_int*, blas_int*, double*, blas_int*, blas_int*, double*,
|
||||
blas_int*, blas_int*);
|
||||
|
||||
int main()
|
||||
{
|
||||
@@ -10,11 +13,11 @@ int main()
|
||||
0, 1, 2, 3, 4, 5, 6, 7,
|
||||
};
|
||||
double B[2] = { 0, 5 };
|
||||
int ipiv[2] = { 0, 0 };
|
||||
int info = 0;
|
||||
blas_int ipiv[2] = { 0, 0 };
|
||||
blas_int info = 0;
|
||||
|
||||
int dim = 2;
|
||||
int numCols = 1;
|
||||
blas_int dim = 2;
|
||||
blas_int numCols = 1;
|
||||
dgesv_(&dim, &numCols, A, &dim, ipiv, B, &dim, &info);
|
||||
return 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user