ソースを参照

Added cumem (#1427)

* Added cumem

* Update xmake.lua

Co-authored-by: ruki <[email protected]>
Binhao Qin 3 年 前
コミット
bae0137abb
1 ファイル変更31 行追加0 行削除
  1. 31 0
      packages/c/cumem/xmake.lua

+ 31 - 0
packages/c/cumem/xmake.lua

@@ -0,0 +1,31 @@
+package("cumem")
+    set_kind("library", {headeronly = true})
+    set_description("CUDA Memory Management Wrapper with Type Safety")
+    set_homepage("https://github.com/BinhaoQin/cuMem")
+    
+    add_urls("https://github.com/BinhaoQin/cuMem/archive/refs/tags/$(version).tar.gz",
+             "https://github.com/BinhaoQin/cuMem.git")
+    add_versions("1.0.0", "1c7956c840f7aa3940756c8d09a2ae44ce53681ae01f3378cf4501d81bf0638c")
+    
+    add_deps("cuda", {system = true})
+
+    on_install("linux", "windows", function(package)
+        os.mkdir("cuMem")
+        os.cp("include/*.h", "cuMem")
+        os.cp("cuMem", package:installdir("include"))
+    end)
+
+    on_test(function(package)
+        assert(package:check_cxxsnippets({test = [[
+            #include <cuMem/cuConstant.h>
+            #include <cassert>
+            class Int {
+            public:
+                int value;
+                DEVICE_INDEPENDENT Int() : value(0) {}
+            };
+            void test() {
+               static_assert(sizeof(Segment<Int>) == sizeof(Int));
+            }
+        ]]}, {configs = {languages = "c++17"}}))        
+    end)