Reputation: 39
I used nvc++ to run the C++ program with openacc and the error displayed 'libgomp: TODO'. Here is the test code:
#include <opencv2/imgcodecs.hpp>
#include <opencv2/highgui.hpp>
#include<openacc.h>
using namespace std;
using namespace cv;
int main(){
cv::Mat srcImg=cv::imread("/home/testSpace/images/blue-mountains.jpg");
if(!srcImg.data){
cout<<"The file is not loaded or does not exist"<<endl;
return -1;
}
cout<<"Matrix"<<srcImg.rows<<" "<<srcImg.cols<<endl;
Mat duplicate(srcImg.rows,srcImg.cols, CV_8UC1,Scalar::all(255) );
#pragma acc enter data copyin(srcImg[:srcImg.rows][:srcImg.cols])
#pragma acc enter data copyin(duplicate[:duplicate.rows][:duplicate.cols])
#pragma acc parallel
{
#pragma acc loop
for(int i=0;i<srcImg.rows;i++){
#pragma acc loop
for(int j=0;j<srcImg.cols;j++){
duplicate.at<uchar>(i,j)=srcImg.at<uchar>(i,j);
}
}
#pragma acc data copyout(duplicate[:duplicate.rows][:duplicate.cols])
#pragma acc data copyout(srcImg[:srcImg.rows][:srcImg.cols])
}
cout<<"duplicate"<<": "<<(int)duplicate.at<uchar>(23,45)<<endl;
return 0;
}
Then I got error by using nvc++ to compile the code file.
main:
2216, Loop unrolled 4 times (completely unrolled)
36, Generating enter data copyin(duplicate,srcImg)
Generating NVIDIA GPU code
38, #pragma acc loop gang /* blockIdx.x */
40, #pragma acc loop vector(128) /* threadIdx.x */
36, Generating implicit copyin(duplicate.step.p[:1],srcImg.step.p[:1],srcImg,duplicate)[if not already present]
40, Loop is parallelizable
Loop not vectorized/parallelized: not countable
cv::Matx<double, (int)4, (int)1>::Matx():
The final result is :Matrix810 1440
libgomp: TODO
Can anyone please provide any hint? Moreover, I don't know why I got the error
Generating implicit copyin(duplicate.step.p[:1],srcImg.step.p[:1],srcImg,duplicate)[if not already present]
I used the same way to allocate memory for srcImg in GPU.
The content of run scripts:
nvc++ -g -O3 -acc -gpu=cc60,cc70 -Minfo ``pkg-config opencv4 --cflags --libs`` -nomp -o nvcpp.out test.cpp
Please check lib_information here
Upvotes: 0
Views: 425