incorrect value in device clause for target and target data

Discuss the OpenMP 4.0 API Specifications released July 2013 (Read Only)
Forum rules
The OpenMP Forums are now closed to new posts. Please visit Stack Overflow if you are in need of help:
Posts: 5
Joined: Mon Jun 17, 2013 3:02 am

incorrect value in device clause for target and target data

Post by chabachull »


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 the specification that "If there is no device clause, the default device is determined by the default-device-var ICV."
But what if the number does not correspond to any device? Say that you have only two devices available, and you give to the clause the number '6'. What happens?
The code in the target region is executed on the host? On the device specified by the default-device-var ICV? or is it not executed at all?

I didn't find in the specification where this is addressed.

Additionally, here is one typo I detected in section1.3: at line 26, target devce is written instead of target device.

Posts: 54
Joined: Fri May 16, 2008 9:27 am

Re: incorrect value in device clause for target and target d

Post by james »

You are correct that the device clause is not well defined. This is something we will address first with examples and later in the next version of the spec.

Thanks for your comments! It is good to know someone is reading these sections this closely.