|
@@ -75,13 +75,12 @@
|
|
|
* @param device The device ID to set.
|
|
* @param device The device ID to set.
|
|
|
*/
|
|
*/
|
|
|
void ggml_cann_set_device(const int32_t device) {
|
|
void ggml_cann_set_device(const int32_t device) {
|
|
|
- // TODO: uncomment these lines after empty context has fixed.
|
|
|
|
|
- // int current_device;
|
|
|
|
|
- // ACL_CHECK(aclrtGetDevice(¤t_device));
|
|
|
|
|
|
|
+ int current_device = -1;
|
|
|
|
|
+ aclrtGetDevice(¤t_device);
|
|
|
|
|
|
|
|
- // if (device == current_device) {
|
|
|
|
|
- // return;
|
|
|
|
|
- // }
|
|
|
|
|
|
|
+ if (device == current_device) {
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
ACL_CHECK(aclrtSetDevice(device));
|
|
ACL_CHECK(aclrtSetDevice(device));
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -1729,6 +1728,7 @@ static bool ggml_cann_compute_forward(ggml_backend_cann_context& ctx,
|
|
|
ggml_cann_get_rows(ctx, dst);
|
|
ggml_cann_get_rows(ctx, dst);
|
|
|
break;
|
|
break;
|
|
|
case GGML_OP_SET_ROWS:
|
|
case GGML_OP_SET_ROWS:
|
|
|
|
|
+ std::cout << "lcg GGML_OP_SET_ROWS"<< std::endl;
|
|
|
ggml_cann_set_rows(ctx, dst);
|
|
ggml_cann_set_rows(ctx, dst);
|
|
|
break;
|
|
break;
|
|
|
case GGML_OP_DUP:
|
|
case GGML_OP_DUP:
|