Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Deivce][DeivceGuard] Solutions for refactoring #8

Open
shink opened this issue Jul 16, 2024 · 0 comments
Open

[Deivce][DeivceGuard] Solutions for refactoring #8

shink opened this issue Jul 16, 2024 · 0 comments
Assignees

Comments

@shink
Copy link
Collaborator

shink commented Jul 16, 2024

1. NPUFunctions.h

  1. 参考 CUDA 实现:https://github.com/pytorch/pytorch/blob/main/c10/cuda/CUDAFunctions.cpp,API和实现逻辑尽量与其保持一致

  2. ACL 和 CUDA API 的差异单独抽取一层,使 NPUFunctionsCUDAFunctions 尽量保持高度一致

    比如:aclrtGetDevice()cudaGetDevice() 存在差异,后者可直接获取当前设备,而前者在返回 ACL_ERROR_RT_CONTEXT_NULL 错误码时也是正常的,此错误码表示先前尚未 SetDevice 或创建 Context
    CANN 文档:https://www.hiascend.com/document/detail/zh/CANNCommunityEdition/80RC2alpha003/apiref/appdevgapi/aclcppdevg_03_0040.html

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant