Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
jerrrrry
infinicore
Commits
d64c1b0f
Commit
d64c1b0f
authored
Mar 05, 2025
by
YdrMaster
Browse files
issue/87/style: 整理各个硬件 xmake 文件格式
Signed-off-by:
YdrMaster
<
ydrml@hotmail.com
>
parent
2538df1b
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
19 additions
and
16 deletions
+19
-16
xmake/ascend.lua
xmake/ascend.lua
+5
-4
xmake/bang.lua
xmake/bang.lua
+4
-2
xmake/cuda.lua
xmake/cuda.lua
+5
-6
xmake/kunlun.lua
xmake/kunlun.lua
+5
-4
No files found.
xmake/ascend.lua
View file @
d64c1b0f
...
@@ -41,15 +41,16 @@ rule_end()
...
@@ -41,15 +41,16 @@ rule_end()
target
(
"infiniop-ascend"
)
target
(
"infiniop-ascend"
)
set_kind
(
"static"
)
set_kind
(
"static"
)
add_deps
(
"infini-utils"
)
add_deps
(
"infini-utils"
)
set_languages
(
"cxx17"
)
on_install
(
function
(
target
)
end
)
on_install
(
function
(
target
)
end
)
-- Add files
add_cxflags
(
"-lstdc++ -fPIC"
)
set_warnings
(
"all"
,
"error"
)
set_languages
(
"cxx17"
)
add_files
(
"$(projectdir)/src/infiniop/devices/ascend/*.cc"
,
"$(projectdir)/src/infiniop/ops/*/ascend/*.cc"
)
add_files
(
"$(projectdir)/src/infiniop/devices/ascend/*.cc"
,
"$(projectdir)/src/infiniop/ops/*/ascend/*.cc"
)
add_cxflags
(
"-lstdc++ -Wall -Werror -fPIC"
)
-- Add operator
-- Add operator
-- TODO: add it back after ascend-kernels is fixed
-- TODO: add it back after ascend-kernels is fixed
-- add_rules("ascend-kernels")
-- add_rules("ascend-kernels")
-- add_links(builddir.."/libascend_kernels.a")
-- add_links(builddir.."/libascend_kernels.a")
target_end
()
target_end
()
xmake/bang.lua
View file @
d64c1b0f
...
@@ -31,7 +31,6 @@ rule("mlu")
...
@@ -31,7 +31,6 @@ rule("mlu")
os
.
execv
(
cc
,
args
)
os
.
execv
(
cc
,
args
)
table.insert
(
target
:
objectfiles
(),
objectfile
)
table.insert
(
target
:
objectfiles
(),
objectfile
)
end
)
end
)
rule_end
()
rule_end
()
local
src_dir
=
path
.
join
(
os
.
projectdir
(),
"src"
,
"infiniop"
)
local
src_dir
=
path
.
join
(
os
.
projectdir
(),
"src"
,
"infiniop"
)
...
@@ -40,11 +39,14 @@ target("infiniop-cambricon")
...
@@ -40,11 +39,14 @@ target("infiniop-cambricon")
set_kind
(
"static"
)
set_kind
(
"static"
)
add_deps
(
"infini-utils"
)
add_deps
(
"infini-utils"
)
on_install
(
function
(
target
)
end
)
on_install
(
function
(
target
)
end
)
add_cxflags
(
"-lstdc++ -fPIC"
)
set_warnings
(
"all"
,
"error"
)
set_languages
(
"cxx17"
)
set_languages
(
"cxx17"
)
add_files
(
src_dir
..
"/devices/bang/*.cc"
,
src_dir
..
"/ops/*/bang/*.cc"
)
add_files
(
src_dir
..
"/devices/bang/*.cc"
,
src_dir
..
"/ops/*/bang/*.cc"
)
local
mlu_files
=
os
.
files
(
src_dir
..
"/ops/*/bang/*.mlu"
)
local
mlu_files
=
os
.
files
(
src_dir
..
"/ops/*/bang/*.mlu"
)
if
#
mlu_files
>
0
then
if
#
mlu_files
>
0
then
add_files
(
mlu_files
,
{
rule
=
"mlu"
})
add_files
(
mlu_files
,
{
rule
=
"mlu"
})
end
end
add_cxflags
(
"-lstdc++ -Wall -Werror -fPIC"
)
target_end
()
target_end
()
xmake/cuda.lua
View file @
d64c1b0f
...
@@ -12,11 +12,10 @@ target("infiniop-cuda")
...
@@ -12,11 +12,10 @@ target("infiniop-cuda")
set_kind
(
"static"
)
set_kind
(
"static"
)
add_deps
(
"infini-utils"
)
add_deps
(
"infini-utils"
)
on_install
(
function
(
target
)
end
)
on_install
(
function
(
target
)
end
)
set_policy
(
"build.cuda.devlink"
,
true
)
set_policy
(
"build.cuda.devlink"
,
true
)
set_toolchains
(
"cuda"
)
set_toolchains
(
"cuda"
)
add_links
(
"cublas"
)
add_links
(
"cublas"
,
"cudnn"
)
add_links
(
"cudnn"
)
add_cugencodes
(
"native"
)
add_cugencodes
(
"native"
)
if
is_plat
(
"windows"
)
then
if
is_plat
(
"windows"
)
then
...
@@ -40,7 +39,10 @@ target("infinirt-cuda")
...
@@ -40,7 +39,10 @@ target("infinirt-cuda")
set_kind
(
"static"
)
set_kind
(
"static"
)
add_deps
(
"infini-utils"
)
add_deps
(
"infini-utils"
)
on_install
(
function
(
target
)
end
)
on_install
(
function
(
target
)
end
)
set_policy
(
"build.cuda.devlink"
,
true
)
set_policy
(
"build.cuda.devlink"
,
true
)
set_toolchains
(
"cuda"
)
add_links
(
"cudart"
)
if
is_plat
(
"windows"
)
then
if
is_plat
(
"windows"
)
then
add_cuflags
(
"-Xcompiler=/utf-8"
,
"--expt-relaxed-constexpr"
,
"--allow-unsupported-compiler"
)
add_cuflags
(
"-Xcompiler=/utf-8"
,
"--expt-relaxed-constexpr"
,
"--allow-unsupported-compiler"
)
...
@@ -50,9 +52,6 @@ target("infinirt-cuda")
...
@@ -50,9 +52,6 @@ target("infinirt-cuda")
add_cxflags
(
"-fPIC"
)
add_cxflags
(
"-fPIC"
)
end
end
set_toolchains
(
"cuda"
)
add_links
(
"cudart"
)
set_languages
(
"cxx17"
)
set_languages
(
"cxx17"
)
add_files
(
"../src/infinirt/cuda/*.cu"
)
add_files
(
"../src/infinirt/cuda/*.cu"
)
target_end
()
target_end
()
xmake/kunlun.lua
View file @
d64c1b0f
...
@@ -10,10 +10,11 @@ add_links("xpuapi")
...
@@ -10,10 +10,11 @@ add_links("xpuapi")
target
(
"infiniop-kunlun"
)
target
(
"infiniop-kunlun"
)
set_kind
(
"static"
)
set_kind
(
"static"
)
add_deps
(
"infini-utils"
)
add_deps
(
"infini-utils"
)
set_languages
(
"cxx17"
)
on_install
(
function
(
target
)
end
)
on_install
(
function
(
target
)
end
)
-- Add files
add_files
(
"$(projectdir)/src/infiniop/devices/kunlun/*.cc"
,
"$(projectdir)/src/infiniop/ops/*/kunlun/*.cc"
)
add_cxflags
(
"-lstdc++ -Wall -Werror -fPIC"
)
add_cxflags
(
"-lstdc++ -fPIC"
)
set_warnings
(
"all"
,
"error"
)
set_languages
(
"cxx17"
)
add_files
(
"$(projectdir)/src/infiniop/devices/kunlun/*.cc"
,
"$(projectdir)/src/infiniop/ops/*/kunlun/*.cc"
)
target_end
()
target_end
()
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment