Skip to content

Avoid using non-versioned PFN_* which will go away#4344

Merged
wujingyue merged 1 commit intomainfrom
wjy/driver
Apr 29, 2025
Merged

Avoid using non-versioned PFN_* which will go away#4344
wujingyue merged 1 commit intomainfrom
wjy/driver

Conversation

@wujingyue
Copy link
Collaborator

No description provided.

@wujingyue wujingyue requested a review from zasdfgbnm April 29, 2025 21:41
@wujingyue
Copy link
Collaborator Author

!test

@github-actions
Copy link

Description

  • Replace non-versioned PFN_* with versioned function pointers

  • Update macro definitions for driver API wrappers


Changes walkthrough 📝

Relevant files
Enhancement
driver_api.cpp
Update driver API wrapper to use versioned function pointers

csrc/driver_api.cpp

  • Replaced PFN_##funcName with decltype(::funcName)* in
    DEFINE_DRIVER_API_WRAPPER
  • Updated function pointer declaration in lazilyLoadAndInvoke
  • +2/-2     
    driver_api.h
    Update macro for driver API wrappers                                         

    csrc/driver_api.h

  • Replaced PFN_##funcName with decltype(::funcName)* in
    DECLARE_DRIVER_API_WRAPPER
  • +2/-1     

    PR Reviewer Guide 🔍

    Here are some key observations to aid the review process:

    🧪 No relevant tests
    ⚡ Recommended focus areas for review

    Possible Issue

    The static variable f is declared inside the lazilyLoadAndInvoke function, which means it will be reinitialized every time the function is called. This could lead to incorrect behavior as the function is expected to load the driver entry point only once.

    static decltype(::funcName)* f;                                     \
    Declaration Consistency

    The declaration of funcName in driver_api.h uses decltype(::funcName)*, while in driver_api.cpp it uses decltype(::funcName)* f. Ensure that the declaration and definition are consistent to avoid potential issues.

    #define DECLARE_DRIVER_API_WRAPPER(funcName) \

    @wujingyue wujingyue merged commit f0271ab into main Apr 29, 2025
    51 of 53 checks passed
    @wujingyue wujingyue deleted the wjy/driver branch April 29, 2025 23:59
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

    Labels

    None yet

    Projects

    None yet

    Development

    Successfully merging this pull request may close these issues.

    2 participants