Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

error: for statement expected before ‘uint16_t’ #5776

Closed
jiapei100 opened this issue Feb 4, 2020 · 2 comments
Closed

error: for statement expected before ‘uint16_t’ #5776

jiapei100 opened this issue Feb 4, 2020 · 2 comments

Comments

@jiapei100
Copy link

jiapei100 commented Feb 4, 2020

I'm quite sure #pragma omp parallel for schedule(dynamic) brings me the following ERROR message if I build with kinfu enabled, for if I comment out this line 262 #pragma omp parallel for schedule(dynamic) in file rs-kinfu.cpp, it compiles successfully.

....../librealsense/wrappers/opencv/kinfu/rs-kinfu.cpp: In lambda function:
....../librealsense/wrappers/opencv/kinfu/rs-kinfu.cpp:266:17: error: for statement expected before ‘uint16_t’
                 uint16_t* p_depth_frame = reinterpret_cast<uint16_t*>(const_cast<void*>(d.get_data()));

How to use OpenMP for kinfu in librealsense?

cheers
Pei

@eokeeffe
Copy link

Two things, I was able to fix the issue with the compilation, just swap the lines as such, then add
the depth_frame as a shared resource

uint16_t* p_depth_frame = reinterpret_cast<uint16_t*>(const_cast<void*>(d.get_data()));
#pragma omp parallel for shared(p_depth_frame) schedule(dynamic)

secondly you'll want to make sure you have this in the console or your .bashrc file if using opencv 4.x and above
export OPENCV_OPENCL_DEVICE_MAX_WORK_GROUP_SIZE=512

@jiapei100
Copy link
Author

@eokeeffe

Thank you very much ... You saved my life... Thanks...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants