From 3eae1ecf8733199e8f028b1e8310a798019d9333 Mon Sep 17 00:00:00 2001 From: tangpeiqi96 Date: Tue, 14 May 2024 19:37:11 +0800 Subject: [PATCH] delete extra deviceGuard --- op_plugin/utils/op_api_common.h | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/op_plugin/utils/op_api_common.h b/op_plugin/utils/op_api_common.h index 906e8136a..bf766fae4 100644 --- a/op_plugin/utils/op_api_common.h +++ b/op_plugin/utils/op_api_common.h @@ -32,7 +32,6 @@ #include "torch_npu/csrc/framework/utils/OpPreparation.h" #include "torch_npu/csrc/framework/interface/EnvVariables.h" #include "torch_npu/csrc/aten/NPUNativeFunctions.h" -#include "torch_npu/csrc/core/npu/NPUGuard.h" typedef struct aclOpExecutor aclOpExecutor; typedef struct aclTensor aclTensor; @@ -630,8 +629,6 @@ auto DecodeDevice(Ts&... args) -> at::Device */ #define EXEC_NPU_CMD(aclnn_api, ...) \ do { \ - auto device = DecodeDevice(__VA_ARGS__); \ - c10_npu::NPUGuard guard(device); \ static const auto getWorkspaceSizeFuncAddr = GetOpApiFuncAddr(#aclnn_api "GetWorkspaceSize"); \ static const auto opApiFuncAddr = GetOpApiFuncAddr(#aclnn_api); \ static const auto initMemAddr = GetOpApiFuncAddr("InitHugeMemThreadLocal"); \ @@ -691,10 +688,6 @@ auto DecodeDevice(Ts&... args) -> at::Device */ #define EXEC_NPU_COPY_CMD(aclnn_api, ...) \ do { \ - auto args_tuple = std::make_tuple(__VA_ARGS__); \ - auto second_tensor = std::get<1>(args_tuple); \ - auto device = second_tensor.device(); \ - c10_npu::NPUGuard guard(device); \ static const auto getWorkspaceSizeFuncAddr = GetOpApiFuncAddr(#aclnn_api "GetWorkspaceSize"); \ static const auto opApiFuncAddr = GetOpApiFuncAddr(#aclnn_api); \ static const auto initMemAddr = GetOpApiFuncAddr("InitHugeMemThreadLocal"); \ @@ -749,8 +742,6 @@ auto DecodeDevice(Ts&... args) -> at::Device #define EXEC_NPU_NO_FORMAT_CHECK_CMD(aclnn_api, ...) \ do { \ - auto device = DecodeDevice(__VA_ARGS__); \ - c10_npu::NPUGuard guard(device); \ static const auto getWorkspaceSizeFuncAddr = GetOpApiFuncAddr(#aclnn_api "GetWorkspaceSize"); \ static const auto opApiFuncAddr = GetOpApiFuncAddr(#aclnn_api); \ static const auto initMemAddr = GetOpApiFuncAddr("InitHugeMemThreadLocal"); \ @@ -872,8 +863,6 @@ private: */ #define EXEC_NPU_CMD_SYNC(aclnn_api, ...) \ [](const char *apiName, const char *workspaceSizeApiName, auto &...args) -> auto { \ - auto device = DecodeDevice(args...); \ - c10_npu::NPUGuard guard(device); \ static const auto getWorkspaceSizeFuncAddr = GetOpApiFuncAddr(workspaceSizeApiName); \ static const auto opApiFuncAddr = GetOpApiFuncAddr(apiName); \ static const auto initMemAddr = GetOpApiFuncAddr("InitHugeMemThreadLocal"); \ -- Gitee