xmake.lua 1.1 KB

12345678910111213141516171819202122232425262728293031
  1. package("cumem")
  2. set_kind("library", {headeronly = true})
  3. set_description("CUDA Memory Management Wrapper with Type Safety")
  4. set_homepage("https://github.com/BinhaoQin/cuMem")
  5. add_urls("https://github.com/BinhaoQin/cuMem/archive/refs/tags/$(version).tar.gz",
  6. "https://github.com/BinhaoQin/cuMem.git")
  7. add_versions("1.0.0", "1c7956c840f7aa3940756c8d09a2ae44ce53681ae01f3378cf4501d81bf0638c")
  8. add_deps("cuda", {system = true})
  9. on_install("linux", "windows", function(package)
  10. os.mkdir("cuMem")
  11. os.cp("include/*.h", "cuMem")
  12. os.cp("cuMem", package:installdir("include"))
  13. end)
  14. on_test(function(package)
  15. assert(package:check_cxxsnippets({test = [[
  16. #include <cuMem/cuConstant.h>
  17. #include <cassert>
  18. class Int {
  19. public:
  20. int value;
  21. DEVICE_INDEPENDENT Int() : value(0) {}
  22. };
  23. void test() {
  24. static_assert(sizeof(Segment<Int>) == sizeof(Int));
  25. }
  26. ]]}, {configs = {languages = "c++17"}}))
  27. end)