Hi @kiranchandramohan ,Thanks for the comments.
No, ___kmp_allocate(size_t size)
doesn’t allocate the memory specified by the allocator clause. It is actually allocating memory for private variables using malloc()
with required size and default alignment.
In taskgroup directive
- Function
__kmp_allocate(size_t size)
(size is obtained from the structkmp_taskred_input_t
populated for taskgroup) is called at runtime by__kmpc_taskred_init(int gtid, int num, void *data)
, which initializes task reduction. In this case all allocations are managed internally by the OpenMP runtime, which does not use the allocator/align information specified by the allocate clause in taskgroup.
Based on current observations it seems like clang does not fully support allocate clause(allocator or align) for taskgroup as it does for other directives like parallel and allocate.
It’s unclear if this is due to incomplete support or an intentional design choice that we need to check with clang community.
I have created an RFC for the Clang community. Please take a look at it for more details.