Intel® C++ Compiler
Community support and assistance for creating C++ code that runs on platforms based on Intel® processors.

OPENMP 4.0 target offload Report

Rezaul_R_
Beginner
333 Views

Hi ..

I am trying to make a comparison statistics of offload using,

1). Intel compiler assisted offload VS. 2). OPENMP 4.0 target construct 

My QUESTION: HOW I CAN GET OPENMP 4.0 OFFLOAD REPORT(which environment variable I need to set..?), I used OFFLOAD Report=2; intel compiler directive offload it worked fine, BUT I AM GETTING VERY STRANGE STATISTICS WITH OPENMP 4.0 OFFLOAD (I am using Intel Xeon Phi as execution platform)

Here is the code

COMPILER DIRECTIVE OFFLOAD:

// Start time
        gettimeofday(&start, NULL);

        // Run SAXPY 
        #pragma offload target(mic:0) inout(x) out(y)
        {
                        #pragma omp parallel for default (none) shared(a,x,y)
                        for (i = 0; i < n; ++i){
                                y = a*x + y;
                        }                                                        
        } // end of target data

        // end time 
        gettimeofday(&end, NULL);


OPENMP 4.0 TARGET OFFLOAD:

// Start time
        gettimeofday(&start, NULL);

        // Run SAXPY
        #pragma omp target data map(to:x)
        {
                #pragma omp target map(tofrom:y)
                {
                        #pragma omp parallel for
                        for (i = 0; i < n; ++i){
                                y = a*x + y;
                        }
                }
        } // end of target data

 

------

Thanks in advace. (Raju)

0 Kudos
2 Replies
TimP
Honored Contributor III
333 Views

I would have written #pragma omp target map (to: x) map( tofrom: y){

}

similar to what works in Fortran, but who am I to say when I haven't had much success with C?

0 Kudos
Amanda_S_Intel
Employee
333 Views

Hi,

The offload report does support the OpenMP 4.0 target construct. The environment variable is OFFLOAD_REPORT. See the documentation here for usage (search 'offload report'): https://software.intel.com/en-us/intel-cplusplus-compiler-16.0-user-and-reference-guide

I noticed that the documentation does not mention OpenMP support for this feature so I have submitted a change request to include that information (DPD200376289).

Regards,

--Amanda

0 Kudos
Reply