I want a unique_ptr that can be used in the __global__ function

I want a unique_ptr that can be used in the global function

Since new/delete and malloc/free can be used normally inside the global function and device function,
Please provide a unique_ptr that supports these as a cuda tool.

std::unique_ptr corresponding to cudaMalloc/cudaFree that can be used in the host function is
already provided by the user

unique_ptr for host
unique_ptr for host

__global__
void
GPUMain() {

  //  double * buf = new double;
  //Ex
  kernel_unique_ptr<double[]> pmem = kernel_make_unique<double[]> (1024);
  
  DynamicParallelism<<< 1, 1024 >>> (pmem );
  
  //delete [] buf;
}


int
main() {
  GPUMain<<<1,1>>>();
}

this may be of interest. I haven’t used it personally.