Closed yn224 closed 3 years ago
Generated kernel.cpp code from vitis simulation has a missing argument to the buffer functions that looks like the following:
kernel.cpp
host.cpp: In function ‘int main(int, char**)’: host.cpp:107:99: error: expected primary-expression before ‘.’ token cl::Buffer buffer_(context, CL_MEM_USE_HOST_PTR | CL_MEM_READ_WRITE, sizeof(float)*1080*1920*3, .data(), &err); ^ host.cpp:108:22: error: redeclaration of ‘cl::Buffer buffer_’ cl::Buffer buffer_(context, CL_MEM_USE_HOST_PTR | CL_MEM_READ_WRITE, sizeof(float)*3*3, .data(), &err); ^~~~~~~ host.cpp:107:14: note: ‘cl::Buffer buffer_’ previously declared here cl::Buffer buffer_(context, CL_MEM_USE_HOST_PTR | CL_MEM_READ_WRITE, sizeof(float)*1080*1920*3, .data(), &err); ^~~~~~~ host.cpp:108:91: error: expected primary-expression before ‘.’ token cl::Buffer buffer_(context, CL_MEM_USE_HOST_PTR | CL_MEM_READ_WRITE, sizeof(float)*3*3, .data(), &err); ^ host.cpp:109:22: error: redeclaration of ‘cl::Buffer buffer_’ cl::Buffer buffer_(context, CL_MEM_USE_HOST_PTR | CL_MEM_READ_WRITE, sizeof(float)*3*3, .data(), &err); ^~~~~~~ host.cpp:107:14: note: ‘cl::Buffer buffer_’ previously declared here cl::Buffer buffer_(context, CL_MEM_USE_HOST_PTR | CL_MEM_READ_WRITE, sizeof(float)*1080*1920*3, .data(), &err); ^~~~~~~ host.cpp:109:91: error: expected primary-expression before ‘.’ token cl::Buffer buffer_(context, CL_MEM_USE_HOST_PTR | CL_MEM_READ_WRITE, sizeof(float)*3*3, .data(), &err); ^ host.cpp:110:22: error: redeclaration of ‘cl::Buffer buffer_’ cl::Buffer buffer_(context, CL_MEM_USE_HOST_PTR | CL_MEM_READ_WRITE, sizeof(float)*1078*1918, .data(), &err); ^~~~~~~ host.cpp:107:14: note: ‘cl::Buffer buffer_’ previously declared here cl::Buffer buffer_(context, CL_MEM_USE_HOST_PTR | CL_MEM_READ_WRITE, sizeof(float)*1080*1920*3, .data(), &err); ^~~~~~~ host.cpp:110:97: error: expected primary-expression before ‘.’ token cl::Buffer buffer_(context, CL_MEM_USE_HOST_PTR | CL_MEM_READ_WRITE, sizeof(float)*1078*1918, .data(), &err);
The error can be reproduced by running the pipelined version of Sobel example addressed in PR #384 .
It turns out to be a one line change of code for the fix. Will push the fix in a separate PR.
Issue Description
Generated
kernel.cpp
code from vitis simulation has a missing argument to the buffer functions that looks like the following:The error can be reproduced by running the pipelined version of Sobel example addressed in PR #384 .