Skip to content

Commit 6c2f2e9

Browse files
committedNov 28, 2024·
use par_realdims instead of RANK, drop gnu99
1 parent b9d5c0f commit 6c2f2e9

File tree

2 files changed

+3
-5
lines changed

2 files changed

+3
-5
lines changed
 

‎Makefile.PL

-2
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,6 @@ my @package = (qw(fftw3.pd FFTW3 PDL::FFTW3), undef, 1);
4646
my %descriptor = pdlpp_stdargs(\@package);
4747

4848
$descriptor{VERSION_FROM} = 'fftw3.pd';
49-
$descriptor{OPTIMIZE} = ($Config{ccname} =~ m/gcc/) ? '-O2' : $Config{optimize};
50-
$descriptor{CCFLAGS} .= ( ($Config{ccname} =~ m/gcc/) ? '--std=gnu99 ' : '' ) . $Config{ccflags};
5149

5250
# I support single and double precision FFTW calls, so both fftw and fftw3f
5351
push @{$descriptor{LIBS} }, $libs;

‎fftw3.pd

+3-3
Original file line numberDiff line numberDiff line change
@@ -47,14 +47,14 @@ $TFD(fftwf_,fftw_)plan plan = INT2PTR($TFD(fftwf_,fftw_)plan, $COMP(plan));
4747
$TFD(fftwf_,fftw_)execute_dft_r2c(plan, (void*)$P(real), (void*)$P(complexv));
4848
EOF
4949
my $TEMPLATE_REAL_C2R = <<'EOF';
50-
// RANK is replaced with the rank of this transform
5150
// make sure the PDL data type I'm using matches the FFTW data type
5251
static_assert_fftw(sizeof($GENERIC()) == sizeof($TGC(fftwf_,fftw_)complex));
5352
$TGC(fftwf_,fftw_)plan plan = INT2PTR($TGC(fftwf_,fftw_)plan, $COMP(plan));
5453
// FFTW inverse real transforms clobber their input. I thus make a new
5554
// buffer and transform from there
5655
unsigned long nelem = 1;
57-
for( int i=0; i<=RANK; i++ )
56+
PDL_Indx i, rank = $PRIV(vtable)->par_realdims[0];
57+
for( i=0; i<rank; i++ )
5858
nelem *= $PDL(complexv)->dims[i];
5959
unsigned long elem_scale = sizeof($GENERIC()) / sizeof( $TGC(float,double) ); /* native complex */
6060
void *input_copy = $TGC(fftwf_,fftw_)alloc_real( nelem * elem_scale );
@@ -760,7 +760,7 @@ if( $PDL(real)->dims[0] <= 0 )
760760
$SIZE(n1) = 2*$PDL(complexv)->dims[0] - 2;
761761
EOF
762762
$pp_def{Pars} = "complexv($dims_complex_string); real [o]real($dims_real_string);";
763-
$pp_def{Code} = $TEMPLATE_REAL_C2R =~ s/RANK/$rank-1/gre;
763+
$pp_def{Code} = $TEMPLATE_REAL_C2R;
764764
$pp_def{GenericTypes} = [qw(G C)];
765765
pp_def( "__irNfft$rank", %pp_def );
766766
}

0 commit comments

Comments
 (0)
Please sign in to comment.