• Lei Wang's avatar
    [Atomic] Use ptr for atomicAdd dst instead of reference (#1425) · 3546e2ee
    Lei Wang authored
    * [Enhancement] Update AtomicAdd function signature to accept pointer to destination
    
    * Modified AtomicAdd in CUDA to take a pointer instead of a reference for the destination argument.
    * Updated related code in atomicadd_vectorize.cc to ensure compatibility with the new signature.
    * Adjusted Python interface in atomic.py to pass the destination by pointer, aligning with device function requirements.
    
    * [Enhancement] Refactor AtomicAddRet function signature to accept pointer
    
    * Updated AtomicAddRet in both CUDA and HIP to take a pointer instead of a reference for the address argument, improving consistency with the AtomicAdd function.
    * Adjusted the implementation to ensure proper reinterpretation of the address type for atomic operations.
    
    * lint fix
    
    * [Enhancement] Refactor AtomicAddNode::MakeSIMTLoop to use destination pointer
    
    * Updated the MakeSIMTLoop function to build a pointer to the destination element using tvm_access_ptr instead of loading the destination value directly.
    * Simplified the handling of source and destination predicates, improving clarity and maintainability of the code.
    * Ensured compatibility with the new pointer-based approach for atomic operations.
    
    * lint fix
    
    * test fix
    
    * lint fix
    3546e2ee
common.h 4.18 KB