Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
MegEngine 天元
MegEngine
提交
5c29dffc
MegEngine
项目概览
MegEngine 天元
/
MegEngine
1 年多 前同步成功
通知
403
Star
4705
Fork
582
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
MegEngine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
提交
5c29dffc
编写于
3月 20, 2023
作者:
M
Megvii Engine Team
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix(imperative): fix imperative exit segment fault
GitOrigin-RevId: dc498e3634a11aae4e3b3af69c0f398a55b3b0dc
上级
c530ccc3
变更
25
显示空白变更内容
内联
并排
Showing
25 changed file
with
75 addition
and
31 deletion
+75
-31
CMakeLists.txt
CMakeLists.txt
+6
-0
dnn/test/aarch64/relayout.cpp
dnn/test/aarch64/relayout.cpp
+1
-1
dnn/test/arm_common/elemwise.cpp
dnn/test/arm_common/elemwise.cpp
+2
-2
dnn/test/arm_common/elemwise_multi_type.cpp
dnn/test/arm_common/elemwise_multi_type.cpp
+1
-1
dnn/test/common/small_vector.cpp
dnn/test/common/small_vector.cpp
+2
-2
dnn/test/cpu/relayout.cpp
dnn/test/cpu/relayout.cpp
+1
-1
dnn/test/cuda/elemwise.cpp
dnn/test/cuda/elemwise.cpp
+1
-1
dnn/test/cuda/elemwise_multi_type.cpp
dnn/test/cuda/elemwise_multi_type.cpp
+1
-1
dnn/test/cuda/relayout.cpp
dnn/test/cuda/relayout.cpp
+1
-1
dnn/test/fallback/elemwise.cpp
dnn/test/fallback/elemwise.cpp
+1
-1
dnn/test/fallback/elemwise_multi_type.cpp
dnn/test/fallback/elemwise_multi_type.cpp
+1
-1
dnn/test/fallback/relayout.cpp
dnn/test/fallback/relayout.cpp
+1
-1
dnn/test/rocm/elemwise.cpp
dnn/test/rocm/elemwise.cpp
+1
-1
dnn/test/rocm/relayout.cpp
dnn/test/rocm/relayout.cpp
+1
-1
dnn/test/x86/elemwise.cpp
dnn/test/x86/elemwise.cpp
+1
-1
dnn/test/x86/elemwise_multi_type.cpp
dnn/test/x86/elemwise_multi_type.cpp
+1
-1
imperative/python/src/tensor.cpp
imperative/python/src/tensor.cpp
+9
-0
imperative/python/test/unit/core/test_imperative_rt.py
imperative/python/test/unit/core/test_imperative_rt.py
+27
-0
imperative/src/include/megbrain/imperative/utils/platform.h
imperative/src/include/megbrain/imperative/utils/platform.h
+1
-1
src/core/test/comp_node.cpp
src/core/test/comp_node.cpp
+1
-1
src/core/test/static_mem_alloc.cpp
src/core/test/static_mem_alloc.cpp
+2
-2
src/gopt/test/basic_arith.cpp
src/gopt/test/basic_arith.cpp
+2
-0
src/jit/test/codegen.cpp
src/jit/test/codegen.cpp
+5
-5
src/jit/test/fusion.cpp
src/jit/test/fusion.cpp
+2
-2
src/opr/test/basic_arith/elemwise.cpp
src/opr/test/basic_arith/elemwise.cpp
+3
-3
未找到文件。
CMakeLists.txt
浏览文件 @
5c29dffc
...
...
@@ -1089,6 +1089,11 @@ if(MGE_WITH_JIT AND MGE_WITH_HALIDE)
include
(
cmake/Halide.cmake
)
endif
()
if
(
MGE_ENABLE_EXCEPTIONS
)
add_compile_definitions
(
CPP_REDIS_ENABLE_EXCEPTION=1
)
else
()
add_compile_definitions
(
CPP_REDIS_ENABLE_EXCEPTION=0
)
endif
()
include
(
cmake/cpp_redis.cmake
)
# Thread
...
...
@@ -1133,6 +1138,7 @@ if(MSVC OR WIN32)
endif
()
if
(
CMAKE_THREAD_LIBS_INIT
OR CMAKE_HAVE_LIBC_PTHREAD
OR CMAKE_USE_WIN32_THREADS_INIT
OR ANDROID
)
set
(
MGB_HAVE_THREAD 1
)
...
...
dnn/test/aarch64/relayout.cpp
浏览文件 @
5c29dffc
...
...
@@ -12,7 +12,7 @@ namespace test {
namespace
{
template
<
typename
tag
>
class
AARCH64_RELAYOUT
:
public
AARCH64
{};
TYPED_TEST_
CAS
E
(
AARCH64_RELAYOUT
,
relayout
::
test_types
);
TYPED_TEST_
SUIT
E
(
AARCH64_RELAYOUT
,
relayout
::
test_types
);
TYPED_TEST
(
AARCH64_RELAYOUT
,
run
)
{
relayout
::
run_test
<
TypeParam
>
(
this
->
handle
());
}
...
...
dnn/test/arm_common/elemwise.cpp
浏览文件 @
5c29dffc
...
...
@@ -12,14 +12,14 @@ using namespace test;
template
<
typename
tag
>
class
ARM_ELEMWISE
:
public
ARM_COMMON
{};
TYPED_TEST_
CAS
E
(
ARM_ELEMWISE
,
elemwise
::
test_types
);
TYPED_TEST_
SUIT
E
(
ARM_ELEMWISE
,
elemwise
::
test_types
);
TYPED_TEST
(
ARM_ELEMWISE
,
run
)
{
elemwise
::
run_test
<
TypeParam
>
(
this
->
handle
());
}
template
<
typename
tag
>
class
ARM_ELEMWISE_MULTI_THREADS
:
public
ARM_COMMON_MULTI_THREADS
{};
TYPED_TEST_
CAS
E
(
ARM_ELEMWISE_MULTI_THREADS
,
elemwise
::
test_types
);
TYPED_TEST_
SUIT
E
(
ARM_ELEMWISE_MULTI_THREADS
,
elemwise
::
test_types
);
TYPED_TEST
(
ARM_ELEMWISE_MULTI_THREADS
,
run
)
{
elemwise
::
run_test
<
TypeParam
>
(
this
->
handle
());
}
...
...
dnn/test/arm_common/elemwise_multi_type.cpp
浏览文件 @
5c29dffc
...
...
@@ -14,7 +14,7 @@ using namespace test;
namespace
{
template
<
typename
tag
>
class
ARM_COMMON_ELEMWISE_MULTI_TYPE
:
public
ARM_COMMON
{};
TYPED_TEST_
CAS
E
(
ARM_COMMON_ELEMWISE_MULTI_TYPE
,
elemwise_multi_type
::
test_types
);
TYPED_TEST_
SUIT
E
(
ARM_COMMON_ELEMWISE_MULTI_TYPE
,
elemwise_multi_type
::
test_types
);
}
// anonymous namespace
TYPED_TEST
(
ARM_COMMON_ELEMWISE_MULTI_TYPE
,
run
)
{
...
...
dnn/test/common/small_vector.cpp
浏览文件 @
5c29dffc
...
...
@@ -231,7 +231,7 @@ typedef ::testing::Types<
SmallVector
<
Constructable
,
2
>
,
SmallVector
<
Constructable
,
4
>
,
SmallVector
<
Constructable
,
5
>>
SmallVectorTestTypes
;
TYPED_TEST_
CAS
E
(
SmallVectorTest
,
SmallVectorTestTypes
);
TYPED_TEST_
SUIT
E
(
SmallVectorTest
,
SmallVectorTestTypes
);
// Constructor test.
TYPED_TEST
(
SmallVectorTest
,
ConstructorNonIterTest
)
{
SCOPED_TRACE
(
"ConstructorTest"
);
...
...
@@ -836,7 +836,7 @@ typedef ::testing::Types<
std
::
pair
<
SmallVector
<
Constructable
,
2
>
,
SmallVector
<
Constructable
,
2
>>>
DualSmallVectorTestTypes
;
TYPED_TEST_
CAS
E
(
DualSmallVectorsTest
,
DualSmallVectorTestTypes
);
TYPED_TEST_
SUIT
E
(
DualSmallVectorsTest
,
DualSmallVectorTestTypes
);
TYPED_TEST
(
DualSmallVectorsTest
,
MoveAssignment
)
{
SCOPED_TRACE
(
"MoveAssignTest-DualVectorTypes"
);
...
...
dnn/test/cpu/relayout.cpp
浏览文件 @
5c29dffc
...
...
@@ -12,7 +12,7 @@ using namespace test;
namespace
{
template
<
typename
tag
>
class
CPU_RELAYOUT
:
public
CPU
{};
TYPED_TEST_
CAS
E
(
CPU_RELAYOUT
,
relayout
::
test_types
);
TYPED_TEST_
SUIT
E
(
CPU_RELAYOUT
,
relayout
::
test_types
);
TYPED_TEST
(
CPU_RELAYOUT
,
run
)
{
relayout
::
run_test
<
TypeParam
>
(
this
->
handle
());
}
...
...
dnn/test/cuda/elemwise.cpp
浏览文件 @
5c29dffc
...
...
@@ -71,7 +71,7 @@ void run_tensor_add(
template
<
typename
tag
>
class
CUDA_ELEMWISE
:
public
CUDA
{};
TYPED_TEST_
CAS
E
(
CUDA_ELEMWISE
,
elemwise
::
test_types
);
TYPED_TEST_
SUIT
E
(
CUDA_ELEMWISE
,
elemwise
::
test_types
);
TYPED_TEST
(
CUDA_ELEMWISE
,
run
)
{
elemwise
::
run_test
<
TypeParam
>
(
this
->
handle_cuda
());
}
...
...
dnn/test/cuda/elemwise_multi_type.cpp
浏览文件 @
5c29dffc
...
...
@@ -13,7 +13,7 @@ using namespace test;
namespace
{
template
<
typename
tag
>
class
CUDA_ELEMWISE_MULTI_TYPE
:
public
CUDA
{};
TYPED_TEST_
CAS
E
(
CUDA_ELEMWISE_MULTI_TYPE
,
elemwise_multi_type
::
test_types
);
TYPED_TEST_
SUIT
E
(
CUDA_ELEMWISE_MULTI_TYPE
,
elemwise_multi_type
::
test_types
);
}
// anonymous namespace
TYPED_TEST
(
CUDA_ELEMWISE_MULTI_TYPE
,
run
)
{
...
...
dnn/test/cuda/relayout.cpp
浏览文件 @
5c29dffc
...
...
@@ -11,7 +11,7 @@ using namespace test;
namespace
{
template
<
typename
tag
>
class
CUDA_RELAYOUT
:
public
CUDA
{};
TYPED_TEST_
CAS
E
(
CUDA_RELAYOUT
,
relayout
::
test_types
);
TYPED_TEST_
SUIT
E
(
CUDA_RELAYOUT
,
relayout
::
test_types
);
TYPED_TEST
(
CUDA_RELAYOUT
,
run
)
{
relayout
::
run_test
<
TypeParam
>
(
this
->
handle_cuda
());
}
...
...
dnn/test/fallback/elemwise.cpp
浏览文件 @
5c29dffc
...
...
@@ -11,7 +11,7 @@ using namespace test;
template
<
typename
tag
>
class
FALLBACK_ELEMWISE
:
public
FALLBACK
{};
TYPED_TEST_
CAS
E
(
FALLBACK_ELEMWISE
,
elemwise
::
test_types
);
TYPED_TEST_
SUIT
E
(
FALLBACK_ELEMWISE
,
elemwise
::
test_types
);
TYPED_TEST
(
FALLBACK_ELEMWISE
,
run
)
{
elemwise
::
run_test
<
TypeParam
>
(
this
->
handle
());
}
...
...
dnn/test/fallback/elemwise_multi_type.cpp
浏览文件 @
5c29dffc
...
...
@@ -8,7 +8,7 @@ using namespace test;
namespace
{
template
<
typename
tag
>
class
FALLBACK_ELEMWISE_MULTI_TYPE
:
public
FALLBACK
{};
TYPED_TEST_
CAS
E
(
FALLBACK_ELEMWISE_MULTI_TYPE
,
elemwise_multi_type
::
test_types
);
TYPED_TEST_
SUIT
E
(
FALLBACK_ELEMWISE_MULTI_TYPE
,
elemwise_multi_type
::
test_types
);
}
// anonymous namespace
TYPED_TEST
(
FALLBACK_ELEMWISE_MULTI_TYPE
,
run
)
{
...
...
dnn/test/fallback/relayout.cpp
浏览文件 @
5c29dffc
...
...
@@ -14,7 +14,7 @@ using namespace test;
namespace
{
template
<
typename
tag
>
class
FALLBACK_RELAYOUT
:
public
FALLBACK
{};
TYPED_TEST_
CAS
E
(
FALLBACK_RELAYOUT
,
relayout
::
test_types
);
TYPED_TEST_
SUIT
E
(
FALLBACK_RELAYOUT
,
relayout
::
test_types
);
TYPED_TEST
(
FALLBACK_RELAYOUT
,
run
)
{
relayout
::
run_test
<
TypeParam
>
(
this
->
handle
());
}
...
...
dnn/test/rocm/elemwise.cpp
浏览文件 @
5c29dffc
...
...
@@ -52,7 +52,7 @@ void run_elemwise_benchmark(
template
<
typename
tag
>
class
ROCM_ELEMWISE
:
public
ROCM
{};
TYPED_TEST_
CAS
E
(
ROCM_ELEMWISE
,
elemwise
::
test_types
);
TYPED_TEST_
SUIT
E
(
ROCM_ELEMWISE
,
elemwise
::
test_types
);
TYPED_TEST
(
ROCM_ELEMWISE
,
run
)
{
elemwise
::
run_test
<
TypeParam
>
(
this
->
handle_rocm
());
}
...
...
dnn/test/rocm/relayout.cpp
浏览文件 @
5c29dffc
...
...
@@ -13,7 +13,7 @@ using namespace test;
namespace
{
template
<
typename
tag
>
class
ROCM_RELAYOUT
:
public
ROCM
{};
TYPED_TEST_
CAS
E
(
ROCM_RELAYOUT
,
relayout
::
test_types
);
TYPED_TEST_
SUIT
E
(
ROCM_RELAYOUT
,
relayout
::
test_types
);
TYPED_TEST
(
ROCM_RELAYOUT
,
run
)
{
relayout
::
run_test
<
TypeParam
>
(
this
->
handle_rocm
());
}
...
...
dnn/test/x86/elemwise.cpp
浏览文件 @
5c29dffc
...
...
@@ -212,7 +212,7 @@ TEST_F(X86, ELEMWISE_FORWARD_TERNARY) {
template
<
typename
tag
>
class
X86_ELEMWISE
:
public
X86
{};
TYPED_TEST_
CAS
E
(
X86_ELEMWISE
,
elemwise
::
test_types
);
TYPED_TEST_
SUIT
E
(
X86_ELEMWISE
,
elemwise
::
test_types
);
TYPED_TEST
(
X86_ELEMWISE
,
run
)
{
elemwise
::
run_test
<
TypeParam
>
(
this
->
handle
());
}
...
...
dnn/test/x86/elemwise_multi_type.cpp
浏览文件 @
5c29dffc
...
...
@@ -11,7 +11,7 @@ using namespace test;
namespace
{
template
<
typename
tag
>
class
X86_ELEMWISE_MULTI_TYPE
:
public
X86
{};
TYPED_TEST_
CAS
E
(
X86_ELEMWISE_MULTI_TYPE
,
elemwise_multi_type
::
test_types
);
TYPED_TEST_
SUIT
E
(
X86_ELEMWISE_MULTI_TYPE
,
elemwise_multi_type
::
test_types
);
}
// anonymous namespace
TYPED_TEST
(
X86_ELEMWISE_MULTI_TYPE
,
run
)
{
...
...
imperative/python/src/tensor.cpp
浏览文件 @
5c29dffc
...
...
@@ -994,6 +994,15 @@ void init_tensor(py::module m) {
sync_py_task_q
();
});
m
.
def
(
"close"
,
[
channel
]()
{
// sync channel and compnode before close to ensure all tasks have been completed
if
(
channel
->
check_available
())
{
channel
->
sync
();
}
CompNode
::
sync_all
();
CompNode
::
foreach
([](
CompNode
cn
)
{
auto
err
=
cn
.
check_async_error
();
mgb_assert
(
!
err
,
"%s"
,
err
->
what
());
});
channel
->
close
();
sync_py_task_q
();
});
...
...
imperative/python/test/unit/core/test_imperative_rt.py
浏览文件 @
5c29dffc
...
...
@@ -71,3 +71,30 @@ def test_opdef_path():
assert
Mode
.
__module__
==
"megengine.core._imperative_rt.ops"
assert
Mode
.
__name__
==
"Mode"
assert
Mode
.
__qualname__
==
"Elemwise.Mode"
def
_exit_impl
():
import
numpy
as
np
import
megengine
from
megengine
import
functional
as
F
megengine
.
set_default_device
(
"cpu0"
)
in_channel
=
32
out_channel
=
32
x
=
megengine
.
tensor
(
np
.
random
.
randn
(
32
,
in_channel
,
224
,
224
).
astype
(
np
.
float32
))
w
=
megengine
.
tensor
(
np
.
random
.
randn
(
out_channel
,
in_channel
,
3
,
3
).
astype
(
np
.
float32
)
)
y
=
F
.
conv2d
(
x
,
w
)
def
test_imperative_exit
():
import
multiprocessing
as
mp
recover
=
mp
.
get_start_method
()
mp
.
set_start_method
(
"spawn"
,
force
=
True
)
pro
=
mp
.
Process
(
target
=
_exit_impl
)
pro
.
start
()
pro
.
join
()
assert
pro
.
exitcode
==
0
,
f
"
{
pro
.
exitcode
}
"
mp
.
set_start_method
(
recover
,
force
=
True
)
imperative/src/include/megbrain/imperative/utils/platform.h
浏览文件 @
5c29dffc
#pragma once
#include <string>
#include <typeinfo>
namespace
mgb
::
imperative
{
std
::
string
demangle
(
std
::
string
mangled
);
...
...
src/core/test/comp_node.cpp
浏览文件 @
5c29dffc
...
...
@@ -789,7 +789,7 @@ TEST(TestCompNode, DepedentObjectList) {
namespace
{
template
<
typename
tag
>
class
TestCPUCompSeqRec
:
public
::
testing
::
Test
{};
TYPED_TEST_
CAS
E
(
TestCPUCompSeqRec
,
comp_node_test
::
seq_rec
::
test_types
);
TYPED_TEST_
SUIT
E
(
TestCPUCompSeqRec
,
comp_node_test
::
seq_rec
::
test_types
);
TYPED_TEST
(
TestCPUCompSeqRec
,
run
)
{
comp_node_test
::
seq_rec
::
run
<
TypeParam
>
(
CompNode
::
load
(
"cpux"
));
}
...
...
src/core/test/static_mem_alloc.cpp
浏览文件 @
5c29dffc
...
...
@@ -124,7 +124,7 @@ TEST_P(BasicCorrectness, OverwriteSameEnd) {
ASSERT_EQ
(
align
(
1
+
padding
()),
allocator
->
tot_alloc_lower_bound
());
}
INSTANTIATE_TEST_
CAS
E_P
(
INSTANTIATE_TEST_
SUIT
E_P
(
TestStaticMemAllocAlgo
,
BasicCorrectness
,
TestParam
::
make_values
({
1
,
2
},
{
1
,
2
},
{
1
}));
...
...
@@ -207,7 +207,7 @@ TEST_P(RandomOpr, Main) {
timer
.
get_secs
(),
sz_tot
,
sz_lower
,
double
(
sz_tot
)
/
sz_lower
-
1
);
}
INSTANTIATE_TEST_
CAS
E_P
(
INSTANTIATE_TEST_
SUIT
E_P
(
TestStaticMemAllocAlgo
,
RandomOpr
,
TestParam
::
make_values
(
{
1
,
256
},
{
1
,
32
},
{
10
,
INTERVAL_MOVE_MAX_SIZE
,
1000
,
10000
}));
...
...
src/gopt/test/basic_arith.cpp
浏览文件 @
5c29dffc
...
...
@@ -107,11 +107,13 @@ TEST(TestGoptBasicArithInplace, Absorbing) {
ASSERT_EQ
(
y
.
as_immutable_scalar
()
->
get_cast
<
float
>
(),
0.
f
);
}
namespace
{
auto
gen_postive
=
[](
HostTensorND
&
dest
)
{
HostTensorGenerator
<
dtype
::
Float32
,
RandomDistribution
::
UNIFORM
>
mask_generator
{
2.
f
,
4.
f
};
dest
=
*
mask_generator
(
dest
.
shape
(),
dest
.
comp_node
());
};
};
TEST
(
TestGoptBasicArithInplace
,
LogExpExpand
)
{
// test log(exp(a) * (exp(b) / (exp(c) * d**2))) -> a + b - c - log(d**2)
...
...
src/jit/test/codegen.cpp
浏览文件 @
5c29dffc
...
...
@@ -290,7 +290,7 @@ void run_mlir_mode(CompNode cn) {
#if MGB_JIT_HALIDE
template
<
typename
tag
>
class
TestJITHalideCodeGenCuda
:
public
::
testing
::
Test
{};
TYPED_TEST_
CAS
E
(
TestJITHalideCodeGenCuda
,
test_types
);
TYPED_TEST_
SUIT
E
(
TestJITHalideCodeGenCuda
,
test_types
);
TYPED_TEST
(
TestJITHalideCodeGenCuda
,
run
)
{
REQUIRE_GPU
(
1
);
run
<
TypeParam
>
(
Backend
::
HALIDE
,
CompNode
::
load
(
"gpu0"
));
...
...
@@ -301,7 +301,7 @@ TYPED_TEST(TestJITHalideCodeGenCuda, run) {
template
<
typename
tag
>
class
TestJITNvrtcCodeGen
:
public
::
testing
::
Test
{};
TYPED_TEST_
CAS
E
(
TestJITNvrtcCodeGen
,
test_types
);
TYPED_TEST_
SUIT
E
(
TestJITNvrtcCodeGen
,
test_types
);
TYPED_TEST
(
TestJITNvrtcCodeGen
,
run
)
{
REQUIRE_GPU
(
1
);
run
<
TypeParam
>
(
Backend
::
NVRTC
,
CompNode
::
load
(
"gpu0"
));
...
...
@@ -344,7 +344,7 @@ FOREACH_UNARY_MODE(def_tag)
#define t(n) n,
using
mlir_elemwise_unary_types
=
::
testing
::
Types
<
FOREACH_UNARY_MODE
(
t
)
ABS
>
;
#undef t
TYPED_TEST_
CAS
E
(
TestJITMlirUnaryElemwise
,
mlir_elemwise_unary_types
);
TYPED_TEST_
SUIT
E
(
TestJITMlirUnaryElemwise
,
mlir_elemwise_unary_types
);
#define SKIP_MODE(_mode) \
if (TypeParam::mode == opr::Elemwise::Mode::_mode) { \
...
...
@@ -390,7 +390,7 @@ FOREACH_BINARY_MODE(def_tag)
#define t(n) n,
using
mlir_elemwise_binary_types
=
::
testing
::
Types
<
FOREACH_BINARY_MODE
(
t
)
ADD
>
;
#undef t
TYPED_TEST_
CAS
E
(
TestJITMlirBinaryElemwise
,
mlir_elemwise_binary_types
);
TYPED_TEST_
SUIT
E
(
TestJITMlirBinaryElemwise
,
mlir_elemwise_binary_types
);
TYPED_TEST
(
TestJITMlirBinaryElemwise
,
run
)
{
auto
cn
=
CompNode
::
load
(
"cpu0"
);
run_mlir_mode
<
TypeParam
,
2
>
(
cn
);
...
...
@@ -422,7 +422,7 @@ FOREACH_TERNARY_MODE(def_tag)
using
mlir_elemwise_ternary_types
=
::
testing
::
Types
<
FOREACH_TERNARY_MODE
(
t
)
COND_LEQ_MOV
>
;
#undef t
TYPED_TEST_
CAS
E
(
TestJITMlirTernaryElemwise
,
mlir_elemwise_ternary_types
);
TYPED_TEST_
SUIT
E
(
TestJITMlirTernaryElemwise
,
mlir_elemwise_ternary_types
);
TYPED_TEST
(
TestJITMlirTernaryElemwise
,
run
)
{
auto
cn
=
CompNode
::
load
(
"cpu0"
);
run_mlir_mode
<
TypeParam
,
3
>
(
cn
);
...
...
src/jit/test/fusion.cpp
浏览文件 @
5c29dffc
...
...
@@ -1147,7 +1147,7 @@ TEST(TestJITFusionHalide, SameGradOpr) {
template
<
typename
tag
>
class
TestJITHalideFusionCuda
:
public
::
testing
::
Test
{};
TYPED_TEST_
CAS
E
(
TestJITHalideFusionCuda
,
test_types
);
TYPED_TEST_
SUIT
E
(
TestJITHalideFusionCuda
,
test_types
);
TYPED_TEST
(
TestJITHalideFusionCuda
,
run
)
{
set_backend
(
Backend
::
NONE
);
...
...
@@ -1160,7 +1160,7 @@ TYPED_TEST(TestJITHalideFusionCuda, run) {
template
<
typename
tag
>
class
TestJITNvrtcFusion
:
public
::
testing
::
Test
{};
TYPED_TEST_
CAS
E
(
TestJITNvrtcFusion
,
test_types
);
TYPED_TEST_
SUIT
E
(
TestJITNvrtcFusion
,
test_types
);
TYPED_TEST
(
TestJITNvrtcFusion
,
run
)
{
set_backend
(
Backend
::
NONE
);
...
...
src/opr/test/basic_arith/elemwise.cpp
浏览文件 @
5c29dffc
...
...
@@ -812,7 +812,7 @@ typedef ::testing::Types<
void
// extra void to consume last comma
>
UnaryTraitTypes
;
TYPED_TEST_
CAS
E
(
TestOprBasicArithUnaryElemwise
,
UnaryTraitTypes
);
TYPED_TEST_
SUIT
E
(
TestOprBasicArithUnaryElemwise
,
UnaryTraitTypes
);
typedef
::
testing
::
Types
<
#define DEF_TRAIT(_mode, _expr) _mode,
...
...
@@ -821,7 +821,7 @@ typedef ::testing::Types<
void
// extra void to consume last comma
>
BinaryTraitTypes
;
TYPED_TEST_
CAS
E
(
TestOprBasicArithBinaryElemwise
,
BinaryTraitTypes
);
TYPED_TEST_
SUIT
E
(
TestOprBasicArithBinaryElemwise
,
BinaryTraitTypes
);
typedef
::
testing
::
Types
<
#define DEF_TRAIT(_mode, _expr) _mode,
...
...
@@ -830,7 +830,7 @@ typedef ::testing::Types<
void
// extra void to consume last comma
>
TernaryTraitTypes
;
TYPED_TEST_
CAS
E
(
TestOprBasicArithTernaryElemwise
,
TernaryTraitTypes
);
TYPED_TEST_
SUIT
E
(
TestOprBasicArithTernaryElemwise
,
TernaryTraitTypes
);
}
// anonymous namespace
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录