Skip to content

Commit abd2c6d

Browse files
author
guozhong.zhuang
committed
merge kbergstorm's change to branch
1 parent e2f590a commit abd2c6d

12 files changed

Lines changed: 828 additions & 18 deletions

LAPACKE/example/Makefile

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,12 @@
11
include ../../make.inc
22

3-
all: xexample_DGESV_rowmajor \
4-
xexample_DGESV_colmajor \
5-
xexample_DGELS_rowmajor \
6-
xexample_DGELS_colmajor
3+
all: test_nancheck_DGELS
74

85
LIBRARIES = ../../$(LAPACKELIB) ../../$(LAPACKLIB) $(BLASLIB)
96

107
# Double Precision Examples
11-
xexample_DGESV_rowmajor: example_DGESV_rowmajor.o lapacke_example_aux.o $(LIBRARIES)
12-
$(LOADER) $(LOADOPTS) -o $@ $^
13-
./$@
14-
15-
xexample_DGESV_colmajor: example_DGESV_colmajor.o lapacke_example_aux.o $(LIBRARIES)
16-
$(LOADER) $(LOADOPTS) -o $@ $^
17-
./$@
18-
19-
xexample_DGELS_rowmajor: example_DGELS_rowmajor.o lapacke_example_aux.o $(LIBRARIES)
20-
$(LOADER) $(LOADOPTS) -o $@ $^
21-
./$@
228

23-
xexample_DGELS_colmajor: example_DGELS_colmajor.o lapacke_example_aux.o $(LIBRARIES)
9+
test_nancheck_DGELS: test_nancheck_DGELS.o lapacke_example_aux.o $(LIBRARIES)
2410
$(LOADER) $(LOADOPTS) -o $@ $^
2511
./$@
2612

LAPACKE/include/lapacke.h

