fix ginkgo cuda (#5507)

pull/5517/head
Inari0 1 month ago committed by GitHub
parent e5da705830
commit 9b5eeb800b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 15
      packages/g/ginkgo/xmake.lua

@ -13,6 +13,9 @@ package("ginkgo")
add_configs("cuda", {description = "Compile kernels for NVIDIA GPUs.", default = false, type = "boolean"})
add_configs("hip", {description = "Compile kernels for AMD or NVIDIA GPUs.", default = false, type = "boolean"})
add_configs("sycl", {description = "Compile SYCL kernels for Intel GPUs or other SYCL enabled hardware.", default = false, type = "boolean"})
add_configs("jacobi_full", {description = "Use all the optimizations for the CUDA Jacobi algorithm.", default = false, type = "boolean"})
set_policy("package.cmake_generator.ninja", false)
add_deps("cmake")
on_load("windows", "macosx", "linux", function (package)
@ -20,7 +23,10 @@ package("ginkgo")
package:add("deps", "openmp")
end
if package:config("cuda") then
package:add("deps", "cuda")
package:add("deps", "cuda", {configs = {utils = {"cublas", "cusparse"}}})
end
if not (package:is_plat("windows") and package:config("shared")) then
package:add("deps", "ninja")
end
-- TODO: add hip and sycl
end)
@ -33,7 +39,12 @@ package("ginkgo")
table.insert(configs, "-DGINKGO_BUILD_HIP=" .. (package:config("hip") and "ON" or "OFF"))
table.insert(configs, "-DGINKGO_BUILD_SYCL=" .. (package:config("sycl") and "ON" or "OFF"))
table.insert(configs, "-DGINKGO_BUILD_OMP=" .. (package:config("openmp") and "ON" or "OFF"))
import("package.tools.cmake").install(package, configs)
table.insert(configs, "-DGINKGO_JACOBI_FULL_OPTIMIZATIONS=" .. (package:config("jacobi_full") and "ON" or "OFF"))
local opt = {}
if not (package:is_plat("windows") and package:config("shared")) then
opt.cmake_generator = "Ninja"
end
import("package.tools.cmake").install(package, configs, opt)
end)
on_test(function (package)

Loading…
Cancel
Save