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