Lines changed: 64 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2398,6 +2398,28 @@ float LAPACKE_clanhe( int matrix_layout, char norm, char uplo, lapack_int n,
23982398
double LAPACKE_zlanhe( int matrix_layout, char norm, char uplo, lapack_int n,
23992399
const lapack_complex_double* a, lapack_int lda );
24002400

2401+
lapack_int LAPACKE_clacrm( int matrix_layout, lapack_int m, lapack_int n,
2402+
const lapack_complex_float* a,
2403+
lapack_int lda, const float* b,
2404+
lapack_int ldb, lapack_complex_float* c,
2405+
lapack_int ldc );
2406+
lapack_int LAPACKE_zlacrm( int matrix_layout, lapack_int m, lapack_int n,
2407+
const lapack_complex_double* a,
2408+
lapack_int lda, const double* b,
2409+
lapack_int ldb, lapack_complex_double* c,
2410+
lapack_int ldc );
2411+
2412+
lapack_int LAPACKE_clarcm( int matrix_layout, lapack_int m, lapack_int n,
2413+
const float* a, lapack_int lda,
2414+
const lapack_complex_float* b,
2415+
lapack_int ldb, lapack_complex_float* c,
2416+
lapack_int ldc );
2417+
lapack_int LAPACKE_zlarcm( int matrix_layout, lapack_int m, lapack_int n,
2418+
const double* a, lapack_int lda,
2419+
const lapack_complex_double* b,
2420+
lapack_int ldb, lapack_complex_double* c,
2421+
lapack_int ldc );
2422+
24012423
float LAPACKE_slansy( int matrix_layout, char norm, char uplo, lapack_int n,
24022424
const float* a, lapack_int lda );
24032425
double LAPACKE_dlansy( int matrix_layout, char norm, char uplo, lapack_int n,
@@ -7586,6 +7608,28 @@ double LAPACKE_zlanhe_work( int matrix_layout, char norm, char uplo,
75867608
lapack_int n, const lapack_complex_double* a,
75877609
lapack_int lda, double* work );
75887610

7611+
lapack_int LAPACKE_clacrm_work( int matrix_layout, lapack_int m, lapack_int n,
7612+
const lapack_complex_float* a,
7613+
lapack_int lda, const float* b,
7614+
lapack_int ldb, lapack_complex_float* c,
7615+
lapack_int ldc, float* work );
7616+
lapack_int LAPACKE_zlacrm_work( int matrix_layout, lapack_int m, lapack_int n,
7617+
const lapack_complex_double* a,
7618+
lapack_int lda, const double* b,
7619+
lapack_int ldb, lapack_complex_double* c,
7620+
lapack_int ldc, double* work );
7621+
7622+
lapack_int LAPACKE_clarcm_work( int matrix_layout, lapack_int m, lapack_int n,
7623+
const float* a, lapack_int lda,
7624+
const lapack_complex_float* b,
7625+
lapack_int ldb, lapack_complex_float* c,
7626+
lapack_int ldc, float* work );
7627+
lapack_int LAPACKE_zlarcm_work( int matrix_layout, lapack_int m, lapack_int n,
7628+
const double* a, lapack_int lda,
7629+
const lapack_complex_double* b,
7630+
lapack_int ldb, lapack_complex_double* c,
7631+
lapack_int ldc, double* work );
7632+
75897633
float LAPACKE_slansy_work( int matrix_layout, char norm, char uplo,
75907634
lapack_int n, const float* a, lapack_int lda,
75917635
float* work );
@@ -13347,6 +13391,10 @@ lapack_int LAPACKE_zhegv_2stage_work( int matrix_layout, lapack_int itype, char
1334713391
#define LAPACK_zlange LAPACK_GLOBAL(zlange,ZLANGE)
1334813392
#define LAPACK_clanhe LAPACK_GLOBAL(clanhe,CLANHE)
1334913393
#define LAPACK_zlanhe LAPACK_GLOBAL(zlanhe,ZLANHE)
13394+
#define LAPACK_clarcm LAPACK_GLOBAL(clarcm,CLARCM)
13395+
#define LAPACK_zlarcm LAPACK_GLOBAL(zlarcm,ZLARCM)
13396+
#define LAPACK_clacrm LAPACK_GLOBAL(clacrm,CLACRM)
13397+
#define LAPACK_zlacrm LAPACK_GLOBAL(zlacrm,ZLACRM)
1335013398
#define LAPACK_slansy LAPACK_GLOBAL(slansy,SLANSY)
1335113399
#define LAPACK_dlansy LAPACK_GLOBAL(dlansy,DLANSY)
1335213400
#define LAPACK_clansy LAPACK_GLOBAL(clansy,CLANSY)
@@ -17896,6 +17944,22 @@ float LAPACK_clanhe( char* norm, char* uplo, lapack_int* n,
1789617944
const lapack_complex_float* a, lapack_int* lda, float* work );
1789717945
double LAPACK_zlanhe( char* norm, char* uplo, lapack_int* n,
1789817946
const lapack_complex_double* a, lapack_int* lda, double* work );
17947+
void LAPACK_clarcm( lapack_int* m, lapack_int* n, const float* a,
17948+
lapack_int* lda, const lapack_complex_float* b,
17949+
lapack_int* ldb, lapack_complex_float* c,
17950+
lapack_int* ldc, float* work );
17951+
void LAPACK_zlarcm( lapack_int* m, lapack_int* n, const double* a,
17952+
lapack_int* lda, const lapack_complex_double* b,
17953+
lapack_int* ldb, lapack_complex_double* c,
17954+
lapack_int* ldc, double* work );
17955+
void LAPACK_clacrm( lapack_int* m, lapack_int* n, const lapack_complex_float* a,
17956+
lapack_int* lda, const float* b,
17957+
lapack_int* ldb, lapack_complex_float* c,
17958+
lapack_int* ldc, float* work );
17959+
void LAPACK_zlacrm( lapack_int* m, lapack_int* n, const lapack_complex_double* a,
17960+
lapack_int* lda, const double* b,
17961+
lapack_int* ldb, lapack_complex_double* c,
17962+
lapack_int* ldc, double* work );
1789917963
float LAPACK_slansy( char* norm, char* uplo, lapack_int* n, const float* a,
1790017964
lapack_int* lda, float* work );
1790117965
double LAPACK_dlansy( char* norm, char* uplo, lapack_int* n, const double* a,
@@ -19076,7 +19140,6 @@ void LAPACK_zhegv_2stage( lapack_int* itype, char* jobz, char* uplo, lapack_int*
1907619140
void LAPACKE_set_nancheck( int flag );
1907719141
int LAPACKE_get_nancheck( );
1907819142

19079-
1908019143
#ifdef __cplusplus
1908119144
}
1908219145
#endif /* __cplusplus */

LAPACKE/src/CMakeLists.txt

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -295,6 +295,8 @@ lapacke_clacp2.c
295295
lapacke_clacp2_work.c
296296
lapacke_clacpy.c
297297
lapacke_clacpy_work.c
298+
lapacke_clacrm.c
299+
lapacke_clacrm_work.c
298300
lapacke_clag2z.c
299301
lapacke_clag2z_work.c
300302
lapacke_clange.c
@@ -309,6 +311,8 @@ lapacke_clapmr.c
309311
lapacke_clapmr_work.c
310312
lapacke_clapmt.c
311313
lapacke_clapmt_work.c
314+
lapacke_clarcm.c
315+
lapacke_clarcm_work.c
312316
lapacke_clarfb.c
313317
lapacke_clarfb_work.c
314318
lapacke_clarfg.c
@@ -1141,6 +1145,7 @@ lapacke_dtrttp.c
11411145
lapacke_dtrttp_work.c
11421146
lapacke_dtzrzf.c
11431147
lapacke_dtzrzf_work.c
1148+
lapacke_nancheck.c
11441149
lapacke_sbbcsd.c
11451150
lapacke_sbbcsd_work.c
11461151
lapacke_sbdsdc.c
@@ -1987,6 +1992,8 @@ lapacke_zlacp2.c
19871992
lapacke_zlacp2_work.c
19881993
lapacke_zlacpy.c
19891994
lapacke_zlacpy_work.c
1995+
lapacke_zlacrm.c
1996+
lapacke_zlacrm_work.c
19901997
lapacke_zlag2c.c
19911998
lapacke_zlag2c_work.c
19921999
lapacke_zlange.c
@@ -2001,6 +2008,8 @@ lapacke_zlapmr.c
20012008
lapacke_zlapmr_work.c
20022009
lapacke_zlapmt.c
20032010
lapacke_zlapmt_work.c
2011+
lapacke_zlarcm.c
2012+
lapacke_zlarcm_work.c
20042013
lapacke_zlarfb.c
20052014
lapacke_zlarfb_work.c
20062015
lapacke_zlarfg.c

LAPACKE/src/Makefile

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -334,6 +334,8 @@ lapacke_clacp2.o \
334334
lapacke_clacp2_work.o \
335335
lapacke_clacpy.o \
336336
lapacke_clacpy_work.o \
337+
lapacke_clacrm.o \
338+
lapacke_clacrm_work.o \
337339
lapacke_clag2z.o \
338340
lapacke_clag2z_work.o \
339341
lapacke_clange.o \
@@ -348,6 +350,8 @@ lapacke_clapmr.o \
348350
lapacke_clapmr_work.o \
349351
lapacke_clapmt.o \
350352
lapacke_clapmt_work.o \
353+
lapacke_clarcm.o \
354+
lapacke_clarcm_work.o \
351355
lapacke_clarfb.o \
352356
lapacke_clarfb_work.o \
353357
lapacke_clarfg.o \
@@ -1182,7 +1186,7 @@ lapacke_dtrttp.o \
11821186
lapacke_dtrttp_work.o \
11831187
lapacke_dtzrzf.o \
11841188
lapacke_dtzrzf_work.o \
1185-
lapacke_nancheck.o \
1189+
lapacke_nancheck.o \
11861190
lapacke_sbbcsd.o \
11871191
lapacke_sbbcsd_work.o \
11881192
lapacke_sbdsdc.o \
@@ -2035,6 +2039,8 @@ lapacke_zlacp2.o \
20352039
lapacke_zlacp2_work.o \
20362040
lapacke_zlacpy.o \
20372041
lapacke_zlacpy_work.o \
2042+
lapacke_zlacrm.o \
2043+
lapacke_zlacrm_work.o \
20382044
lapacke_zlag2c.o \
20392045
lapacke_zlag2c_work.o \
20402046
lapacke_zlange.o \
@@ -2049,6 +2055,8 @@ lapacke_zlapmr.o \
20492055
lapacke_zlapmr_work.o \
20502056
lapacke_zlapmt.o \
20512057
lapacke_zlapmt_work.o \
2058+
lapacke_zlarcm.o \
2059+
lapacke_zlarcm_work.o \
20522060
lapacke_zlarfb.o \
20532061
lapacke_zlarfb_work.o \
20542062
lapacke_zlarfg.o \

LAPACKE/src/lapacke_clacrm.c

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
/*****************************************************************************
2+
Copyright (c) 2017, Intel Corp.
3+
All rights reserved.
4+
5+
Redistribution and use in source and binary forms, with or without
6+
modification, are permitted provided that the following conditions are met:
7+
8+
* Redistributions of source code must retain the above copyright notice,
9+
this list of conditions and the following disclaimer.
10+
* Redistributions in binary form must reproduce the above copyright
11+
notice, this list of conditions and the following disclaimer in the
12+
documentation and/or other materials provided with the distribution.
13+
* Neither the name of Intel Corporation nor the names of its contributors
14+
may be used to endorse or promote products derived from this software
15+
without specific prior written permission.
16+
17+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
18+
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
19+
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
20+
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
21+
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
22+
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
23+
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
24+
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
25+
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
26+
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
27+
THE POSSIBILITY OF SUCH DAMAGE.
28+
*****************************************************************************
29+
* Contents: Native high-level C interface to LAPACK function clacrm
30+
* Author: Intel Corporation
31+
* Generated June 2017
32+
*****************************************************************************/
33+
34+
#include "lapacke_utils.h"
35+
36+
lapack_int LAPACKE_clacrm(int matrix_layout, lapack_int m,
37+
lapack_int n, const lapack_complex_float* a,
38+
lapack_int lda, const float* b, lapack_int ldb,
39+
lapack_complex_float* c, lapack_int ldc)
40+
{
41+
lapack_int info = 0;
42+
float* rwork = NULL;
43+
44+
if (matrix_layout != LAPACK_COL_MAJOR && matrix_layout != LAPACK_ROW_MAJOR) {
45+
LAPACKE_xerbla("LAPACKE_clacrm", -1);
46+
return -1;
47+
}
48+
#ifndef LAPACK_DISABLE_NAN_CHECK
49+
if ( LAPACKE_get_nancheck() ) {
50+
/* Optionally check input matrices for NaNs */
51+
if( LAPACKE_cge_nancheck( matrix_layout, m, n, a, lda ) ) {
52+
return -4;
53+
}
54+
if( LAPACKE_sge_nancheck( matrix_layout, n, n, b, ldb ) ) {
55+
return -6;
56+
}
57+
}
58+
#endif
59+
/* Allocate memory for work array(s) */
60+
rwork = (float*)
61+
LAPACKE_malloc(sizeof(float) * MAX(1, 2 * m * n));
62+
if (rwork == NULL) {
63+
info = LAPACK_WORK_MEMORY_ERROR;
64+
goto exit_level_0;
65+
}
66+
/* Call middle-level interface */
67+
info = LAPACKE_clacrm_work(matrix_layout, m, n, a, lda, b, ldb,
68+
c, ldc, rwork);
69+
/* Release memory and exit */
70+
LAPACKE_free(rwork);
71+
exit_level_0:
72+
if( info == LAPACK_WORK_MEMORY_ERROR ) {
73+
LAPACKE_xerbla( "LAPACKE_clacrm", info );
74+
}
75+
return info;
76+
}

0 commit comments

Comments
 (0)