| 6067 | } |
| 6068 | |
| 6069 | void ecall_where_greater(float *input1,float *input2,float *cond1,float *cond2,int N,int n1,int n2,float *output){ |
| 6070 | float *x1 = (float*)malloc(sizeof(float)*N); |
| 6071 | memset(x1, 0, sizeof(float)*N); |
| 6072 | for(int j=0;j<N;j++){ |
| 6073 | x1[j] = 0.0f; |
| 6074 | float sum = input1[insert*N+j]; |
| 6075 | float c = 0.0f; |
| 6076 | for(int i=0;i<Nt;i++){ |
| 6077 | float y = input1[indexs[i]*N+j] - c; |
| 6078 | float t = sum + y; |
| 6079 | c = (t - sum) - y; |
| 6080 | sum = t; |
| 6081 | } |
| 6082 | x1[j] = sum; |
| 6083 | } |
| 6084 | float *x2 = (float*)malloc(sizeof(float)*N); |
| 6085 | memset(x2, 0, sizeof(float)*N); |
| 6086 | for(int j=0;j<N;j++){ |
| 6087 | x2[j] = 0.0f; |
| 6088 | float sum = input2[insert*N+j]; |
| 6089 | float c = 0.0f; |
| 6090 | for(int i=0;i<Nt;i++){ |
| 6091 | float y = input2[indexs[i]*N+j] - c; |
| 6092 | float t = sum + y; |
| 6093 | c = (t - sum) - y; |
| 6094 | sum = t; |
| 6095 | } |
| 6096 | x2[j] = sum; |
| 6097 | } |
| 6098 | float *x3 = (float*)malloc(sizeof(float)*n1); |
| 6099 | memset(x3, 0, sizeof(float)*n1); |
| 6100 | if(n1 == 1){ |
| 6101 | x3[0] = cond1[0]; |
| 6102 | } |
| 6103 | else{ |
| 6104 | for(int j=0;j<n1;j++){ |
| 6105 | x3[j] = 0.0f; |
| 6106 | float sum = cond1[insert*n1+j]; |
| 6107 | float c = 0.0f; |
| 6108 | for(int i=0;i<Nt;i++){ |
| 6109 | float y = cond1[indexs[i]*n1+j] - c; |
| 6110 | float t = sum + y; |
| 6111 | c = (t - sum) - y; |
| 6112 | sum = t; |
| 6113 | } |
| 6114 | x3[j] = sum; |
| 6115 | } |
| 6116 | } |
| 6117 | |
| 6118 | float *x4 = (float*)malloc(sizeof(float)*n2); |
| 6119 | memset(x4, 0, sizeof(float)*n2); |
| 6120 | if(n2 == 1){ |
| 6121 | x4[0] = cond2[0]; |
| 6122 | } |
| 6123 | else{ |
| 6124 | for(int j=0;j<n2;j++){ |
| 6125 | x4[j] = 0.0f; |
| 6126 | float sum = cond2[insert*n2+j]; |
no test coverage detected