Skip to content

Conversation

@skc7
Copy link

@skc7 skc7 commented Oct 31, 2025

This PR introduces two new ops in omp dialect, omp.target_allocmem and omp.target_freemem.
omp.target_allocmem: Allocates heap memory on device. Will be lowered to omp_target_alloc call in llvm.
omp.target_freemem: Deallocates heap memory on device. Will be lowered to omp+target_free call in llvm.

Example:
%1 = omp.target_allocmem %device : i32, i64
omp.target_freemem %device, %1 : i32, i64

The work in this PR is C-P/inspired from @ivanradanov commit from coexecute implementation:
Add fir omp target alloc and free
ops
Lower omp_target_{alloc,free} to
llvm

…llvm#145464)

This PR introduces two new ops in omp dialect, omp.target_allocmem and
omp.target_freemem.
omp.target_allocmem: Allocates heap memory on device. Will be lowered to
omp_target_alloc call in llvm.
omp.target_freemem: Deallocates heap memory on device. Will be lowered
to omp+target_free call in llvm.

Example:
  %1 = omp.target_allocmem %device : i32, i64
  omp.target_freemem %device, %1 : i32, i64

The work in this PR is C-P/inspired from @ivanradanov commit from
coexecute implementation:
[Add fir omp target alloc and free
ops](ivanradanov@be860ac)
[Lower omp_target_{alloc,free} to
llvm](ivanradanov@6e2d584)
@z1-cciauto
Copy link
Collaborator

@skc7 skc7 marked this pull request as ready for review October 31, 2025 16:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants