Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New commit also fixes Bug #400 (bigpdl slice-of-slice problem) #157

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions Basic/Core/Makefile.PL
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ my $pthread_include = $Config::Config{usrinc}; # not good for win32
my $pthread_library = '-lpthread'; # not good for MSVC
my $pthread_define = ' -DPDL_PTHREAD ';

my $macos_braindamage_define = ($^O eq 'darwin') ? " -DMACOS_MZERO_BRAINDAMAGE " : "";
my $badval_define = " -DBADVAL=$PDL::Config{WITH_BADVAL} -DBADVAL_USENAN=$PDL::Config{BADVAL_USENAN} -DBADVAL_PER_PDL=$PDL::Config{BADVAL_PER_PDL}";

my $malloclib = $PDL::Config{MALLOCDBG}->{libs};
Expand Down Expand Up @@ -239,7 +238,7 @@ WriteMakefile(
},
'PL_FILES' => {map {($_ => nopl $_)} grep {!/^Makefile.PL$/} <*.PL>},
'OBJECT' => 'Core$(OBJ_EXT) ' . $cobj,
'DEFINE' => $pthread_define.$macos_braindamage_define.$badval_define,
'DEFINE' => $pthread_define.$badval_define,
'LIBS' => ["$pthread_library $malloclib"],
'clean' => {'FILES' => $cobj .
' pdlconv.c pdlsections.c pdlcore.c '.
Expand Down
2 changes: 1 addition & 1 deletion Basic/Core/pdlapi.c
Original file line number Diff line number Diff line change
Expand Up @@ -1497,7 +1497,7 @@ void pdl_make_physvaffine(pdl *it)
it->vafftrans->incs[i] = incsleft[i];
}
{
int offset_left = it->vafftrans->offs;
PDL_Indx offset_left = it->vafftrans->offs;
inc = it->vafftrans->offs;
newinc = 0;
for(j=current->ndims-1; j>=0 && current->dimincs[j] != 0; j--) {
Expand Down
5 changes: 0 additions & 5 deletions Basic/Core/pdlsections.g
Original file line number Diff line number Diff line change
Expand Up @@ -230,11 +230,6 @@ PDL_Anyval pdl_at( void* x, int datatype, PDL_Indx* pos, PDL_Indx* dims,

ENDGENERICLOOP

#ifdef MACOS_MZERO_BRAINDAMAGE
if(!result)
result=0;
#endif

return result;
}

Expand Down
7 changes: 6 additions & 1 deletion t/bigmem.t
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ BEGIN {
if ($ENV{AUTOMATED_TESTING} or $ENV{CI_TESTING}) {
plan skip_all => 'bigmem tests skipped to avoid OOM fails';
} else {
plan tests => 1;
plan tests => 2;
}
}

Expand All @@ -35,6 +35,11 @@ $PDL::BIGPDL = 1; # should this be the defaults for 64bit index support?
my $bigbyte = ones( byte, 5*1024*1024*1024+17 );
ok( $bigbyte->shape->sclr == $bigbyte->nelem, "shape handles indx dims > 4GiB");

$bigbyte = ones(byte, 2**30, 4);
my $aaa = $bigbyte->slice("3:-10");
my $bbb = $aaa->slice(":,3");
ok( $bbb->sum == $bbb->nelem, "slices of slices of giant PDLs seem to work right");

# ndims
# getndims
# dim
Expand Down