@@ -3,10 +3,10 @@ use warnings;
3
3
use Test::More;
4
4
use PDL::LiteF;
5
5
use Benchmark qw( timethese :hireswallclock) ;
6
+ use Test::PDL -atol => 0.01; # set eps
6
7
7
8
plan skip_all => ' No threads' if !PDL::Core::pthreads_enabled;
8
9
9
- approx( pdl(0), pdl(0), 0.01); # set eps
10
10
set_autopthread_size(0);
11
11
12
12
for (
@@ -64,7 +64,7 @@ for (@T) {
64
64
65
65
$thr_check -> ();
66
66
67
- ok all(approx $pa ,$pb ) , " pa and pb match $label " or diag " diff at: " , ( $pa != $pb ) -> whichND. " " ;
67
+ is_pdl $pa ,$pb , " pa and pb match $label " ;
68
68
}
69
69
70
70
{
@@ -74,7 +74,7 @@ for (@T) {
74
74
my $pc = inner $pa , $pb ;
75
75
$thr_off -> ($pa );
76
76
my $cc = $pa -> sumover;
77
- ok all(approx( $pc ,$cc )) , " inner $label " or diag " pc= $pc \n cc= $cc " ;
77
+ is_pdl $pc , $cc , " inner $label " ;
78
78
}
79
79
80
80
{
@@ -85,7 +85,7 @@ for (@T) {
85
85
$pa +=1;
86
86
$thr_off -> ($pb );
87
87
$pb +=1;
88
- ok all(approx $pa , $pb ) , " += $label " ;
88
+ is_pdl $pa , $pb , " += $label " ;
89
89
}
90
90
91
91
# ## Multi-dimensional incrementing case ###
@@ -122,11 +122,11 @@ for (@T) {
122
122
123
123
# Check for writeback to the parent PDL working (should have three ones in the array)
124
124
my $lutExSum = $lutEx -> sum;
125
- ok all(approx( $lutExSum , pdl(3)) ), " writeback $label " ;
125
+ is_pdl $lutExSum , pdl(3), " writeback $label " ;
126
126
127
127
# Check for inplace assignment working. $in should be all ones
128
128
my $inSum = $in -> sum;
129
- ok all(approx( $inSum , pdl(2) ) ), " inplace $label " ;
129
+ is_pdl $inSum , pdl(2), " inplace $label " ;
130
130
}
131
131
132
132
{
@@ -158,11 +158,11 @@ for (@T) {
158
158
159
159
# Check for writeback to the parent PDL working (should have three ones in the array)
160
160
my $lutExSum = $lutEx -> sum;
161
- ok all(approx( $lutExSum , pdl(5)) ), " writeback with different magic $label " ;
161
+ is_pdl $lutExSum , pdl(5), " writeback with different magic $label " ;
162
162
163
163
# Check for inplace assignment working. $in should be all ones
164
164
my $inSum = $in -> sum;
165
- ok all(approx( $inSum , pdl(2)) ), " inplace with different magic $label " ;
165
+ is_pdl $inSum , pdl(2), " inplace with different magic $label " ;
166
166
}
167
167
}
168
168
0 commit comments