[Openmp-dev] Target CUDA RTL --> CUDA error is: an illegal memory access was encountered

Itaru Kitayama via Openmp-dev openmp-dev at lists.llvm.org
Mon Jan 13 14:32:21 PST 2020


Alexey - then, a warning saying it is going to fail at run time or
something if the developer is calling a virtual function in the target
region.

On Tue, Jan 14, 2020 at 7:26 AM Alexey Bataev <a.bataev at outlook.com> wrote:

> Hi Itaru, what kind of messages? About mapping data types with virtual
> functions? Better to be a warning, I think.
>
> -------------
> Best regards,
> Alexey Bataev
>
> 12.01.2020 9:34 PM, Itaru Kitayama пишет:
>
> Alexey,
>
> Can we have build time error messages?
> Clang does not complain at this moment.
>
> On Sun, Jan 12, 2020 at 8:29 Alexey Bataev <a.bataev at hotmail.com> wrote:
>
>> Virtual functions are not supported.
>>
>> Best regards,
>> Alexey Bataev
>>
>> > 11 янв. 2020 г., в 18:08, Itaru Kitayama via Openmp-dev <
>> openmp-dev at lists.llvm.org> написал(а):
>> >
>> > 
>> > Hi,
>> > C++ sample code like below:
>> >
>> > class AbsBase {
>> > public:
>> > virtual int f() = 0;
>> > };
>> >
>> > class Derived : public AbsBase {
>> > private:
>> > int *arr = new int[100];
>> > public:
>> > int f() { return arr[0]; }
>> > void fillarray() {
>> > arr[0] = 1234;
>> > }
>> > };
>> >
>> > int main() {
>> > AbsBase *absBase = new Derived();
>> > #pragma omp target enter data map(to: absBase[0:1])
>> > #pragma omp target parallel for map(to: absBase)
>> > for (int i=0;i<10;i++) {
>> > static_cast<Derived*>(absBase)->f();
>> > }
>> > }
>> >
>> > if it is built with the offloading support and executed on POWER8, I
>> observe illegal memory access. Am I programming incorrectly or the possible
>> bug in the
>> > current trunk of Clang?
>> > _______________________________________________
>> > Openmp-dev mailing list
>> > Openmp-dev at lists.llvm.org
>> > https://lists.llvm.org/cgi-bin/mailman/listinfo/openmp-dev
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/openmp-dev/attachments/20200114/38948845/attachment.html>


More information about the Openmp-dev mailing list