Search found 5 matches

by chabachull
Thu Nov 28, 2013 8:17 am
Forum: OpenMP 4.0 Examples
Topic: Differences between target and target data
Replies: 3
Views: 39581

Re: Differences between target and target data

The data environment is the scope in which the variables you specified in the directive is alive and valid on the device. Basically the difference between a target directive and a target data directive directive is that the code inside the target directive scope is executed on the device, while a ta...
by chabachull
Mon Jul 29, 2013 7:54 am
Forum: OpenMP 4.0 API Specifications
Topic: incorrect value in device clause for target and target data
Replies: 1
Views: 21279

incorrect value in device clause for target and target data

Hi, reading the new OpenMP 4.0 API specifications, and focusing on the additions for accelerators, the behavior of the device clause in the constructs target and target data was not very clear to me. I suppose that the number inside the device clause corresponds to a device ID. It is specified in th...
by chabachull
Fri Jul 05, 2013 2:54 am
Forum: Using OpenMP
Topic: Do we need to put class declaration in the shared clause
Replies: 6
Views: 13435

Re: Do we need to put class declaration in the shared clause

Hi, This error is due to the way you are using OpenMP. You have put the "default(none)" clause in your parallel pragma. This clause requires that all the elements you are using in your parallel region should appear either in a "private(...)" or "shared(...)" clause. You can write the same openmp lin...
by chabachull
Mon Jun 17, 2013 11:48 pm
Forum: Using OpenMP
Topic: How optimized this code using only pragma directive?
Replies: 15
Views: 23446

Re: How optimized this code using only pragma directive?

Take into account there is no data copy, just data allocation. Data copy is implied by the copyin clause. Yes, I know. ;) Sorry I wasn't clear. I just wanted to stress out that with the private clause more memory would be needed which can be problematic. A poor choice of words leads to this misunde...
by chabachull
Mon Jun 17, 2013 9:13 am
Forum: Using OpenMP
Topic: How optimized this code using only pragma directive?
Replies: 15
Views: 23446

Re: How optimized this code using only pragma directive?

I suggest that you use this line: #pragma omp parallel for private(r,g,b,gr1,gr2) You don't have to put gray1 and gray2 in the private clause. When you put variables in the private clause, you mean for each thread to have its own copy of the variable. Here, if you put gray1 and gray2 in the clause, ...