MCPcopy Create free account
hub / github.com/conflow-dev/ConFlow / ecall_reducemin_zero

Function ecall_reducemin_zero

sgx_tf_ops/Enclave/Enclave.cpp:5125–5153  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

5123}
5124
5125void ecall_reducemin_zero(float *input,int N,int M,int C,int L,float *output){
5126 float *x = (float*)malloc(sizeof(float)*N);
5127 memset(x, 0, sizeof(float)*N);
5128 for(int j=0;j<N;j++){
5129 x[j] = 0.0f;
5130 float sum = input[insert*N+j];
5131 float c = 0.0f;
5132 for(int i=0;i<Nt;i++){
5133 float y = input[indexs[i]*N+j] - c;
5134 float t = sum + y;
5135 c = (t - sum) - y;
5136 sum = t;
5137 }
5138 x[j] = sum;
5139
5140 }
5141
5142 for (int i = 0; i < C; i++) {
5143 for (int j = 0; j < L; j++) {
5144 float min_val = x[i*L+j];
5145 for (int k = 1; k < M; k++) {
5146 min_val = fminf(min_val, x[i*L+j+k*C*L]);
5147 }
5148 output[i*L+j] = min_val;
5149 }
5150 }
5151 free(x);
5152 return;
5153 }
5154
5155void ecall_reducemin_zero_grad(float *input,float *grad,int N,int M,int C,int L,float *output){
5156 float *x = (float*)malloc(sizeof(float)*N);

Callers 1

reducemin_zeroFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected