@@ -139,6 +139,8 @@ void fft(const ExecutionSpace& exec_space, const InViewType& in,
139
139
" type (float/double), the same layout (LayoutLeft/LayoutRight), and the "
140
140
" same rank. ExecutionSpace must be accessible to the data in InViewType "
141
141
" and OutViewType." );
142
+ static_assert (InViewType::rank () >= 1 ,
143
+ " fft: View rank must be larger than or equal to 1" );
142
144
143
145
KokkosFFT::Impl::Plan plan (exec_space, in, out, KokkosFFT::Direction::forward,
144
146
axis, n);
@@ -165,6 +167,8 @@ void ifft(const ExecutionSpace& exec_space, const InViewType& in,
165
167
" type (float/double), the same layout (LayoutLeft/LayoutRight), and the "
166
168
" same rank. ExecutionSpace must be accessible to the data in InViewType "
167
169
" and OutViewType." );
170
+ static_assert (InViewType::rank () >= 1 ,
171
+ " ifft: View rank must be larger than or equal to 1" );
168
172
169
173
KokkosFFT::Impl::Plan plan (exec_space, in, out,
170
174
KokkosFFT::Direction::backward, axis, n);
@@ -191,6 +195,8 @@ void rfft(const ExecutionSpace& exec_space, const InViewType& in,
191
195
" type (float/double), the same layout (LayoutLeft/LayoutRight), and the "
192
196
" same rank. ExecutionSpace must be accessible to the data in InViewType "
193
197
" and OutViewType." );
198
+ static_assert (InViewType::rank () >= 1 ,
199
+ " rfft: View rank must be larger than or equal to 1" );
194
200
195
201
using in_value_type = typename InViewType::non_const_value_type;
196
202
using out_value_type = typename OutViewType::non_const_value_type;
@@ -224,6 +230,8 @@ void irfft(const ExecutionSpace& exec_space, const InViewType& in,
224
230
" type (float/double), the same layout (LayoutLeft/LayoutRight), and the "
225
231
" same rank. ExecutionSpace must be accessible to the data in InViewType "
226
232
" and OutViewType." );
233
+ static_assert (InViewType::rank () >= 1 ,
234
+ " irfft: View rank must be larger than or equal to 1" );
227
235
228
236
using in_value_type = typename InViewType::non_const_value_type;
229
237
using out_value_type = typename OutViewType::non_const_value_type;
@@ -255,6 +263,8 @@ void hfft(const ExecutionSpace& exec_space, const InViewType& in,
255
263
" type (float/double), the same layout (LayoutLeft/LayoutRight), and the "
256
264
" same rank. ExecutionSpace must be accessible to the data in InViewType "
257
265
" and OutViewType." );
266
+ static_assert (InViewType::rank () >= 1 ,
267
+ " hfft: View rank must be larger than or equal to 1" );
258
268
259
269
// [TO DO]
260
270
// allow real type as input, need to obtain complex view type from in view
@@ -295,6 +305,8 @@ void ihfft(const ExecutionSpace& exec_space, const InViewType& in,
295
305
" type (float/double), the same layout (LayoutLeft/LayoutRight), and the "
296
306
" same rank. ExecutionSpace must be accessible to the data in InViewType "
297
307
" and OutViewType." );
308
+ static_assert (InViewType::rank () >= 1 ,
309
+ " ihfft: View rank must be larger than or equal to 1" );
298
310
299
311
using in_value_type = typename InViewType::non_const_value_type;
300
312
using out_value_type = typename OutViewType::non_const_value_type;
@@ -332,6 +344,8 @@ void fft2(const ExecutionSpace& exec_space, const InViewType& in,
332
344
" type (float/double), the same layout (LayoutLeft/LayoutRight), and the "
333
345
" same rank. ExecutionSpace must be accessible to the data in InViewType "
334
346
" and OutViewType." );
347
+ static_assert (InViewType::rank () >= 2 ,
348
+ " fft2: View rank must be larger than or equal to 2" );
335
349
336
350
KokkosFFT::Impl::Plan plan (exec_space, in, out, KokkosFFT::Direction::forward,
337
351
axes, s);
@@ -359,6 +373,8 @@ void ifft2(const ExecutionSpace& exec_space, const InViewType& in,
359
373
" type (float/double), the same layout (LayoutLeft/LayoutRight), and the "
360
374
" same rank. ExecutionSpace must be accessible to the data in InViewType "
361
375
" and OutViewType." );
376
+ static_assert (InViewType::rank () >= 2 ,
377
+ " ifft2: View rank must be larger than or equal to 2" );
362
378
363
379
KokkosFFT::Impl::Plan plan (exec_space, in, out,
364
380
KokkosFFT::Direction::backward, axes, s);
@@ -386,6 +402,9 @@ void rfft2(const ExecutionSpace& exec_space, const InViewType& in,
386
402
" type (float/double), the same layout (LayoutLeft/LayoutRight), and the "
387
403
" same rank. ExecutionSpace must be accessible to the data in InViewType "
388
404
" and OutViewType." );
405
+ static_assert (InViewType::rank () >= 2 ,
406
+ " rfft2: View rank must be larger than or equal to 2" );
407
+
389
408
using in_value_type = typename InViewType::non_const_value_type;
390
409
using out_value_type = typename OutViewType::non_const_value_type;
391
410
@@ -418,6 +437,8 @@ void irfft2(const ExecutionSpace& exec_space, const InViewType& in,
418
437
" type (float/double), the same layout (LayoutLeft/LayoutRight), and the "
419
438
" same rank. ExecutionSpace must be accessible to the data in InViewType "
420
439
" and OutViewType." );
440
+ static_assert (InViewType::rank () >= 2 ,
441
+ " irfft2: View rank must be larger than or equal to 2" );
421
442
422
443
using in_value_type = typename InViewType::non_const_value_type;
423
444
using out_value_type = typename OutViewType::non_const_value_type;
@@ -453,6 +474,11 @@ void fftn(const ExecutionSpace& exec_space, const InViewType& in,
453
474
" type (float/double), the same layout (LayoutLeft/LayoutRight), and the "
454
475
" same rank. ExecutionSpace must be accessible to the data in InViewType "
455
476
" and OutViewType." );
477
+ static_assert (DIM >= 1 && DIM <= KokkosFFT::MAX_FFT_DIM,
478
+ " fftn: the Rank of FFT axes must be between 1 and MAX_FFT_DIM" );
479
+ static_assert (
480
+ InViewType::rank () >= DIM,
481
+ " fftn: View rank must be larger than or equal to the Rank of FFT axes" );
456
482
457
483
KokkosFFT::Impl::Plan plan (exec_space, in, out, KokkosFFT::Direction::forward,
458
484
axes, s);
@@ -481,6 +507,12 @@ void ifftn(const ExecutionSpace& exec_space, const InViewType& in,
481
507
" type (float/double), the same layout (LayoutLeft/LayoutRight), and the "
482
508
" same rank. ExecutionSpace must be accessible to the data in InViewType "
483
509
" and OutViewType." );
510
+ static_assert (
511
+ DIM >= 1 && DIM <= KokkosFFT::MAX_FFT_DIM,
512
+ " ifftn: the Rank of FFT axes must be between 1 and MAX_FFT_DIM" );
513
+ static_assert (
514
+ InViewType::rank () >= DIM,
515
+ " ifftn: View rank must be larger than or equal to the Rank of FFT axes" );
484
516
485
517
KokkosFFT::Impl::Plan plan (exec_space, in, out,
486
518
KokkosFFT::Direction::backward, axes, s);
@@ -509,6 +541,12 @@ void rfftn(const ExecutionSpace& exec_space, const InViewType& in,
509
541
" type (float/double), the same layout (LayoutLeft/LayoutRight), and the "
510
542
" same rank. ExecutionSpace must be accessible to the data in InViewType "
511
543
" and OutViewType." );
544
+ static_assert (
545
+ DIM >= 1 && DIM <= KokkosFFT::MAX_FFT_DIM,
546
+ " rfftn: the Rank of FFT axes must be between 1 and MAX_FFT_DIM" );
547
+ static_assert (
548
+ InViewType::rank () >= DIM,
549
+ " rfftn: View rank must be larger than or equal to the Rank of FFT axes" );
512
550
513
551
using in_value_type = typename InViewType::non_const_value_type;
514
552
using out_value_type = typename OutViewType::non_const_value_type;
@@ -543,6 +581,12 @@ void irfftn(const ExecutionSpace& exec_space, const InViewType& in,
543
581
" type (float/double), the same layout (LayoutLeft/LayoutRight), and the "
544
582
" same rank. ExecutionSpace must be accessible to the data in InViewType "
545
583
" and OutViewType." );
584
+ static_assert (
585
+ DIM >= 1 && DIM <= KokkosFFT::MAX_FFT_DIM,
586
+ " irfftn: the Rank of FFT axes must be between 1 and MAX_FFT_DIM" );
587
+ static_assert (
588
+ InViewType::rank () >= DIM,
589
+ " irfftn: View rank must be larger than or equal to the Rank of FFT axes" );
546
590
547
591
using in_value_type = typename InViewType::non_const_value_type;
548
592
using out_value_type = typename OutViewType::non_const_value_type;
0 commit comments