Added cumem (#1427)
* Added cumem * Update xmake.lua Co-authored-by: ruki <waruqi@gmail.com>pull/1429/head
parent
d9f8ee2465
commit
bae0137abb
1 changed files with 31 additions and 0 deletions
@ -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) |
Loading…
Reference in new issue