This repository has been archived by the owner on Nov 17, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 6.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[MXNET-244] Work around likely compiler bug on nested inlines and tem…
…porary acces… (#13535) * Work around likely compiler bug on nested inlines and temporary access to stream * Don't compile khatri_rao tests if we don't have LAPACK * Address CR comment
- Loading branch information
Showing
3 changed files
with
86 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
/* | ||
* Licensed to the Apache Software Foundation (ASF) under one | ||
* or more contributor license agreements. See the NOTICE file | ||
* distributed with this work for additional information | ||
* regarding copyright ownership. The ASF licenses this file | ||
* to you under the Apache License, Version 2.0 (the | ||
* "License"); you may not use this file except in compliance | ||
* with the License. You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, | ||
* software distributed under the License is distributed on an | ||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
* KIND, either express or implied. See the License for the | ||
* specific language governing permissions and limitations | ||
* under the License. | ||
*/ | ||
|
||
#include "c_lapack_api.h" | ||
|
||
#if (MSHADOW_USE_MKL && MXNET_USE_LAPACK) | ||
#elif MXNET_USE_LAPACK | ||
#else | ||
// use pragma message instead of warning | ||
#pragma message("Warning: lapack usage not enabled, linalg-operators will not be available." \ | ||
" Ensure that lapack library is installed and build with USE_LAPACK=1 to get lapack" \ | ||
" functionalities.") | ||
|
||
// Define compilable stubs. | ||
#define MXNET_LAPACK_CWRAPPER1(func, dtype) \ | ||
int MXNET_LAPACK_##func(int matrix_layout, char uplo, int n, dtype* a, int lda) { \ | ||
LOG(FATAL) << "MXNet build without lapack. Function " << #func << " is not available."; \ | ||
return 1; \ | ||
} | ||
|
||
#define MXNET_LAPACK_CWRAPPER2(func, dtype) \ | ||
int MXNET_LAPACK_##func(int matrix_layout, int m, int n, dtype* a, \ | ||
int lda, dtype* tau, dtype* work, int lwork) { \ | ||
LOG(FATAL) << "MXNet build without lapack. Function " << #func << " is not available."; \ | ||
return 1; \ | ||
} | ||
|
||
#define MXNET_LAPACK_CWRAPPER3(func, dtype) \ | ||
int MXNET_LAPACK_##func(int matrix_layout, char uplo, int n, dtype *a, \ | ||
int lda, dtype *w, dtype *work, int lwork, \ | ||
int *iwork, int liwork) { \ | ||
LOG(FATAL) << "MXNet build without lapack. Function " << #func << " is not available."; \ | ||
return 1; \ | ||
} | ||
|
||
#define MXNET_LAPACK_UNAVAILABLE(func) \ | ||
int mxnet_lapack_##func(...) { \ | ||
LOG(FATAL) << "MXNet build without lapack. Function " << #func << " is not available."; \ | ||
return 1; \ | ||
} | ||
MXNET_LAPACK_CWRAPPER1(spotrf, float) | ||
MXNET_LAPACK_CWRAPPER1(dpotrf, double) | ||
MXNET_LAPACK_CWRAPPER1(spotri, float) | ||
MXNET_LAPACK_CWRAPPER1(dpotri, double) | ||
|
||
MXNET_LAPACK_UNAVAILABLE(sposv) | ||
MXNET_LAPACK_UNAVAILABLE(dposv) | ||
|
||
MXNET_LAPACK_CWRAPPER2(sgelqf, float) | ||
MXNET_LAPACK_CWRAPPER2(dgelqf, double) | ||
MXNET_LAPACK_CWRAPPER2(sorglq, float) | ||
MXNET_LAPACK_CWRAPPER2(dorglq, double) | ||
|
||
MXNET_LAPACK_CWRAPPER3(ssyevd, float) | ||
MXNET_LAPACK_CWRAPPER3(dsyevd, double) | ||
#endif // MSHADOW_USE_MKL == 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters