Skip to content

Commit 5242204

Browse files
OpenVX 1.3 - laplacian fix (#657)
* initialize output image buffer with zero * code cleanup * laplacian fix * add log entry * fix log entry Co-authored-by: LakshmiKumar23 <[email protected]>
1 parent 6050206 commit 5242204

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

amd_openvx/openvx/ago/ago_haf_gpu_special_filters.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1437,7 +1437,6 @@ int HafGpu_ScaleGaussianHalf(AgoNode * node)
14371437
" int gx = get_global_id(0);\n"
14381438
" int gy = get_global_id(1);\n"
14391439
" p0_buf += p0_offset + (gy * p0_stride) + (gx << 2);\n"
1440-
" *(__global uint *)p0_buf = 0;\n"
14411440
" int gstride = p1_stride;\n"
14421441
" __global uchar * gbuf = p1_buf + p1_offset + (((gy - ly) << 1) + 1) * gstride + ((gx - lx) << 3);\n"
14431442
" bool valid = ((gx < %d) && (gy < %d)) ? true : false;\n" // (width+3)/4, height

amd_openvx/openvx/ago/ago_util_opencl.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -381,6 +381,14 @@ int agoGpuOclAllocBuffer(AgoData * data)
381381
agoAddLogEntry(&context->ref, VX_FAILURE, "ERROR: agoGpuOclCreateBuffer(%p,CL_MEM_READ_WRITE,%d,0,*) => %d\n", context->opencl_context, (int)dataMaster->size + dataMaster->gpu_buffer_offset, err);
382382
return -1;
383383
}
384+
else {
385+
vx_uint32 zero = 0;
386+
err = clEnqueueFillBuffer(context->opencl_cmdq, dataMaster->opencl_buffer, &zero, sizeof(zero), 0, dataMaster->gpu_buffer_offset + dataMaster->size, 0, NULL, NULL);
387+
if (err) {
388+
agoAddLogEntry(&context->ref, VX_FAILURE, "ERROR: clEnqueueFillBuffer() => %d\n", err);
389+
return -1;
390+
}
391+
}
384392
if (dataMaster->u.img.isUniform) {
385393
// make sure that CPU buffer is allocated
386394
if (!dataMaster->buffer) {

0 commit comments

Comments
 (0)