mirror of
https://gitlab.com/libeigen/eigen.git
synced 2025-04-20 08:39:37 +08:00
Fix testing of log nearby 1
This commit is contained in:
parent
7acf23c14c
commit
d7a0e52478
@ -188,7 +188,10 @@ void test_cuda_trancendental() {
|
|||||||
}
|
}
|
||||||
for (int i = 0; i < num_elem; ++i) {
|
for (int i = 0; i < num_elem; ++i) {
|
||||||
std::cout << "Checking elemwise log " << i << " input = " << input2(i) << " full = " << full_prec2(i) << " half = " << half_prec2(i) << std::endl;
|
std::cout << "Checking elemwise log " << i << " input = " << input2(i) << " full = " << full_prec2(i) << " half = " << half_prec2(i) << std::endl;
|
||||||
VERIFY_IS_APPROX(full_prec2(i), half_prec2(i));
|
if(std::abs(input2(i)-1.f)<0.05f) // log lacks accurary nearby 1
|
||||||
|
VERIFY_IS_APPROX(full_prec2(i)+Eigen::half(0.1f), half_prec2(i)+Eigen::half(0.1f));
|
||||||
|
else
|
||||||
|
VERIFY_IS_APPROX(full_prec2(i), half_prec2(i));
|
||||||
}
|
}
|
||||||
gpu_device.deallocate(d_float1);
|
gpu_device.deallocate(d_float1);
|
||||||
gpu_device.deallocate(d_float2);
|
gpu_device.deallocate(d_float2);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user