intel / llvm

Intel staging area for llvm.org contribution. Home for Intel LLVM-based projects.
Other
1.24k stars 736 forks source link

in-kernel dynamic memory allocation #7623

Open zjin-lcf opened 1 year ago

zjin-lcf commented 1 year ago

Describe the solution you would like Allow users to call the new() and delete() in a SYCL kernel

Example usage Section V in the paper https://arxiv.org/pdf/2210.07768.pdf

0x12CC commented 3 months ago

@zjin-lcf, SYCL kernels can use the placement new operator:

The placement new operator and any user-defined overloads that do not allocate storage are permitted.

From section V of the paper you shared:

The memory in the GPU memory pool is pre-allocated in the GPU global memory.

The kernels are using pointers to memory that's pre-allocated before kernel execution. I think it's possible to implement this style of memory allocation using existing SYCL features.

This request for dynamic memory allocation duplicates https://github.com/intel/llvm/issues/910.