Skip to content
Snippets Groups Projects
Commit 7c91431f authored by kotsifa2's avatar kotsifa2
Browse files

A version of Gradient working for merge

parent ba543ac4
No related branches found
No related tags found
No related merge requests found
......@@ -177,7 +177,8 @@ void horizontal(float* Is, size_t bytesIs,
//G[gloc] = Gx*Gx + Gy*Gy;
}
Gx[gloc] = Val;
__visc__return(m);
//__visc__return(m);
__visc__return(bytesSx);
}
void WrapperHorizontal(float* Is, size_t bytesIs,
......@@ -251,7 +252,8 @@ void vertical(float* Is, size_t bytesIs,
//G[gloc] = Gx*Gx + Gy*Gy;
}
Gy[gloc] = Val;
__visc__return(n);
//__visc__return(n);
__visc__return(bytesSy);
}
void WrapperVertical(float* Is, size_t bytesIs,
......@@ -280,7 +282,8 @@ void WrapperVertical(float* Is, size_t bytesIs,
void squareRoot(float* Gx, size_t bytesGx,
float* Gy, size_t bytesGy,
float* G, size_t bytesG,
long m, long n) {
long m, long n,
size_t bytesSx, size_t bytesSy) {
__visc__hint(visc::DEVICE);
__visc__attributes(2, Gx, Gy, 1, G);
......@@ -294,13 +297,15 @@ void squareRoot(float* Gx, size_t bytesGx,
G[index] = __visc__sqrt(Gx[index]*Gx[index]+Gy[index]*Gy[index]);
}
__visc__return(m);
//__visc__return(m);
__visc__return(bytesG);
}
void WrapperSquareRoot(float* Gx, size_t bytesGx,
float* Gy, size_t bytesGy,
float* G, size_t bytesG,
long m, long n) {
long m, long n,
size_t bytesSx, size_t bytesSy) {
__visc__hint(visc::CPU_TARGET);
__visc__attributes(2, Gx, Gy, 1, G);
......@@ -314,6 +319,8 @@ void WrapperSquareRoot(float* Gx, size_t bytesGx,
__visc__bindIn(Node, 5, 5, 0); // Bind bytesG
__visc__bindIn(Node, 6, 6, 0); // Bind m
__visc__bindIn(Node, 7, 7, 0); // Bind n
__visc__bindIn(Node, 8, 8, 0); // Bind dummy 1
__visc__bindIn(Node, 9, 9, 0); // Bind dummy 2
__visc__bindOut(Node, 0, 0, 0); // bind output m
......@@ -355,18 +362,22 @@ void Gradient(float* Is, size_t bytesIs,// 0
// Linear combination
__visc__bindIn(SNode, 6, 0, 1); // Bind Gx
__visc__bindIn(SNode, 7, 1, 1); // Bind bytesGx
__visc__bindIn(SNode, 7, 1, 1); // Bind bytesGx [Alt: Pass as edge from horizontal]
__visc__bindIn(SNode, 8, 2, 1); // Bind Gy
__visc__bindIn(SNode, 9, 3, 1); // Bind bytesGy
__visc__bindIn(SNode, 9, 3, 1); // Bind bytesGy [Alt: Pass as edge from vertical]
__visc__bindIn(SNode, 10, 4, 1); // Bind G
__visc__bindIn(SNode, 11, 5, 1); // Bind bytesG
//__visc__bindIn(SNode, 12, 6, 0); // Bind m [Pass as edge from dilate]
//__visc__bindIn(SNode, 13, 7, 0); // Bind n [Pass as edge from erode]
__visc__bindIn(SNode, 12, 6, 1); // Bind m [Alt: Pass as edge from horizontal]
__visc__bindIn(SNode, 13, 7, 1); // Bind n [Alt: Pass as edge from vertical]
__visc__edge(HNode, SNode, 0, 0, 6, 1); // Get m from dilate
__visc__edge(VNode, SNode, 0, 0, 7, 1); // Get n from erode
//__visc__edge(HNode, SNode, 0, 0, 6, 1); // Get m from horizontal
//__visc__edge(VNode, SNode, 0, 0, 7, 1); // Get n from vertical
//__visc__edge(HNode, SNode, 0, 0, 1, 1); // Get bytesGx from horizontal
//__visc__edge(VNode, SNode, 0, 0, 3, 1); // Get bytesGy from vertical
__visc__edge(HNode, SNode, 0, 0, 8, 1); // Get bytes from horizontal
__visc__edge(VNode, SNode, 0, 0, 9, 1); // Get bytesGy from vertical
__visc__bindOut(SNode, 0, 0, 1); // bind output m
__visc__bindOut(SNode, 0, 0, 1); // bind output bytesG
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment