Kathryn-cat commented on code in PR #18519:
URL: https://github.com/apache/tvm/pull/18519#discussion_r2614879158


##########
python/tvm/contrib/nvcc.py:
##########
@@ -184,6 +229,170 @@ def compile_cuda(code, target_format=None, arch=None, 
options=None, path_target=
         return data
 
 
+def _compile_cuda_nvrtc(code, target_format=None, arch=None, options=None):
+    """Compile CUDA code using NVRTC (NVIDIA Runtime Compilation).
+
+    Parameters
+    ----------
+    code : str
+        The CUDA source code.
+    target_format : str, optional
+        Output format: "cubin" or "ptx". Default: "cubin"
+    arch : str, optional
+        Target architecture (e.g., "sm_80"). Auto-detected if None.
+    options : str or list of str, optional
+        Additional NVRTC options.
+
+    Returns
+    -------
+    bytearray
+        Compiled binary data.
+    """
+    try:
+        from cuda.bindings import nvrtc  # pylint: 
disable=import-outside-toplevel
+    except ImportError as e:
+        raise RuntimeError(
+            "cuda-python is not available. Install with: pip install 
cuda-python\n"

Review Comment:
   thanks, updated



-- 
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]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to