[llvm-branch-commits] [flang] [flang][cuda] Translate cuf.register_kernel and cuf.register_module (PR #112972)

2024-10-18 Thread Renaud Kauffmann via llvm-branch-commits

https://github.com/Renaud-K approved this pull request.

This looks really good. Thank you!

https://github.com/llvm/llvm-project/pull/112972
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [flang] [flang][cuda] Data transfer with descriptor (PR #114302)

2024-10-30 Thread Renaud Kauffmann via llvm-branch-commits


@@ -9,10 +9,32 @@
 #include "flang/Runtime/CUDA/memory.h"
 #include "../terminator.h"
 #include "flang/Runtime/CUDA/common.h"
+#include "flang/Runtime/assign.h"
 
 #include "cuda_runtime.h"
 
 namespace Fortran::runtime::cuda {
+static void *MemmoveHostToDevice(
+void *dst, const void *src, std::size_t count) {
+  // TODO: Use cudaMemcpyAsync when we have support for stream.
+  CUDA_REPORT_IF_ERROR(cudaMemcpy(dst, src, count, cudaMemcpyHostToDevice));
+  return dst;
+}
+
+static void *MemmoveDeviceToHost(
+void *dst, const void *src, std::size_t count) {
+  // TODO: Use cudaMemcpyAsync when we have support for stream.
+  CUDA_REPORT_IF_ERROR(cudaMemcpy(dst, src, count, cudaMemcpyDeviceToHost));
+  return dst;
+}
+
+static void *MemmoveDeviceToDevice(
+void *dst, const void *src, std::size_t count) {
+  // TODO: Use cudaMemcpyAsync when we have support for stream.
+  CUDA_REPORT_IF_ERROR(cudaMemcpy(dst, src, count, cudaMemcpyHostToDevice));

Renaud-K wrote:

DeviceToDevice?

https://github.com/llvm/llvm-project/pull/114302
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [flang] [flang][cuda] Data transfer with descriptor (PR #114302)

2024-10-30 Thread Renaud Kauffmann via llvm-branch-commits

https://github.com/Renaud-K approved this pull request.

Looks good. Nice way of testing the runtime. 

https://github.com/llvm/llvm-project/pull/114302
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [flang] [flang][cuda] Convert gpu.launch_func to CUFLaunchClusterKernel when cluster dims are present (PR #113959)

2024-10-28 Thread Renaud Kauffmann via llvm-branch-commits

https://github.com/Renaud-K approved this pull request.

LGTM.

https://github.com/llvm/llvm-project/pull/113959
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits