-
Notifications
You must be signed in to change notification settings - Fork 97
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Provide test for the Blelloch algorithm
- Loading branch information
Showing
2 changed files
with
13 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -33,7 +33,7 @@ | |
__contact__ = "[email protected]" | ||
__license__ = "MIT" | ||
__copyright__ = "2013 European Synchrotron Radiation Facility, Grenoble, France" | ||
__date__ = "30/10/2024" | ||
__date__ = "06/11/2024" | ||
|
||
import logging | ||
import numpy | ||
|
@@ -172,7 +172,6 @@ def test_Hillis_Steele(self): | |
self.assertTrue(good, "Cumsum calculation is correct for WG=%s" % wg) | ||
|
||
@unittest.skipUnless(ocl, "pyopencl is missing") | ||
@unittest.skip("Fix me") | ||
def test_Blelloch(self): | ||
""" | ||
tests the Blelloch scan function | ||
|
@@ -192,8 +191,8 @@ def test_Blelloch(self): | |
logger.error("Error %s on WG=%s: Hillis_Steele", error, wg) | ||
break | ||
else: | ||
res = scan_d.get().reshape((-1, wg)) | ||
ref = numpy.array([numpy.cumsum(i) for i in self.data.reshape((-1, wg))]) | ||
res = scan_d.get().reshape((-1, 2*wg)) | ||
ref = numpy.array([numpy.cumsum(i) for i in self.data.reshape((-1, 2*wg))]) | ||
good = numpy.allclose(res, ref) | ||
if not good: | ||
print(ref) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters