jorisvandenbossche commented on code in PR #40385: URL: https://github.com/apache/arrow/pull/40385#discussion_r1542439688
########## python/pyarrow/__init__.py: ########## @@ -281,6 +281,13 @@ def print_entry(label, value): import pyarrow.types as types +try: + # Try importing the cuda module to ensure libarrow_cuda gets loaded + # to register the CUDA device for the C Data Interface import + import pyarrow.cuda +except ImportError: Review Comment: > If easily possible, otherwise just everytime some device array is imported. The current version of the PR already does it only when importing a device array (in Python). But we have the struct pointer, so it should be easy to just check `ArrowDeviceArray.device_type == 2` before calling the C++ Import function -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
