yifeifang opened a new pull request, #209:
URL: https://github.com/apache/tvm-ffi/pull/209

   This PR enhances the documentation and examples for C++ developers, 
particularly focusing on CUDA usage and development environment
     setup.
   
     ### Changes
   
     #### New Examples
     - **Add `examples/quickstart/load/load_cuda.cc`**: New C++ example 
demonstrating how to load and execute CUDA FFI functions using custom 
     CUDA memory allocators
     - **Update `examples/quickstart/raw_compile.sh`**: Add Example 4 showing 
compilation and execution of the CUDA loading example with
     proper CUDA include/library paths
   
     #### Documentation Improvements
     - **`docs/guides/cpp_guide.md`**: Add comprehensive "Distribution and ABI 
Compatibility" section
       - Explains glibc versioning challenges for kernel distributors
       - Documents the manylinux approach for cross-platform binary distribution
       - Provides practical guidance for building compatible C++ and CUDA 
libraries
       - Includes verification commands and recommended Docker images
       - Addresses the producer/consumer perspective on ABI compatibility
   
     - **`CONTRIBUTING.md`**: Add "Setting Up Pre-commit Hooks" section
       - Installation instructions with minimum version requirements 
(pre-commit 2.18.0+)
       - Complete list of all pre-commit hooks with exact versions
       - Troubleshooting guide for common issues
       - Documents all hook dependencies and configuration details
   
     #### Infrastructure
     - **`tests/docker/Dockerfile`**: Upgrade pip to latest version in 
development container
   
     ### Motivation
   
     1. **CUDA Examples**: The existing examples showed Python CUDA usage 
(`load_cupy.py`, `load_pytorch.py`) and CPU C++ usage 
     (`load_cpp.cc`), but lacked a pure C++ CUDA example. This addition 
provides a complete picture of FFI usage patterns.
   
     2. **ABI Documentation**: Based on discussions about glibc compatibility 
issues when distributing kernels, this documentation 
     helps kernel authors understand and avoid common pitfalls when building 
cross-platform binaries. **The original issue encountered is when building FFI 
from source with a newer glibc which caused FFI symbol has dependency on 
certain new version of glibc**
   
     3. **Development Setup**: Contributors were encountering pre-commit 
version issues (2.17.0 vs 2.18.0+). This documentation prevents such 
     issues and provides a comprehensive reference for all tooling requirements.
   
     ### Testing
   
     - All pre-commit hooks pass
     - CUDA example compiles successfully in the Docker development environment
     - Documentation follows markdown linting rules


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