openmp bool array error

General OpenMP discussion

openmp bool array error

Postby gdarmon » Wed Feb 26, 2014 1:24 pm

this is the error i'm getting

Code: Select all
    Error   1   error C3028: 'CAlgo::m_CandEnable' :
    only a variable or static data member can be used in a data-sharing clause


Code: Select all
    bool m_CandEnable[ALGO_NUM_CANDIDATE];

this is the pragma im using

Code: Select all
    #pragma omp parallel for schedule(static) default(none) private(i, fast_SAD_index_i, exit_loop_sad_max, m_CandEnable, candLocY_index_i\
                                                       candLocX_index_i, exit_loop_sad_max, k, candLocY, candLocX, nbr_SAD_RES_index_BNLM_PATCH_LOC_Y_plus_k_offset_BNLM_PATCH_LOC_X, \
                                                       nbr_SAD_RES, nbr_SAD_RES_candLocY_index_iplus_k_offset_candLocX_index_i, patch_pixel_value, cand_pixel_value\
                                                       j, fast_SAD_index_i, SAD)


the variable is declared as private and same error for shared
gdarmon
 
Posts: 8
Joined: Wed Feb 26, 2014 1:01 pm

Re: openmp bool array error

Postby MarkB » Thu Feb 27, 2014 4:14 am

If m_CandEnable[] is a (non-static) data member of a class, then it cannot be specified in a private clause (you can only make private copies of whole objects, and not of sub-objects). Perhaps the easiest way to do this is to split the parallel for directive into separate parallel and for directives, and explicitly allocate a temporary array inside the parallel region.
MarkB
 
Posts: 429
Joined: Thu Jan 08, 2009 10:12 am

Re: openmp bool array error

Postby gdarmon » Fri Feb 28, 2014 3:48 am

Ok thanks a lot.
gdarmon
 
Posts: 8
Joined: Wed Feb 26, 2014 1:01 pm

Re: openmp bool array error

Postby ettiejgva » Fri Apr 18, 2014 7:05 am

Thanks for this, I was having the same problem as gdarmon. Fixed it right up!
ettiejgva
 
Posts: 1
Joined: Fri Apr 04, 2014 7:12 am


Return to Using OpenMP

Who is online

Users browsing this forum: Yahoo [Bot] and 12 guests