Skip to content

Add __name__ attribute to CUDAUFuncDispatcher and test case - #8297

Merged
sklam merged 1 commit into
numba:mainfrom
testhound:testhound/cuda_func_dispatcher_8272
Aug 5, 2022
Merged

sklam merged 1 commit into
numba:mainfrom
testhound:testhound/cuda_func_dispatcher_8272

Conversation

@testhound

Copy link
Copy Markdown
Contributor

This pull request addresses issue 8272: #8272.

@testhound
testhound requested a review from gmarkall as a code owner July 28, 2022 22:43
@testhound

Copy link
Copy Markdown
Contributor Author

gpuci run tests

@gmarkall gmarkall left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks for the PR - this looks good to me and the reproducer from #8272 now runs with this PR.

Note that it is still broken for GUFuncs. For example, applying:

diff --git a/numba/cuda/tests/cudapy/test_gufunc.py b/numba/cuda/tests/cudapy/test_gufunc.py
index aeda5dac7..0c3952795 100644
--- a/numba/cuda/tests/cudapy/test_gufunc.py
+++ b/numba/cuda/tests/cudapy/test_gufunc.py
@@ -304,6 +304,10 @@ class TestCUDAGufunc(CUDATestCase):
              np.asarray((4.5, 5.5, 6.5)))
         self.check_tuple_arg(a, b)
 
+    def test_gufunc_name(self):
+        gufunc = _get_matmulcore_gufunc(max_blocksize=512)
+        self.assertEqual(gufunc.__name__, 'matmulcore')
+
 
 if __name__ == '__main__':
     unittest.main()

results in a test failure:

======================================================================
ERROR: test_gufunc_name (numba.cuda.tests.cudapy.test_gufunc.TestCUDAGufunc)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/gmarkall/numbadev/numba/numba/cuda/tests/cudapy/test_gufunc.py", line 309, in test_gufunc_name
    self.assertEqual(gufunc.__name__, 'matmulcore')
AttributeError: 'CUDAGenerializedUFunc' object has no attribute '__name__'

Perhaps a follow-up to add __name__ to CUDA GUFuncs would be appropriate. (Also, if the follow-up corrected the name of CUDAGenerializedUFunc that would be awesome, that typo is quite annoying! 🙂)

@gmarkall gmarkall added 5 - Ready to merge Review and testing done, is ready to merge and removed 3 - Ready for Review labels Aug 5, 2022
@sklam
sklam merged commit aaa6a00 into numba:main Aug 5, 2022
@testhound

Copy link
Copy Markdown
Contributor Author

@gmarkall I added a new PR for the GUFunc failure: #8320

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

5 - Ready to merge Review and testing done, is ready to merge Effort - short Short size effort needed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants