Skip to content

Fix coverage for ufuncs#240

Merged
bryevdv merged 1 commit intonv-legate:branch-22.03from
bryevdv:bryanv/ufunc_coverage
Mar 29, 2022
Merged

Fix coverage for ufuncs#240
bryevdv merged 1 commit intonv-legate:branch-22.03from
bryevdv:bryanv/ufunc_coverage

Conversation

@bryevdv
Copy link
Contributor

@bryevdv bryevdv commented Mar 29, 2022

This fixes the issue with ufuncs not being considered in the coverage reports, and also fixed them being missing from the comarison table:

legate37 ❯ cat foo.py 
import cunumeric as np

a = np.ndarray([1,2])
np.arccos(a)

~/work/cunumeric bryanv/ufunc_coverage*
legate37 ❯ legate foo.py --gpus 2 -cunumeric:report:coverage -cunumeric:report:dump-csv out.csv
cuNumeric API coverage: 3/3 (100.0%)
 
~/work/cunumeric bryanv/ufunc_coverage*
legate37 ❯ cat out.csv 
function_name,location,implemented
numpy.ndarray.__init__,foo.py:3,True
numpy.arccos,foo.py:4,True
numpy.ndarray.__init__,foo.py:4,True

image


# todo: (bev) use callback protocol type starting with 3.8
def implemented(func: Any, prefix: str) -> Any:
name = f"{prefix}.{func.__name__}"
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can't rely on __name__ since binary_ufunc, etc do not have

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can add that property if that's necessary.

@bryevdv
Copy link
Contributor Author

bryevdv commented Mar 29, 2022

noting all tests pass for me locally with ./test.py --use=cuda

@bryevdv bryevdv requested a review from magnatelee March 29, 2022 21:01
@bryevdv bryevdv merged commit d8e2de5 into nv-legate:branch-22.03 Mar 29, 2022
@bryevdv bryevdv deleted the bryanv/ufunc_coverage branch March 29, 2022 22:53
ipdemes pushed a commit to ipdemes/cunumeric that referenced this pull request Jun 7, 2022
manopapad added a commit that referenced this pull request Nov 17, 2024
The conda install will take care of this automatically, and
this list will almost certainly bitrot
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants