|
| 1 | +/* ****************************************************************************** |
| 2 | + * |
| 3 | + * |
| 4 | + * This program and the accompanying materials are made available under the |
| 5 | + * terms of the Apache License, Version 2.0 which is available at |
| 6 | + * https://www.apache.org/licenses/LICENSE-2.0. |
| 7 | + * |
| 8 | + * See the NOTICE file distributed with this work for additional |
| 9 | + * information regarding copyright ownership. |
| 10 | + * Unless required by applicable law or agreed to in writing, software |
| 11 | + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT |
| 12 | + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the |
| 13 | + * License for the specific language governing permissions and limitations |
| 14 | + * under the License. |
| 15 | + * |
| 16 | + * SPDX-License-Identifier: Apache-2.0 |
| 17 | + ******************************************************************************/ |
| 18 | + |
| 19 | +// |
| 20 | +// Created by agibsonccc on 2/6/16. |
| 21 | +// |
| 22 | + |
| 23 | +#ifndef NATIVEOPERATIONS_CBLAS_ENUM_CONVERSION_H_H |
| 24 | +#define NATIVEOPERATIONS_CBLAS_ENUM_CONVERSION_H_H |
| 25 | +#include <blas/cblas.h> |
| 26 | + |
| 27 | +enum CBLAS_ORDER {CblasRowMajor=101, CblasColMajor=102 }; |
| 28 | +enum CBLAS_TRANSPOSE {CblasNoTrans=111, CblasTrans=112, CblasConjTrans=113, |
| 29 | + AtlasConj=114}; |
| 30 | +enum CBLAS_UPLO {CblasUpper=121, CblasLower=122}; |
| 31 | +enum CBLAS_DIAG {CblasNonUnit=131, CblasUnit=132}; |
| 32 | +enum CBLAS_SIDE {CblasLeft=141, CblasRight=142}; |
| 33 | + |
| 34 | +#ifdef __cplusplus |
| 35 | +extern "C" { |
| 36 | +#endif |
| 37 | +/** |
| 38 | + * Converts a character |
| 39 | + * to its proper enum |
| 40 | + * for row (c) or column (f) ordering |
| 41 | + * default is row major |
| 42 | + */ |
| 43 | +CBLAS_ORDER convertOrder(int from); |
| 44 | +/** |
| 45 | + * Converts a character to its proper enum |
| 46 | + * t -> transpose |
| 47 | + * n -> no transpose |
| 48 | + * c -> conj |
| 49 | + */ |
| 50 | +CBLAS_TRANSPOSE convertTranspose(int from); |
| 51 | +/** |
| 52 | + * Upper or lower |
| 53 | + * U/u -> upper |
| 54 | + * L/l -> lower |
| 55 | + * |
| 56 | + * Default is upper |
| 57 | + */ |
| 58 | +CBLAS_UPLO convertUplo(int from); |
| 59 | + |
| 60 | +/** |
| 61 | + * For diagonals: |
| 62 | + * u/U -> unit |
| 63 | + * n/N -> non unit |
| 64 | + * |
| 65 | + * Default: unit |
| 66 | + */ |
| 67 | +CBLAS_DIAG convertDiag(int from); |
| 68 | +/** |
| 69 | + * Side of a matrix, left or right |
| 70 | + * l /L -> left |
| 71 | + * r/R -> right |
| 72 | + * default: left |
| 73 | + */ |
| 74 | +CBLAS_SIDE convertSide(int from); |
| 75 | + |
| 76 | +#ifdef __cplusplus |
| 77 | +} |
| 78 | +#endif |
| 79 | + |
| 80 | +#endif // NATIVEOPERATIONS_CBLAS_ENUM_CONVERSION_H_H |
0 commit comments