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
d9de5133
Commit
d9de5133
authored
Jul 14, 2025
by
YdrMaster
Browse files
issue/158/refactor: 支持天数的 pytorch 测试
Signed-off-by:
YdrMaster
<
ydrml@hotmail.com
>
parent
e09a0b7c
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
47 additions
and
7 deletions
+47
-7
src/infiniop/devices/nvidia/nvidia_common.cu
src/infiniop/devices/nvidia/nvidia_common.cu
+20
-4
src/infiniop/devices/nvidia/nvidia_handle.h
src/infiniop/devices/nvidia/nvidia_handle.h
+20
-3
test/infiniop/libinfiniop/utils.py
test/infiniop/libinfiniop/utils.py
+7
-0
No files found.
src/infiniop/devices/nvidia/nvidia_common.cu
View file @
d9de5133
#include "nvidia_handle.cuh"
namespace
device
::
nvidia
{
namespace
device
{
Handle
::
Handle
(
int
device_id
)
:
InfiniopHandle
{
INFINI_DEVICE_NVIDIA
,
device_id
},
namespace
nvidia
{
Handle
::
Handle
(
infiniDevice_t
device
,
int
device_id
)
:
InfiniopHandle
{
device
,
device_id
},
_internal
(
std
::
make_shared
<
Handle
::
Internal
>
(
device_id
))
{}
auto
Handle
::
internal
()
const
->
const
std
::
shared_ptr
<
Internal
>
&
{
...
...
@@ -83,9 +85,23 @@ cudnnDataType_t getCudnnDtype(infiniDtype_t dt) {
}
#endif
infiniStatus_t
Handle
::
create
(
InfiniopHandle
**
handle_ptr
,
int
device_id
)
{
*
handle_ptr
=
new
Handle
(
INFINI_DEVICE_NVIDIA
,
device_id
);
return
INFINI_STATUS_SUCCESS
;
}
}
// namespace nvidia
namespace
iluvatar
{
Handle
::
Handle
(
int
device_id
)
:
nvidia
::
Handle
(
INFINI_DEVICE_ILUVATAR
,
device_id
)
{}
infiniStatus_t
Handle
::
create
(
InfiniopHandle
**
handle_ptr
,
int
device_id
)
{
*
handle_ptr
=
new
Handle
(
device_id
);
return
INFINI_STATUS_SUCCESS
;
}
}
// namespace device::nvidia
}
// namespace iluvatar
}
// namespace device
src/infiniop/devices/nvidia/nvidia_handle.h
View file @
d9de5133
...
...
@@ -4,13 +4,17 @@
#include "../../handle.h"
#include <memory>
namespace
device
::
nvidia
{
namespace
device
{
namespace
nvidia
{
struct
Handle
:
public
InfiniopHandle
{
Handle
(
int
device_id
);
class
Internal
;
auto
internal
()
const
->
const
std
::
shared_ptr
<
Internal
>
&
;
protected:
Handle
(
infiniDevice_t
device
,
int
device_id
);
public:
static
infiniStatus_t
create
(
InfiniopHandle
**
handle_ptr
,
int
device_id
);
...
...
@@ -18,6 +22,19 @@ private:
std
::
shared_ptr
<
Internal
>
_internal
;
};
}
// namespace device::nvidia
}
// namespace nvidia
namespace
iluvatar
{
struct
Handle
:
public
nvidia
::
Handle
{
Handle
(
int
device_id
);
public:
static
infiniStatus_t
create
(
InfiniopHandle
**
handle_ptr
,
int
device_id
);
};
}
// namespace iluvatar
}
// namespace device
#endif // __INFINIOP_CUDA_HANDLE_H__
test/infiniop/libinfiniop/utils.py
View file @
d9de5133
...
...
@@ -262,6 +262,11 @@ def get_args():
action
=
"store_true"
,
help
=
"Run NVIDIA GPU test"
,
)
parser
.
add_argument
(
"--iluvatar"
,
action
=
"store_true"
,
help
=
"Run Iluvatar GPU test"
,
)
parser
.
add_argument
(
"--cambricon"
,
action
=
"store_true"
,
...
...
@@ -566,6 +571,8 @@ def get_test_devices(args):
devices_to_test
.
append
(
InfiniDeviceEnum
.
CPU
)
if
args
.
nvidia
:
devices_to_test
.
append
(
InfiniDeviceEnum
.
NVIDIA
)
if
args
.
iluvatar
:
devices_to_test
.
append
(
InfiniDeviceEnum
.
ILUVATAR
)
if
args
.
cambricon
:
import
torch_mlu
...
...
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