Commit 6ecc07d56a2688e3fa08c8602abd5f076d45a6f5

Authored by Hu Chunming
1 parent c434950c

删除aclrtSetDevice

src/ai_engine_module/VPTProcess.cpp
... ... @@ -41,7 +41,6 @@ int VPTProcess::init(VPTProcess_PARAM vparam){
41 41 param.max_batch = 16;
42 42  
43 43 m_devId = param.devId;
44   - ACL_CALL(aclrtSetDevice(m_devId), ACL_SUCCESS, -1);
45 44 ACL_CALL(aclrtCreateContext(&m_algorthim_ctx, m_devId), ACL_SUCCESS, -1);
46 45  
47 46 int ret = vpt_init(&m_det_handle, param);
... ... @@ -70,8 +69,6 @@ int VPTProcess::process_gpu(sy_img * batch_img, vector<string>& tasklist,
70 69 }
71 70  
72 71 do{
73   -
74   - aclrtSetDevice(m_devId);
75 72 int ret = aclrtSetCurrentContext(m_algorthim_ctx);
76 73  
77 74 /* 路数太多时 按照最大batchsize数 拆批次运行 */
... ...
src/ai_engine_module/VPTProcess.cpp_debug
... ... @@ -38,7 +38,6 @@ int VPTProcess::init(VPTProcess_PARAM vparam){
38 38 param.isTrk = false;
39 39  
40 40 m_devId = param.devId;
41   - ACL_CALL(aclrtSetDevice(m_devId), ACL_ERROR_NONE, -1);
42 41 ACL_CALL(aclrtCreateContext(&m_algorthim_ctx, m_devId), ACL_ERROR_NONE, -1);
43 42  
44 43 int ret = vpt_init(&m_det_handle, param);
... ... @@ -81,7 +80,6 @@ int VPTProcess::process_gpu(sy_img * batch_img, vector<DeviceMemory*> vec_vptMem
81 80  
82 81 vpt_result *real_res = vpt_det_result + startbatch;
83 82  
84   - aclrtSetDevice(m_devId);
85 83 int ret = aclrtSetCurrentContext(m_algorthim_ctx);
86 84 if(ACL_ERROR_NONE != ret){
87 85 break;
... ...
src/ai_engine_module/face_det_ai_engine.cpp
... ... @@ -16,7 +16,6 @@ face_det_ai_engine::~face_det_ai_engine(){
16 16 clear();
17 17  
18 18 if(m_algorthim_ctx){
19   - aclrtSetDevice(m_devId);
20 19 aclrtDestroyContext(m_algorthim_ctx);
21 20 }
22 21 }
... ... @@ -27,7 +26,6 @@ int face_det_ai_engine::init_ai_engine(const facedet_ai_engine_param &ai_param/*
27 26  
28 27 m_devId = ai_param.sdk_param.devId;
29 28  
30   - ACL_CALL(aclrtSetDevice(m_devId), ACL_ERROR_NONE, -1);
31 29 ACL_CALL(aclrtCreateContext(&m_algorthim_ctx, m_devId), ACL_ERROR_NONE, -1);
32 30  
33 31 return fd_init(&handle, ai_param.sdk_param);
... ... @@ -42,7 +40,6 @@ int face_det_ai_engine::ai_engine_process_batch(std::vector<std::string> &task_i
42 40 return 0;
43 41 }
44 42  
45   - aclrtSetDevice(m_devId);
46 43 int ret = aclrtSetCurrentContext(m_algorthim_ctx);
47 44 if(ACL_ERROR_NONE != ret){
48 45 return 0;
... ...
src/ai_engine_module/motocycle_hs_process.cpp
... ... @@ -99,7 +99,6 @@ namespace ai_engine_module
99 99 param.max_batch = 8;
100 100  
101 101 m_devId = param.devId;
102   - ACL_CALL(aclrtSetDevice(m_devId), ACL_SUCCESS, -1);
103 102 ACL_CALL(aclrtCreateContext(&m_algorthim_ctx, m_devId), ACL_SUCCESS, -1);
104 103  
105 104 int status;
... ...
src/ai_engine_module/motocycle_phone_process.cpp
... ... @@ -102,7 +102,6 @@ namespace ai_engine_module
102 102 param.max_batch = 8;
103 103  
104 104 m_devId = param.devId;
105   - ACL_CALL(aclrtSetDevice(m_devId), ACL_SUCCESS, -1);
106 105 ACL_CALL(aclrtCreateContext(&m_algorthim_ctx, m_devId), ACL_SUCCESS, -1);
107 106  
108 107 int status;
... ...
src/ai_engine_module/motocycle_refit_phone_process.cpp
... ... @@ -117,7 +117,6 @@ namespace ai_engine_module
117 117 hcp_param.max_batch = 8;
118 118  
119 119 m_devId = gpu_id;
120   - ACL_CALL(aclrtSetDevice(m_devId), ACL_SUCCESS, -1);
121 120 ACL_CALL(aclrtCreateContext(&m_algorthim_ctx, m_devId), ACL_SUCCESS, -1);
122 121  
123 122 int status;
... ...
src/ai_engine_module/motocycle_refit_process.cpp
... ... @@ -103,7 +103,6 @@ namespace ai_engine_module
103 103 param.max_batch = 8;
104 104  
105 105 m_devId = param.devId;
106   - ACL_CALL(aclrtSetDevice(m_devId), ACL_SUCCESS, -1);
107 106 ACL_CALL(aclrtCreateContext(&m_algorthim_ctx, m_devId), ACL_SUCCESS, -1);
108 107  
109 108 int status;
... ...
src/ai_engine_module/road_seg_3cls_statistics.cpp
... ... @@ -213,7 +213,6 @@ int Road3clsSegProcess::init(int gpu_id, string models_dir) {
213 213 param.devId = gpu_id;
214 214  
215 215 m_devId = param.devId;
216   - ACL_CALL(aclrtSetDevice(m_devId), ACL_SUCCESS, -1);
217 216 ACL_CALL(aclrtCreateContext(&m_algorthim_ctx, m_devId), ACL_SUCCESS, -1);
218 217  
219 218 int ret = rs3cls_init(&m_seg_handle, param);
... ...
src/ai_engine_module/road_seg_correlation_algor.cpp
... ... @@ -545,7 +545,6 @@ namespace ai_engine_module
545 545 param.devId = gpu_id;*/
546 546  
547 547 m_devId = gpu_id;
548   - ACL_CALL(aclrtSetDevice(m_devId), ACL_SUCCESS, -1);
549 548 ACL_CALL(aclrtCreateContext(&m_algorthim_ctx, m_devId), ACL_SUCCESS, -1);
550 549  
551 550 /*int status;
... ...
src/ai_engine_module/road_seg_statistics.cpp
... ... @@ -239,7 +239,6 @@ int RoadSegProcess::init(int gpu_id, string models_dir) {
239 239 param.devId = gpu_id;
240 240  
241 241 m_devId = param.devId;
242   - ACL_CALL(aclrtSetDevice(m_devId), ACL_SUCCESS, -1);
243 242 ACL_CALL(aclrtCreateContext(&m_algorthim_ctx, m_devId), ACL_SUCCESS, -1);
244 243  
245 244 int ret = rs_init(&m_seg_handle, param);
... ...
src/ai_engine_module/road_seg_statistics.cpp.old
... ... @@ -241,7 +241,6 @@ int RoadSegProcess::init(int gpu_id, string models_dir) {
241 241 param.devId = gpu_id;
242 242  
243 243 m_devId = param.devId;
244   - ACL_CALL(aclrtSetDevice(m_devId), ACL_SUCCESS, -1);
245 244 ACL_CALL(aclrtCreateContext(&m_algorthim_ctx, m_devId), ACL_SUCCESS, -1);
246 245  
247 246 int ret = rs_init(&m_seg_handle, param);
... ...
src/ai_engine_module/traffic_light_process.cpp
... ... @@ -281,7 +281,6 @@ namespace ai_engine_module
281 281 param.max_batch = 8;
282 282  
283 283 m_devId = param.devId;
284   - ACL_CALL(aclrtSetDevice(m_devId), ACL_SUCCESS, -1);
285 284 ACL_CALL(aclrtCreateContext(&m_algorthim_ctx, m_devId), ACL_SUCCESS, -1);
286 285  
287 286 int status;
... ...
src/ai_engine_module/tricycle_manned_process.cpp
... ... @@ -47,7 +47,6 @@ namespace ai_engine_module
47 47 param.max_batch = 8;
48 48  
49 49 m_devId = param.devId;
50   - ACL_CALL(aclrtSetDevice(m_devId), ACL_SUCCESS, -1);
51 50 ACL_CALL(aclrtCreateContext(&m_algorthim_ctx, m_devId), ACL_SUCCESS, -1);
52 51  
53 52 int status;
... ...
src/ai_engine_module/truck_manned_process.cpp
... ... @@ -131,7 +131,6 @@ namespace ai_engine_module
131 131 vparam.devId = gpu_id;
132 132  
133 133 m_devId = gpu_id;
134   - ACL_CALL(aclrtSetDevice(m_devId), ACL_SUCCESS, -1);
135 134 ACL_CALL(aclrtCreateContext(&m_algorthim_ctx, m_devId), ACL_SUCCESS, -1);
136 135  
137 136 int status;
... ...