Skip to content

OpenMP failing offload of static object if bitfields #132342

Open
@KaruroChori

Description

@KaruroChori

Tested in one of the latest commits. This works as intended:

    struct hello{
        struct sub{
            uint32_t uid;
            uint32_t gid ;
            uint32_t idx;
            uint32_t weak ;
        };
        
        #pragma omp declare target
        constexpr static sub A={1,1,1,false};
        #pragma omp end declare target
    };

while this does not:

    struct hello{
        struct sub{
            uint32_t uid:32;
            uint32_t gid:32;
            uint32_t idx:32;
            uint32_t weak:32;
        };
        
        #pragma omp declare target
        constexpr static sub A={1,1,1,false};
        #pragma omp end declare target
    };

Bitfields are intrinsically not working, and the error message is a generic sounding Offloading entry for declare target variable _ZN3sdf5hello1AE is incorrect: the address is invalid.
At the very least, a more explicit description would help but still, I see no reason why bitfields should not be allowed.

Potential workarounds like wrapping it in an union and setting it up through a different field will not work.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions