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
gaoqiong
MIGraphX
Commits
aabb14ff
Commit
aabb14ff
authored
Jun 25, 2022
by
Paul
Browse files
Merge branch 'develop' into bert-opt2
parents
ad16770f
b75c83d8
Changes
1000
Hide whitespace changes
Inline
Side-by-side
Showing
20 changed files
with
495 additions
and
7 deletions
+495
-7
test/py/test_gpu_offload.py
test/py/test_gpu_offload.py
+23
-0
test/py/test_module_construct.py
test/py/test_module_construct.py
+23
-0
test/py/test_numpy.py
test/py/test_numpy.py
+23
-0
test/py/test_op.py
test/py/test_op.py
+23
-0
test/py/test_save_load.py
test/py/test_save_load.py
+23
-0
test/py/test_shape.py
test/py/test_shape.py
+23
-0
test/quantization.cpp
test/quantization.cpp
+23
-0
test/reduce_dims.cpp
test/reduce_dims.cpp
+58
-7
test/ref_dev_examples.cpp
test/ref_dev_examples.cpp
+23
-0
test/ref_dot_op_test.cpp
test/ref_dot_op_test.cpp
+23
-0
test/ref_loop_test.cpp
test/ref_loop_test.cpp
+23
-0
test/ref_ops_nonstd_shape_test.cpp
test/ref_ops_nonstd_shape_test.cpp
+23
-0
test/ref_ops_test.cpp
test/ref_ops_test.cpp
+23
-0
test/ref_rnn_ops_test.cpp
test/ref_rnn_ops_test.cpp
+23
-0
test/replace_allocate.cpp
test/replace_allocate.cpp
+23
-0
test/rewrite_batchnorm_test.cpp
test/rewrite_batchnorm_test.cpp
+23
-0
test/rewrite_pooling_test.cpp
test/rewrite_pooling_test.cpp
+23
-0
test/rewrite_quantization_test.cpp
test/rewrite_quantization_test.cpp
+23
-0
test/run_loop_test.cpp
test/run_loop_test.cpp
+23
-0
test/schedule_test.cpp
test/schedule_test.cpp
+23
-0
No files found.
Too many changes to show.
To preserve performance only
1000 of 1000+
files are displayed.
Plain diff
Email patch
test/py/test_gpu_offload.py
View file @
aabb14ff
#####################################################################################
# The MIT License (MIT)
#
# Copyright (c) 2015-2022 Advanced Micro Devices, Inc. All rights reserved.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.
#####################################################################################
import
migraphx
import
migraphx
p
=
migraphx
.
parse_onnx
(
"conv_relu_maxpool_test.onnx"
)
p
=
migraphx
.
parse_onnx
(
"conv_relu_maxpool_test.onnx"
)
...
...
test/py/test_module_construct.py
View file @
aabb14ff
#####################################################################################
# The MIT License (MIT)
#
# Copyright (c) 2015-2022 Advanced Micro Devices, Inc. All rights reserved.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.
#####################################################################################
import
migraphx
,
array
,
sys
import
migraphx
,
array
,
sys
...
...
test/py/test_numpy.py
View file @
aabb14ff
#####################################################################################
# The MIT License (MIT)
#
# Copyright (c) 2015-2022 Advanced Micro Devices, Inc. All rights reserved.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.
#####################################################################################
import
migraphx
,
sys
import
migraphx
,
sys
try
:
try
:
import
numpy
as
np
import
numpy
as
np
...
...
test/py/test_op.py
View file @
aabb14ff
#####################################################################################
# The MIT License (MIT)
#
# Copyright (c) 2015-2022 Advanced Micro Devices, Inc. All rights reserved.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.
#####################################################################################
import
migraphx
import
migraphx
...
...
test/py/test_save_load.py
View file @
aabb14ff
#####################################################################################
# The MIT License (MIT)
#
# Copyright (c) 2015-2022 Advanced Micro Devices, Inc. All rights reserved.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.
#####################################################################################
import
migraphx
,
tempfile
import
migraphx
,
tempfile
...
...
test/py/test_shape.py
View file @
aabb14ff
#####################################################################################
# The MIT License (MIT)
#
# Copyright (c) 2015-2022 Advanced Micro Devices, Inc. All rights reserved.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.
#####################################################################################
import
migraphx
import
migraphx
...
...
test/quantization.cpp
View file @
aabb14ff
/*
* The MIT License (MIT)
*
* Copyright (c) 2015-2022 Advanced Micro Devices, Inc. All rights reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
#include <iostream>
#include <iostream>
#include <vector>
#include <vector>
#include <migraphx/literal.hpp>
#include <migraphx/literal.hpp>
...
...
test/reduce_dims.cpp
View file @
aabb14ff
/*
* The MIT License (MIT)
*
* Copyright (c) 2015-2022 Advanced Micro Devices, Inc. All rights reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
#include <migraphx/reduce_dims.hpp>
#include <migraphx/reduce_dims.hpp>
#include <migraphx/permutation.hpp>
#include <migraphx/permutation.hpp>
#include <migraphx/ranges.hpp>
#include "test.hpp"
#include "test.hpp"
migraphx
::
shape
make_shape
(
std
::
vector
<
std
::
size_t
>
lens
)
migraphx
::
shape
make_shape
(
std
::
vector
<
std
::
size_t
>
lens
)
...
@@ -12,6 +36,21 @@ migraphx::shape make_shape(std::vector<std::size_t> lens, std::vector<std::size_
...
@@ -12,6 +36,21 @@ migraphx::shape make_shape(std::vector<std::size_t> lens, std::vector<std::size_
return
{
migraphx
::
shape
::
float_type
,
std
::
move
(
lens
),
std
::
move
(
strides
)};
return
{
migraphx
::
shape
::
float_type
,
std
::
move
(
lens
),
std
::
move
(
strides
)};
}
}
bool
verify_shape
(
const
migraphx
::
shape
&
s1
,
const
migraphx
::
shape
&
s2
)
{
if
(
s1
.
elements
()
!=
s2
.
elements
())
return
false
;
return
migraphx
::
all_of
(
migraphx
::
range
(
s1
.
elements
()),
[
&
](
auto
i
)
{
return
s1
.
index
(
i
)
==
s2
.
index
(
i
);
});
}
template
<
class
Range1
,
class
Range2
>
bool
verify_shapes
(
const
Range1
&
r1
,
const
Range2
&
r2
)
{
return
migraphx
::
equal
(
r1
,
r2
,
[](
const
auto
&
s1
,
const
auto
&
s2
)
{
return
verify_shape
(
s1
,
s2
);
});
}
TEST_CASE
(
same_standard
)
TEST_CASE
(
same_standard
)
{
{
auto
is
=
make_shape
({
64
,
3
,
7
,
7
});
auto
is
=
make_shape
({
64
,
3
,
7
,
7
});
...
@@ -19,7 +58,7 @@ TEST_CASE(same_standard)
...
@@ -19,7 +58,7 @@ TEST_CASE(same_standard)
std
::
vector
<
migraphx
::
shape
>
ishapes
=
{
is
,
is
,
is
};
std
::
vector
<
migraphx
::
shape
>
ishapes
=
{
is
,
is
,
is
};
std
::
vector
<
migraphx
::
shape
>
eshapes
=
{
os
,
os
,
os
};
std
::
vector
<
migraphx
::
shape
>
eshapes
=
{
os
,
os
,
os
};
auto
rshapes
=
migraphx
::
reduce_dims
(
ishapes
);
auto
rshapes
=
migraphx
::
reduce_dims
(
ishapes
);
EXPECT
(
verify_shapes
(
ishapes
,
rshapes
));
EXPECT
(
eshapes
==
rshapes
);
EXPECT
(
eshapes
==
rshapes
);
}
}
...
@@ -30,7 +69,7 @@ TEST_CASE(same_broadcast1)
...
@@ -30,7 +69,7 @@ TEST_CASE(same_broadcast1)
std
::
vector
<
migraphx
::
shape
>
ishapes
=
{
is
,
make_shape
({
64
,
3
,
7
,
7
},
{
0
,
1
,
0
,
0
}),
is
};
std
::
vector
<
migraphx
::
shape
>
ishapes
=
{
is
,
make_shape
({
64
,
3
,
7
,
7
},
{
0
,
1
,
0
,
0
}),
is
};
std
::
vector
<
migraphx
::
shape
>
eshapes
=
{
os
,
make_shape
({
64
,
3
,
7
*
7
},
{
0
,
1
,
0
}),
os
};
std
::
vector
<
migraphx
::
shape
>
eshapes
=
{
os
,
make_shape
({
64
,
3
,
7
*
7
},
{
0
,
1
,
0
}),
os
};
auto
rshapes
=
migraphx
::
reduce_dims
(
ishapes
);
auto
rshapes
=
migraphx
::
reduce_dims
(
ishapes
);
EXPECT
(
verify_shapes
(
ishapes
,
rshapes
));
EXPECT
(
eshapes
==
rshapes
);
EXPECT
(
eshapes
==
rshapes
);
}
}
...
@@ -41,7 +80,7 @@ TEST_CASE(same_broadcast2)
...
@@ -41,7 +80,7 @@ TEST_CASE(same_broadcast2)
std
::
vector
<
migraphx
::
shape
>
ishapes
=
{
is
,
make_shape
({
64
,
3
,
8
,
7
,
7
},
{
0
,
8
,
1
,
0
,
0
}),
is
};
std
::
vector
<
migraphx
::
shape
>
ishapes
=
{
is
,
make_shape
({
64
,
3
,
8
,
7
,
7
},
{
0
,
8
,
1
,
0
,
0
}),
is
};
std
::
vector
<
migraphx
::
shape
>
eshapes
=
{
os
,
make_shape
({
64
,
8
*
3
,
7
*
7
},
{
0
,
1
,
0
}),
os
};
std
::
vector
<
migraphx
::
shape
>
eshapes
=
{
os
,
make_shape
({
64
,
8
*
3
,
7
*
7
},
{
0
,
1
,
0
}),
os
};
auto
rshapes
=
migraphx
::
reduce_dims
(
ishapes
);
auto
rshapes
=
migraphx
::
reduce_dims
(
ishapes
);
EXPECT
(
verify_shapes
(
ishapes
,
rshapes
));
EXPECT
(
eshapes
==
rshapes
);
EXPECT
(
eshapes
==
rshapes
);
}
}
...
@@ -52,7 +91,7 @@ TEST_CASE(same_transposed)
...
@@ -52,7 +91,7 @@ TEST_CASE(same_transposed)
std
::
vector
<
migraphx
::
shape
>
ishapes
=
{
is
,
migraphx
::
reorder_shape
(
is
,
{
0
,
1
,
3
,
2
}),
is
};
std
::
vector
<
migraphx
::
shape
>
ishapes
=
{
is
,
migraphx
::
reorder_shape
(
is
,
{
0
,
1
,
3
,
2
}),
is
};
std
::
vector
<
migraphx
::
shape
>
eshapes
=
{
os
,
migraphx
::
reorder_shape
(
os
,
{
0
,
2
,
1
}),
os
};
std
::
vector
<
migraphx
::
shape
>
eshapes
=
{
os
,
migraphx
::
reorder_shape
(
os
,
{
0
,
2
,
1
}),
os
};
auto
rshapes
=
migraphx
::
reduce_dims
(
ishapes
);
auto
rshapes
=
migraphx
::
reduce_dims
(
ishapes
);
EXPECT
(
verify_shapes
(
ishapes
,
rshapes
));
EXPECT
(
eshapes
==
rshapes
);
EXPECT
(
eshapes
==
rshapes
);
}
}
...
@@ -63,7 +102,7 @@ TEST_CASE(different_masked1)
...
@@ -63,7 +102,7 @@ TEST_CASE(different_masked1)
std
::
vector
<
migraphx
::
shape
>
ishapes
=
{
is
,
make_shape
({
1
,
3
,
1
,
1
}),
is
};
std
::
vector
<
migraphx
::
shape
>
ishapes
=
{
is
,
make_shape
({
1
,
3
,
1
,
1
}),
is
};
std
::
vector
<
migraphx
::
shape
>
eshapes
=
{
os
,
make_shape
({
1
,
3
,
1
}),
os
};
std
::
vector
<
migraphx
::
shape
>
eshapes
=
{
os
,
make_shape
({
1
,
3
,
1
}),
os
};
auto
rshapes
=
migraphx
::
reduce_dims
(
ishapes
);
auto
rshapes
=
migraphx
::
reduce_dims
(
ishapes
);
EXPECT
(
verify_shapes
(
ishapes
,
rshapes
));
EXPECT
(
eshapes
==
rshapes
);
EXPECT
(
eshapes
==
rshapes
);
}
}
...
@@ -75,7 +114,7 @@ TEST_CASE(different_masked2)
...
@@ -75,7 +114,7 @@ TEST_CASE(different_masked2)
is
,
make_shape
({
1
,
3
,
1
,
1
}),
make_shape
({
64
,
1
,
7
,
7
})};
is
,
make_shape
({
1
,
3
,
1
,
1
}),
make_shape
({
64
,
1
,
7
,
7
})};
std
::
vector
<
migraphx
::
shape
>
eshapes
=
{
os
,
make_shape
({
1
,
3
,
1
}),
make_shape
({
64
,
1
,
7
*
7
})};
std
::
vector
<
migraphx
::
shape
>
eshapes
=
{
os
,
make_shape
({
1
,
3
,
1
}),
make_shape
({
64
,
1
,
7
*
7
})};
auto
rshapes
=
migraphx
::
reduce_dims
(
ishapes
);
auto
rshapes
=
migraphx
::
reduce_dims
(
ishapes
);
EXPECT
(
verify_shapes
(
ishapes
,
rshapes
));
EXPECT
(
eshapes
==
rshapes
);
EXPECT
(
eshapes
==
rshapes
);
}
}
...
@@ -105,7 +144,7 @@ TEST_CASE(transposed1)
...
@@ -105,7 +144,7 @@ TEST_CASE(transposed1)
std
::
vector
<
migraphx
::
shape
>
eshapes
=
{
std
::
vector
<
migraphx
::
shape
>
eshapes
=
{
make_shape
({
8
,
28
,
4
,
56
*
56
}),
make_shape
({
8
,
28
,
4
,
56
*
56
},
{
351232
,
3136
,
87808
,
1
})};
make_shape
({
8
,
28
,
4
,
56
*
56
}),
make_shape
({
8
,
28
,
4
,
56
*
56
},
{
351232
,
3136
,
87808
,
1
})};
auto
rshapes
=
migraphx
::
reduce_dims
(
ishapes
);
auto
rshapes
=
migraphx
::
reduce_dims
(
ishapes
);
EXPECT
(
verify_shapes
(
ishapes
,
rshapes
));
EXPECT
(
eshapes
==
rshapes
);
EXPECT
(
eshapes
==
rshapes
);
}
}
...
@@ -114,6 +153,7 @@ TEST_CASE(non_packed_empty1)
...
@@ -114,6 +153,7 @@ TEST_CASE(non_packed_empty1)
std
::
vector
<
migraphx
::
shape
>
ishapes
=
{
make_shape
({
1
,
12
},
{
589824
,
64
})};
std
::
vector
<
migraphx
::
shape
>
ishapes
=
{
make_shape
({
1
,
12
},
{
589824
,
64
})};
std
::
vector
<
migraphx
::
shape
>
eshapes
=
{
make_shape
({
12
},
{
64
})};
std
::
vector
<
migraphx
::
shape
>
eshapes
=
{
make_shape
({
12
},
{
64
})};
auto
rshapes
=
migraphx
::
reduce_dims
(
ishapes
);
auto
rshapes
=
migraphx
::
reduce_dims
(
ishapes
);
EXPECT
(
verify_shapes
(
ishapes
,
rshapes
));
EXPECT
(
eshapes
==
rshapes
);
EXPECT
(
eshapes
==
rshapes
);
}
}
...
@@ -122,6 +162,7 @@ TEST_CASE(non_packed_empty2)
...
@@ -122,6 +162,7 @@ TEST_CASE(non_packed_empty2)
std
::
vector
<
migraphx
::
shape
>
ishapes
=
{
make_shape
({
12
,
1
},
{
64
,
589824
})};
std
::
vector
<
migraphx
::
shape
>
ishapes
=
{
make_shape
({
12
,
1
},
{
64
,
589824
})};
std
::
vector
<
migraphx
::
shape
>
eshapes
=
{
make_shape
({
12
},
{
64
})};
std
::
vector
<
migraphx
::
shape
>
eshapes
=
{
make_shape
({
12
},
{
64
})};
auto
rshapes
=
migraphx
::
reduce_dims
(
ishapes
);
auto
rshapes
=
migraphx
::
reduce_dims
(
ishapes
);
EXPECT
(
verify_shapes
(
ishapes
,
rshapes
));
EXPECT
(
eshapes
==
rshapes
);
EXPECT
(
eshapes
==
rshapes
);
}
}
...
@@ -132,6 +173,16 @@ TEST_CASE(single_dim)
...
@@ -132,6 +173,16 @@ TEST_CASE(single_dim)
EXPECT
(
ishapes
==
rshapes
);
EXPECT
(
ishapes
==
rshapes
);
}
}
TEST_CASE
(
step_broadcast_transpose
)
{
std
::
vector
<
migraphx
::
shape
>
ishapes
=
{
make_shape
({
1
,
2
,
2
,
1
},
{
0
,
0
,
3
,
6
}),
make_shape
({
1
,
2
,
2
,
1
},
{
4
,
2
,
1
,
1
})};
std
::
vector
<
migraphx
::
shape
>
eshapes
=
{
make_shape
({
2
,
2
},
{
0
,
3
}),
make_shape
({
2
,
2
},
{
2
,
1
})};
auto
rshapes
=
migraphx
::
reduce_dims
(
ishapes
);
EXPECT
(
verify_shapes
(
ishapes
,
rshapes
));
EXPECT
(
eshapes
==
rshapes
);
}
TEST_CASE
(
empty
)
TEST_CASE
(
empty
)
{
{
auto
rshapes
=
migraphx
::
reduce_dims
({});
auto
rshapes
=
migraphx
::
reduce_dims
({});
...
...
test/ref_dev_examples.cpp
View file @
aabb14ff
/*
* The MIT License (MIT)
*
* Copyright (c) 2015-2022 Advanced Micro Devices, Inc. All rights reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
#include <iostream>
#include <iostream>
#include <migraphx/program.hpp>
#include <migraphx/program.hpp>
#include <migraphx/literal.hpp>
#include <migraphx/literal.hpp>
...
...
test/ref_dot_op_test.cpp
View file @
aabb14ff
/*
* The MIT License (MIT)
*
* Copyright (c) 2015-2022 Advanced Micro Devices, Inc. All rights reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
#include <iostream>
#include <iostream>
#include <vector>
#include <vector>
#include <migraphx/literal.hpp>
#include <migraphx/literal.hpp>
...
...
test/ref_loop_test.cpp
View file @
aabb14ff
/*
* The MIT License (MIT)
*
* Copyright (c) 2015-2022 Advanced Micro Devices, Inc. All rights reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
#include <iostream>
#include <iostream>
#include <vector>
#include <vector>
#include <cmath>
#include <cmath>
...
...
test/ref_ops_nonstd_shape_test.cpp
View file @
aabb14ff
/*
* The MIT License (MIT)
*
* Copyright (c) 2015-2022 Advanced Micro Devices, Inc. All rights reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
#include <iostream>
#include <iostream>
#include <vector>
#include <vector>
#include <migraphx/literal.hpp>
#include <migraphx/literal.hpp>
...
...
test/ref_ops_test.cpp
View file @
aabb14ff
/*
* The MIT License (MIT)
*
* Copyright (c) 2015-2022 Advanced Micro Devices, Inc. All rights reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
#include <iostream>
#include <iostream>
#include <vector>
#include <vector>
#include <cmath>
#include <cmath>
...
...
test/ref_rnn_ops_test.cpp
View file @
aabb14ff
/*
* The MIT License (MIT)
*
* Copyright (c) 2015-2022 Advanced Micro Devices, Inc. All rights reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
#include <iostream>
#include <iostream>
#include <vector>
#include <vector>
#include <migraphx/literal.hpp>
#include <migraphx/literal.hpp>
...
...
test/replace_allocate.cpp
View file @
aabb14ff
/*
* The MIT License (MIT)
*
* Copyright (c) 2015-2022 Advanced Micro Devices, Inc. All rights reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
#include <migraphx/allocation_model.hpp>
#include <migraphx/allocation_model.hpp>
#include <migraphx/replace_allocate.hpp>
#include <migraphx/replace_allocate.hpp>
#include <migraphx/dead_code_elimination.hpp>
#include <migraphx/dead_code_elimination.hpp>
...
...
test/rewrite_batchnorm_test.cpp
View file @
aabb14ff
/*
* The MIT License (MIT)
*
* Copyright (c) 2015-2022 Advanced Micro Devices, Inc. All rights reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
#include <migraphx/rewrite_batchnorm.hpp>
#include <migraphx/rewrite_batchnorm.hpp>
#include <migraphx/program.hpp>
#include <migraphx/program.hpp>
#include <migraphx/ref/target.hpp>
#include <migraphx/ref/target.hpp>
...
...
test/rewrite_pooling_test.cpp
View file @
aabb14ff
/*
* The MIT License (MIT)
*
* Copyright (c) 2015-2022 Advanced Micro Devices, Inc. All rights reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
#include <migraphx/rewrite_pooling.hpp>
#include <migraphx/rewrite_pooling.hpp>
#include <migraphx/op/pooling.hpp>
#include <migraphx/op/pooling.hpp>
#include <migraphx/dead_code_elimination.hpp>
#include <migraphx/dead_code_elimination.hpp>
...
...
test/rewrite_quantization_test.cpp
View file @
aabb14ff
/*
* The MIT License (MIT)
*
* Copyright (c) 2015-2022 Advanced Micro Devices, Inc. All rights reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
#include <migraphx/rewrite_quantization.hpp>
#include <migraphx/rewrite_quantization.hpp>
#include <migraphx/program.hpp>
#include <migraphx/program.hpp>
#include <migraphx/ref/target.hpp>
#include <migraphx/ref/target.hpp>
...
...
test/run_loop_test.cpp
View file @
aabb14ff
/*
* The MIT License (MIT)
*
* Copyright (c) 2015-2022 Advanced Micro Devices, Inc. All rights reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
#include <iostream>
#include <iostream>
#include <vector>
#include <vector>
#include <cmath>
#include <cmath>
...
...
test/schedule_test.cpp
100755 → 100644
View file @
aabb14ff
/*
* The MIT License (MIT)
*
* Copyright (c) 2015-2022 Advanced Micro Devices, Inc. All rights reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
#include <migraphx/schedule.hpp>
#include <migraphx/schedule.hpp>
#include <migraphx/pass_manager.hpp>
#include <migraphx/pass_manager.hpp>
#include <migraphx/generate.hpp>
#include <migraphx/generate.hpp>
...
...
Prev
1
…
46
47
48
49
50
Next
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