Skip to content

Commit 122895c

Browse files
authored
Mark Cython functions as noexcept explicitly (#104)
1 parent 96fe2cf commit 122895c

File tree

2 files changed

+31
-31
lines changed

2 files changed

+31
-31
lines changed

blis/cy.pxd

+14-14
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ cdef void gemm(
102102
reals_ft b, inc_t rsb, inc_t csb,
103103
double beta,
104104
reals_ft c, inc_t rsc, inc_t csc,
105-
) nogil
105+
) noexcept nogil
106106

107107

108108
cdef void ger(
@@ -114,7 +114,7 @@ cdef void ger(
114114
reals_ft x, inc_t incx,
115115
reals_ft y, inc_t incy,
116116
reals_ft a, inc_t rsa, inc_t csa
117-
) nogil
117+
) noexcept nogil
118118

119119

120120
cdef void gemv(
@@ -127,7 +127,7 @@ cdef void gemv(
127127
reals_ft x, inc_t incx,
128128
real_ft beta,
129129
reals_ft y, inc_t incy
130-
) nogil
130+
) noexcept nogil
131131

132132

133133
cdef void axpyv(
@@ -136,15 +136,15 @@ cdef void axpyv(
136136
real_ft alpha,
137137
reals_ft x, inc_t incx,
138138
reals_ft y, inc_t incy
139-
) nogil
139+
) noexcept nogil
140140

141141

142142
cdef void scalv(
143143
conj_t conjalpha,
144144
dim_t m,
145145
real_ft alpha,
146146
reals_ft x, inc_t incx
147-
) nogil
147+
) noexcept nogil
148148

149149

150150
cdef double dotv(
@@ -155,46 +155,46 @@ cdef double dotv(
155155
reals_ft y,
156156
inc_t incx,
157157
inc_t incy,
158-
) nogil
158+
) noexcept nogil
159159

160160

161161
cdef double norm_L1(
162162
dim_t n,
163163
reals_ft x, inc_t incx
164-
) nogil
164+
) noexcept nogil
165165

166166

167167
cdef double norm_L2(
168168
dim_t n,
169169
reals_ft x, inc_t incx
170-
) nogil
170+
) noexcept nogil
171171

172172

173173
cdef double norm_inf(
174174
dim_t n,
175175
reals_ft x, inc_t incx
176-
) nogil
176+
) noexcept nogil
177177

178178

179179
cdef void randv(
180180
dim_t m,
181181
reals_ft x, inc_t incx
182-
) nogil
182+
) noexcept nogil
183183

184184

185185
cdef void dgemm(bint transA, bint transB, int M, int N, int K,
186186
double alpha, const double* A, int lda, const double* B,
187-
int ldb, double beta, double* C, int ldc) nogil
187+
int ldb, double beta, double* C, int ldc) noexcept nogil
188188

189189

190190
cdef void sgemm(bint transA, bint transB, int M, int N, int K,
191191
float alpha, const float* A, int lda, const float* B,
192-
int ldb, float beta, float* C, int ldc) nogil
192+
int ldb, float beta, float* C, int ldc) noexcept nogil
193193

194194

195195
cdef void daxpy(int N, double alpha, const double* X, int incX,
196-
double* Y, int incY) nogil
196+
double* Y, int incY) noexcept nogil
197197

198198

199199
cdef void saxpy(int N, float alpha, const float* X, int incX,
200-
float* Y, int incY) nogil
200+
float* Y, int incY) noexcept nogil

blis/cy.pyx

+17-17
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,7 @@ cdef extern from "blis.h" nogil:
261261
float* sumsq,
262262
blis_cntx_t* cntx,
263263
blis_rntm_t* rntm,
264-
) nogil
264+
) noexcept nogil
265265

266266
void bli_dsumsqv_ex(
267267
dim_t m,
@@ -270,7 +270,7 @@ cdef extern from "blis.h" nogil:
270270
double* sumsq,
271271
blis_cntx_t* cntx,
272272
blis_rntm_t* rntm,
273-
) nogil
273+
) noexcept nogil
274274

275275

276276

