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
af8bdb43
Unverified
Commit
af8bdb43
authored
Jun 25, 2025
by
PanZezhong1725
Committed by
GitHub
Jun 25, 2025
Browse files
Merge pull request #272 from InfiniTensor/issue/271
issue/271: xmake modify in moore gpu
parents
8a22f194
a1fedf0d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
6 deletions
+17
-6
xmake/musa.lua
xmake/musa.lua
+17
-6
No files found.
xmake/musa.lua
View file @
af8bdb43
local
MUSA_
HOME
=
os.getenv
(
"MUSA_
INSTALL
_PATH"
)
local
MUSA_
ROOT
=
os.getenv
(
"MUSA_
ROOT"
)
or
os.getenv
(
"MUSA_HOME"
)
or
os.getenv
(
"MUSA
_PATH"
)
add_includedirs
(
MUSA_
HOME
..
"/include"
)
add_includedirs
(
MUSA_
ROOT
..
"/include"
)
add_linkdirs
(
MUSA_
HOME
..
"/lib"
)
add_linkdirs
(
MUSA_
ROOT
..
"/lib"
)
add_links
(
"musa"
,
"musart"
,
"mudnn"
,
"mublas"
)
add_links
(
"musa"
,
"musart"
,
"mudnn"
,
"mublas"
)
rule
(
"mu"
)
rule
(
"mu"
)
...
@@ -13,13 +13,24 @@ rule("mu")
...
@@ -13,13 +13,24 @@ rule("mu")
local
objectfile
=
target
:
objectfile
(
sourcefile
)
local
objectfile
=
target
:
objectfile
(
sourcefile
)
os
.
mkdir
(
path
.
directory
(
objectfile
))
os
.
mkdir
(
path
.
directory
(
objectfile
))
local
mcc
=
MUSA_
HOME
..
"/bin/mcc"
local
mcc
=
MUSA_
ROOT
..
"/bin/mcc"
local
includedirs
=
table.concat
(
target
:
get
(
"includedirs"
),
" "
)
local
includedirs
=
table.concat
(
target
:
get
(
"includedirs"
),
" "
)
local
args
=
{
"-c"
,
sourcefile
,
"-o"
,
objectfile
,
"-I"
..
MUSA_HOME
..
"/include"
,
"-O3"
,
"-fPIC"
,
"-Wall"
,
"-std=c++17"
,
"-pthread"
}
local
args
=
{
"-c"
,
sourcefile
,
"-o"
,
objectfile
,
"-I"
..
MUSA_ROOT
..
"/include"
,
"-O3"
,
"-fPIC"
,
"-Wall"
,
"-std=c++17"
,
"-pthread"
}
for
_
,
includedir
in
ipairs
(
target
:
get
(
"includedirs"
))
do
for
_
,
includedir
in
ipairs
(
target
:
get
(
"includedirs"
))
do
table.insert
(
args
,
"-I"
..
includedir
)
table.insert
(
args
,
"-I"
..
includedir
)
end
end
-- ============================
-- Retrieve all preprocessor defines added to the current target
local
defines
=
target
:
get
(
"defines"
)
if
defines
then
for
_
,
define
in
ipairs
(
defines
)
do
table.insert
(
args
,
"-D"
..
define
)
end
end
-- ===================================
os
.
execv
(
mcc
,
args
)
os
.
execv
(
mcc
,
args
)
table.insert
(
target
:
objectfiles
(),
objectfile
)
table.insert
(
target
:
objectfiles
(),
objectfile
)
end
)
end
)
...
@@ -31,7 +42,7 @@ target("infiniop-moore")
...
@@ -31,7 +42,7 @@ target("infiniop-moore")
set_languages
(
"cxx17"
)
set_languages
(
"cxx17"
)
set_warnings
(
"all"
,
"error"
)
set_warnings
(
"all"
,
"error"
)
add_cxflags
(
"-lstdc++"
,
"-fPIC"
,
"-Wno-comment"
)
add_cxflags
(
"-lstdc++"
,
"-fPIC"
,
"-Wno-comment"
)
add_files
(
"../src/infiniop/devices/musa/*.cc"
,
"../src/infiniop/ops/*/musa/*.cc"
)
add_files
(
"../src/infiniop/devices/musa/*.cc"
)
add_files
(
"../src/infiniop/ops/*/musa/*.mu"
,
{
rule
=
"mu"
})
add_files
(
"../src/infiniop/ops/*/musa/*.mu"
,
{
rule
=
"mu"
})
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