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

Function ecall_reducemean

sgx_tf_ops/Enclave/Enclave.cpp:1747–1768  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1745}
1746
1747void ecall_reducemean(float *input,int N,float *output){
1748 float *x = (float*)malloc(sizeof(float)*N);
1749 memset(x, 0, sizeof(float)*N);
1750 for(int j=0;j<N;j++){
1751 x[j] = 0.0f;
1752 float sum = input[insert*N+j];
1753 float c = 0.0f;
1754 for(int i=0;i<Nt;i++){
1755 float y = input[indexs[i]*N+j] - c;
1756 float t = sum + y;
1757 c = (t - sum) - y;
1758 sum = t;
1759 }
1760 x[j] = sum;
1761
1762 }
1763 output[0] =0.0f;
1764 for (int j = 0; j < N; j++){
1765 output[0] += x[j]/static_cast<float>(N);
1766 }
1767 return;
1768 }
1769
1770void ecall_reducemean_grad(float *input,float grad,int N,float *output){
1771 float *x = (float*)malloc(sizeof(float)*N);

Callers 1

reducemeanFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected