-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix for floordiv on GPU target (spcl#1471)
This PR addresses a `floordiv` runtime error detected on GPU target: `std::ifloor` returns zero with integer argument (for example, the result of an `int` division). --------- Co-authored-by: Tal Ben-Nun <[email protected]>
- Loading branch information
Showing
3 changed files
with
44 additions
and
4 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
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
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 |
---|---|---|
@@ -0,0 +1,26 @@ | ||
# Copyright 2019-2023 ETH Zurich and the DaCe authors. All rights reserved. | ||
import dace | ||
import pytest | ||
|
||
from common import compare_numpy_output | ||
|
||
""" | ||
Test CUDA code generation for a subset of numpy-like functions on GPU target. | ||
Only a subset of the numpy tests is executed on GPU target to keep the test | ||
execution time within a reasonable limit. This is of particular interest for | ||
CI regression tests. These testcases are mainly supposed to cover GPU-related | ||
issues reported to the DaCe porject or special cases for GPU code generation. | ||
""" | ||
gpu_device = dace.dtypes.DeviceType.GPU | ||
|
||
|
||
# special case where `dace::math::ifloor` argument is integral | ||
@pytest.mark.gpu | ||
@compare_numpy_output(device=gpu_device, non_zero=True, positive=True) | ||
def test_floordiv(A: dace.int64[5, 5], B: dace.int64[5, 5]): | ||
return A // B | ||
|
||
|
||
if __name__ == '__main__': | ||
test_floordiv() |