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
ecb6793b
Commit
ecb6793b
authored
Mar 03, 2025
by
PanZezhong
Browse files
issue/78 添加utils target
parent
be731358
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
33 additions
and
5 deletions
+33
-5
src/infinirt/cuda/infinirt_cuda.cu
src/infinirt/cuda/infinirt_cuda.cu
+1
-1
src/utils.h
src/utils.h
+7
-0
src/utils/check.h
src/utils/check.h
+3
-3
src/utils/rearrange.cc
src/utils/rearrange.cc
+1
-0
src/utils/rearrange.h
src/utils/rearrange.h
+13
-0
xmake.lua
xmake.lua
+8
-1
No files found.
src/infinirt/cuda/infinirt_cuda.cu
View file @
ecb6793b
#include "../../
check
.h"
#include "../../
utils
.h"
#include "infinirt_cuda.cuh"
#include "infinirt_cuda.cuh"
#include <cuda_runtime.h>
#include <cuda_runtime.h>
...
...
src/utils.h
0 → 100644
View file @
ecb6793b
#ifndef INFINIUTILS_H
#define INFINIUTILS_H
#include "utils/check.h"
#include "utils/rearrange.h"
#endif
src/check.h
→
src/
utils/
check.h
View file @
ecb6793b
#ifndef INFINI_CHECK_H
#ifndef INFINI
UTILS
_CHECK_H
#define INFINI_CHECK_H
#define INFINI
UTILS
_CHECK_H
#include <iostream>
#include <iostream>
#define CHECK_API_OR(API, EXPECT, ACTION) \
#define CHECK_API_OR(API, EXPECT, ACTION) \
...
@@ -15,4 +15,4 @@
...
@@ -15,4 +15,4 @@
#define CHECK_INTERNAL(API, EXPECT) CHECK_API_OR(API, EXPECT, return INFINI_STATUS_INTERNAL_ERROR)
#define CHECK_INTERNAL(API, EXPECT) CHECK_API_OR(API, EXPECT, return INFINI_STATUS_INTERNAL_ERROR)
#endif // INFINI_CHECK_H
#endif // INFINI
UTILS
_CHECK_H
src/utils/rearrange.cc
0 → 100644
View file @
ecb6793b
#include "rearrange.h"
src/utils/rearrange.h
0 → 100644
View file @
ecb6793b
#ifndef INFINIUTILS_REARRANGE_H
#define INFINIUTILS_REARRANGE_H
#include <stddef.h>
void
rearrange
(
void
*
dst
,
const
void
*
src
,
const
size_t
*
shape
,
const
ptrdiff_t
*
dst_strides
,
const
ptrdiff_t
*
src_strides
,
const
size_t
ndim
,
size_t
element_size
);
#endif // INFINIUTILS_REARRANGE_H
xmake.lua
View file @
ecb6793b
...
@@ -112,9 +112,15 @@ if has_config("kunlun-xpu") then
...
@@ -112,9 +112,15 @@ if has_config("kunlun-xpu") then
includes
(
"xmake/kunlun.lua"
)
includes
(
"xmake/kunlun.lua"
)
end
end
target
(
"infini-utils"
)
set_kind
(
"static"
)
set_languages
(
"cxx17"
)
add_files
(
"src/utils/*.cc"
)
target_end
()
target
(
"infiniop"
)
target
(
"infiniop"
)
set_kind
(
"shared"
)
set_kind
(
"shared"
)
add_deps
(
"infini-utils"
)
if
has_config
(
"cpu"
)
then
if
has_config
(
"cpu"
)
then
add_deps
(
"infiniop-cpu"
)
add_deps
(
"infiniop-cpu"
)
end
end
...
@@ -162,6 +168,7 @@ target_end()
...
@@ -162,6 +168,7 @@ target_end()
target
(
"infinirt"
)
target
(
"infinirt"
)
set_kind
(
"shared"
)
set_kind
(
"shared"
)
add_deps
(
"infini-utils"
)
if
has_config
(
"cpu"
)
then
if
has_config
(
"cpu"
)
then
add_deps
(
"infinirt-cpu"
)
add_deps
(
"infinirt-cpu"
)
end
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