| 5505 | } |
| 5506 | |
| 5507 | void ecall_where_equal(float *input1,float *input2,float *cond1,float *cond2,int N,int n1,int n2,float *output){ |
| 5508 | float *x1 = (float*)malloc(sizeof(float)*N); |
| 5509 | memset(x1, 0, sizeof(float)*N); |
| 5510 | for(int j=0;j<N;j++){ |
| 5511 | x1[j] = 0.0f; |
| 5512 | float sum = input1[insert*N+j]; |
| 5513 | float c = 0.0f; |
| 5514 | for(int i=0;i<Nt;i++){ |
| 5515 | float y = input1[indexs[i]*N+j] - c; |
| 5516 | float t = sum + y; |
| 5517 | c = (t - sum) - y; |
| 5518 | sum = t; |
| 5519 | } |
| 5520 | x1[j] = sum; |
| 5521 | } |
| 5522 | float *x2 = (float*)malloc(sizeof(float)*N); |
| 5523 | memset(x2, 0, sizeof(float)*N); |
| 5524 | for(int j=0;j<N;j++){ |
| 5525 | x2[j] = 0.0f; |
| 5526 | float sum = input2[insert*N+j]; |
| 5527 | float c = 0.0f; |
| 5528 | for(int i=0;i<Nt;i++){ |
| 5529 | float y = input2[indexs[i]*N+j] - c; |
| 5530 | float t = sum + y; |
| 5531 | c = (t - sum) - y; |
| 5532 | sum = t; |
| 5533 | } |
| 5534 | x2[j] = sum; |
| 5535 | } |
| 5536 | float *x3 = (float*)malloc(sizeof(float)*n1); |
| 5537 | memset(x3, 0, sizeof(float)*n1); |
| 5538 | if(n1 == 1){ |
| 5539 | x3[0] = cond1[0]; |
| 5540 | } |
| 5541 | else{ |
| 5542 | for(int j=0;j<n1;j++){ |
| 5543 | x3[j] = 0.0f; |
| 5544 | float sum = cond1[insert*n1+j]; |
| 5545 | float c = 0.0f; |
| 5546 | for(int i=0;i<Nt;i++){ |
| 5547 | float y = cond1[indexs[i]*n1+j] - c; |
| 5548 | float t = sum + y; |
| 5549 | c = (t - sum) - y; |
| 5550 | sum = t; |
| 5551 | } |
| 5552 | x3[j] = sum; |
| 5553 | } |
| 5554 | } |
| 5555 | |
| 5556 | float *x4 = (float*)malloc(sizeof(float)*n2); |
| 5557 | memset(x4, 0, sizeof(float)*n2); |
| 5558 | if(n2 == 1){ |
| 5559 | x4[0] = cond2[0]; |
| 5560 | } |
| 5561 | else{ |
| 5562 | for(int j=0;j<n2;j++){ |
| 5563 | x4[j] = 0.0f; |
| 5564 | float sum = cond2[insert*n2+j]; |
no test coverage detected