Skip to content

Commit a64a6b8

Browse files
authored
Merge pull request #42 from oneapi-src/sobelf/code_update/2311
[sobel_filter][CUDA][HIP]: align CUDA and HIP kernels with SYCL kernel
2 parents 29fa5f1 + 68124e6 commit a64a6b8

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

sobel_filter/CUDA/src/sobelfilter.cu

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,8 @@ void computeGradient(
122122
(gradienty[2][1] * input[index_row_below]) +
123123
(gradienty[2][2] * input[index_row_below + 1]);
124124

125-
output[index] = sqrtf(powf(gradient_x, 2.f) + powf(gradient_y, 2.f));
125+
// output[index] = sqrtf(powf(gradient_x, 2.f) + powf(gradient_y, 2.f));
126+
output[index] = sqrtf(gradient_x * gradient_x + gradient_y * gradient_y);
126127
}
127128

128129
int main(int argc, const char* argv[])

sobel_filter/HIP/src/sobelfilter.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,8 @@ void computeGradient(
122122
(gradienty[2][1] * input[index_row_below]) +
123123
(gradienty[2][2] * input[index_row_below + 1]);
124124

125-
output[index] = sqrtf(powf(gradient_x, 2.f) + powf(gradient_y, 2.f));
125+
// output[index] = sqrtf(powf(gradient_x, 2.f) + powf(gradient_y, 2.f));
126+
output[index] = sqrtf(gradient_x * gradient_x + gradient_y * gradient_y);
126127
}
127128

128129
int main(int argc, const char* argv[])

0 commit comments

Comments
 (0)