PGI User Forum
 SearchSearch   MemberlistMemberlist     RegisterRegister   ProfileProfile    Log inLog in 

Free OpenACC Course

could OpenACC accelerator OpenCV program

 
Post new topic   Reply to topic    PGI User Forum Forum Index -> Accelerator Programming
View previous topic :: View next topic  
Author Message
Teslalady



Joined: 16 Mar 2012
Posts: 75

PostPosted: Mon Mar 10, 2014 6:31 pm    Post subject: could OpenACC accelerator OpenCV program Reply with quote

Dears,
I have a question whether OpenACC could accelerator OpenCV program . If yes,do you have any code sample? what I should do, please kindly advise me.

Thanks a lot
Back to top
View user's profile
mkcolg



Joined: 30 Jun 2004
Posts: 6639
Location: The Portland Group Inc.

PostPosted: Tue Mar 11, 2014 9:35 am    Post subject: Reply with quote

Hi Teslalady,

I've never used OpenCV but it looks to be a C++ template library. Do you want to use OpenACC to accelerate the OpenCV library code? or are you asking if a user program that uses OpenACC could also use OpenCV?

For C++ in general, right now you can only accelerate "C-like" code. However, we are in the processes of allow more C++ style-constucts to be used. Things like auto adding the "routine" directive on C++ class member routines and allowing access to the "this" pointer. However, there's still a general problem with deep-copies that yet to be solved. Hence, if you want to add OpenACC into OpenCV, I'd wait for the 14.4 release to try.

As for using OpenACC in user code, that should fine now, but you wouldn't be able to put any OpenCV constructs directly into a compute region or a data clause. Though again, this is a general restriction we have with C++, not something specific to OpenCV.

- Mat
Back to top
View user's profile
longzhixi123



Joined: 10 Mar 2014
Posts: 4

PostPosted: Tue Mar 11, 2014 6:18 pm    Post subject: can OpenAcc with PGI accelerate program that uses OpenCv Reply with quote

mkcolg wrote:
Hi Teslalady,

I've never used OpenCV but it looks to be a C++ template library. Do you want to use OpenACC to accelerate the OpenCV library code? or are you asking if a user program that uses OpenACC could also use OpenCV?

For C++ in general, right now you can only accelerate "C-like" code. However, we are in the processes of allow more C++ style-constucts to be used. Things like auto adding the "routine" directive on C++ class member routines and allowing access to the "this" pointer. However, there's still a general problem with deep-copies that yet to be solved. Hence, if you want to add OpenACC into OpenCV, I'd wait for the 14.4 release to try.

As for using OpenACC in user code, that should fine now, but you wouldn't be able to put any OpenCV constructs directly into a compute region or a data clause. Though again, this is a general restriction we have with C++, not something specific to OpenCV.

- Mat



hi , i am using PGI 14.3 , and i have a program uses OpenCv function , and i want to accelerate my program usign OpenAcc. but i donot know how to do . becides, i also have other program named testmain , and testmain have files [testmain.cpp test.h test.cpp], and how to Compile in PGI? I hope to get your answer
Back to top
View user's profile
mkcolg



Joined: 30 Jun 2004
Posts: 6639
Location: The Portland Group Inc.

PostPosted: Wed Mar 12, 2014 11:55 am    Post subject: Reply with quote

Hi longzhixi123,

As I indicated above, I have not worked with OpenCV before so don't know the specifics about using it. However, from what I can tell it appears that a user would just include the OpenCV header files and then use it like any other class. Hence, the first thing to do is just compile your test program with PGI's C++ compiler, pgcpp. If you are using Linux, it may be preferable to use our GNU Compatible compiler, pgc++.

Next, I would then try getting a feel of how OpenACC works independent of using it in the context of OpenCV. Admittedly, C++ examples are lagging, but you can find a wealth of information about OpenACC on the internet or start by reviewing the links from this page: http://www.pgroup.com/resources/accel.htm

Next, you can begin adding OpenACC to your test program. However, you wont be able to directly use any class member data object in an OpenACC data clause or compute region, at least not yet. This support is still in development.

Instead, you will need to translate this data to a local variable (using a local pointer often works provided you can access the class' data member's directly). Effectively, the code you're accelerating needs to be "C-like".

- Mat
Back to top
View user's profile
Display posts from previous:   
Post new topic   Reply to topic    PGI User Forum Forum Index -> Accelerator Programming All times are GMT - 7 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © phpBB Group