File tree Expand file tree Collapse file tree 2 files changed +48
-0
lines changed
lib/node_modules/@stdlib/blas/base/shared/include/stdlib/blas/base Expand file tree Collapse file tree 2 files changed +48
-0
lines changed Original file line number Diff line number Diff line change 20
20
#define STDLIB_BLAS_BASE_SHARED_H
21
21
22
22
#include "shared/cblas.h"
23
+ #include "shared/macros.h"
23
24
24
25
#endif // !STDLIB_BLAS_BASE_SHARED_H
Original file line number Diff line number Diff line change
1
+ /**
2
+ * @license Apache-2.0
3
+ *
4
+ * Copyright (c) 2023 The Stdlib Authors.
5
+ *
6
+ * Licensed under the Apache License, Version 2.0 (the "License");
7
+ * you may not use this file except in compliance with the License.
8
+ * You may obtain a copy of the License at
9
+ *
10
+ * http://www.apache.org/licenses/LICENSE-2.0
11
+ *
12
+ * Unless required by applicable law or agreed to in writing, software
13
+ * distributed under the License is distributed on an "AS IS" BASIS,
14
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
+ * See the License for the specific language governing permissions and
16
+ * limitations under the License.
17
+ */
18
+
19
+ #ifndef STDLIB_BLAS_BASE_SHARED_MACROS_H
20
+ #define STDLIB_BLAS_BASE_SHARED_MACROS_H
21
+
22
+ /*
23
+ * If C++, prevent name mangling so that the compiler emits a binary file having undecorated names, thus mirroring the behavior of a C compiler.
24
+ */
25
+ #ifdef __cplusplus
26
+ extern "C" {
27
+ #endif
28
+
29
+ /**
30
+ * Macro for converting a stride to an index offset.
31
+ *
32
+ * @param N number of indexed elements
33
+ * @param stride index increment
34
+ *
35
+ * @example
36
+ * #include <stdint.h>
37
+ *
38
+ * int64_t offset = STDLIB_BLAS_BASE_STRIDE2OFFSET( 10, -10 );
39
+ * // returns 90
40
+ */
41
+ #define STDLIB_BLAS_BASE_STRIDE2OFFSET ( N , stride ) ( ( (stride) > 0 ) ? 0 : ( 1-(N) ) * (stride) )
42
+
43
+ #ifdef __cplusplus
44
+ }
45
+ #endif
46
+
47
+ #endif // !STDLIB_BLAS_BASE_SHARED_MACROS_H
You can’t perform that action at this time.
0 commit comments