@@ -312,7 +312,7 @@ cdef void gemm(
312312
reals_ft b, inc_t rsb, inc_t csb,
313313
double beta,
314314
reals_ft c, inc_t rsc, inc_t csc
315-
) nogil:
315+
) noexcept nogil:
316316
cdef float alpha_f = alpha
317317
cdef float beta_f = beta
318318
cdef double alpha_d = alpha
@@ -353,7 +353,7 @@ cdef void ger(
353353
reals_ft x, inc_t incx,
354354
reals_ft y, inc_t incy,
355355
reals_ft a, inc_t rsa, inc_t csa
356-
) nogil:
356+
) noexcept nogil:
357357
cdef float alpha_f = alpha
358358
cdef double alpha_d = alpha
359359
if reals_ft is floats_t:
@@ -395,7 +395,7 @@ cdef void gemv(
395395
reals_ft x, inc_t incx,
396396
real_ft beta,
397397
reals_ft y, inc_t incy
398-
) nogil:
398+
) noexcept nogil:
399399
cdef float alpha_f = alpha
400400
cdef double alpha_d = alpha
401401
cdef float beta_f = alpha
@@ -439,7 +439,7 @@ cdef void axpyv(
439439
real_ft alpha,
440440
reals_ft x, inc_t incx,
441441
reals_ft y, inc_t incy
442-
) nogil:
442+
) noexcept nogil:
443443
cdef float alpha_f = alpha
444444
cdef double alpha_d = alpha
445445
if reals_ft is floats_t:
@@ -460,7 +460,7 @@ cdef void scalv(
460460
dim_t m,
461461
real_ft alpha,
462462
reals_ft x, inc_t incx
463-
) nogil:
463+
) noexcept nogil:
464464
cdef float alpha_f = alpha
465465
cdef double alpha_d = alpha
466466
if reals_ft is floats_t:
@@ -479,7 +479,7 @@ cdef void scalv(
479479
cdef double norm_L1(
480480
dim_t n,
481481
reals_ft x, inc_t incx
482-
) nogil:
482+
) noexcept nogil:
483483
cdef double dnorm = 0
484484
cdef float snorm = 0
485485
if reals_ft is floats_t:
@@ -501,7 +501,7 @@ cdef double norm_L1(
501501
cdef double norm_L2(
502502
dim_t n,
503503
reals_ft x, inc_t incx
504-
) nogil:
504+
) noexcept nogil:
505505
cdef double dnorm = 0
506506
cdef float snorm = 0
507507
if reals_ft is floats_t:
@@ -523,7 +523,7 @@ cdef double norm_L2(
523523
cdef double norm_inf(
524524
dim_t n,
525525
reals_ft x, inc_t incx
526-
) nogil:
526+
) noexcept nogil:
527527
cdef double dnorm = 0
528528
cdef float snorm = 0
529529
if reals_ft is floats_t:
@@ -550,7 +550,7 @@ cdef double dotv(
550550
reals_ft y,
551551
inc_t incx,
552552
inc_t incy,
553-
) nogil:
553+
) noexcept nogil:
554554
cdef double rho_d = 0.0
555555
cdef float rho_f = 0.0
556556
if reals_ft is floats_t:
@@ -571,7 +571,7 @@ cdef double dotv(
571571
raise ValueError("Unhandled fused type")
572572

573573

574-
cdef void randv(dim_t m, reals_ft x, inc_t incx) nogil:
574+
cdef void randv(dim_t m, reals_ft x, inc_t incx) noexcept nogil:
575575
if reals_ft is floats_t:
576576
bli_srandv_ex(m, x, incx, NULL, &rntm)
577577
elif reals_ft is float1d_t:
@@ -586,7 +586,7 @@ cdef void randv(dim_t m, reals_ft x, inc_t incx) nogil:
586586

587587

588588
cdef void sumsqv(dim_t m, reals_ft x, inc_t incx,
589-
reals_ft scale, reals_ft sumsq) nogil:
589+
reals_ft scale, reals_ft sumsq) noexcept nogil:
590590
if reals_ft is floats_t:
591591
bli_ssumsqv_ex(m, &x[0], incx, scale, sumsq, NULL, &rntm)
592592
elif reals_ft is float1d_t:
@@ -602,7 +602,7 @@ cdef void sumsqv(dim_t m, reals_ft x, inc_t incx,
602602

603603
cdef void dgemm(bint transA, bint transB, int M, int N, int K,
604604
double alpha, const double* A, int lda, const double* B,
605-
int ldb, double beta, double* C, int ldc) nogil:
605+
int ldb, double beta, double* C, int ldc) noexcept nogil:
606606
gemm(
607607
TRANSPOSE if transA else NO_TRANSPOSE,
608608
TRANSPOSE if transB else NO_TRANSPOSE,
@@ -615,7 +615,7 @@ cdef void dgemm(bint transA, bint transB, int M, int N, int K,
615615

616616
cdef void sgemm(bint transA, bint transB, int M, int N, int K,
617617
float alpha, const float* A, int lda, const float* B,
618-
int ldb, float beta, float* C, int ldc) nogil:
618+
int ldb, float beta, float* C, int ldc) noexcept nogil:
619619
gemm(
620620
TRANSPOSE if transA else NO_TRANSPOSE,
621621
TRANSPOSE if transB else NO_TRANSPOSE,
@@ -627,12 +627,12 @@ cdef void sgemm(bint transA, bint transB, int M, int N, int K,
627627

628628

629629
cdef void saxpy(int N, float alpha, const float* X, int incX,
630-
float* Y, int incY) nogil:
630+
float* Y, int incY) noexcept nogil:
631631
axpyv(NO_CONJUGATE, N, alpha, X, incX, Y, incY)
632632

633633

634634
cdef void daxpy(int N, double alpha, const double* X, int incX,
635-
double* Y, int incY) nogil:
635+
double* Y, int incY) noexcept nogil:
636636
axpyv(NO_CONJUGATE, N, alpha, X, incX, Y, incY)
637637

638638

0 commit comments

Comments
 (0)