[llvm] [offload] Add properties parameter to olLaunchKernel (PR #184343)

Joseph Huber via llvm-commits llvm-commits at lists.llvm.org
Wed Mar 4 10:00:58 PST 2026


================
@@ -1509,7 +1538,73 @@ Error CUDAKernelTy::launchImpl(GenericDeviceTy &GenericDevice,
         },
         &GenericDevice.Plugin);
 
-  return Plugin::check(Res, "error in cuLaunchKernel for '%s': %s", getName());
+  return Plugin::check(Res, "error in cuLaunchKernelEx for '%s': %s",
+                       getName());
+}
+
+Expected<uint32_t> CUDAKernelTy::getMaxCooperativeGroupCount(
+    GenericDeviceTy &GenericDevice, uint32_t WorkDim,
+    const size_t *LocalWorkSize, size_t DynamicSharedMemorySize) const {
+  CUDADeviceTy &CUDADevice = static_cast<CUDADeviceTy &>(GenericDevice);
+
+  uint32_t SupportsCooperative = 0;
+  if (auto Err = CUDADevice.getDeviceAttr(
+          CU_DEVICE_ATTRIBUTE_COOPERATIVE_LAUNCH, SupportsCooperative))
+    return Err;
+
+  if (!SupportsCooperative) {
+    return Plugin::error(ErrorCode::UNSUPPORTED,
+                         "Device does not support cooperative launch");
+  }
----------------
jhuber6 wrote:

```suggestion
  if (!SupportsCooperative)
    return Plugin::error(ErrorCode::UNSUPPORTED,
                         "Device does not support cooperative launch");
```

https://github.com/llvm/llvm-project/pull/184343


More information about the llvm-commits mailing list