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
b20487d3
Commit
b20487d3
authored
Sep 27, 2023
by
Artur Wojcik
Browse files
temp3
parent
5c426ab4
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
20 additions
and
6 deletions
+20
-6
src/include/migraphx/op/random_uniform.hpp
src/include/migraphx/op/random_uniform.hpp
+12
-1
src/include/migraphx/pad_calc.hpp
src/include/migraphx/pad_calc.hpp
+1
-0
src/targets/gpu/CMakeLists.txt
src/targets/gpu/CMakeLists.txt
+1
-0
src/targets/gpu/compile_hip.cpp
src/targets/gpu/compile_hip.cpp
+1
-4
src/targets/gpu/device/targets.hpp.in
src/targets/gpu/device/targets.hpp.in
+5
-1
No files found.
src/include/migraphx/op/random_uniform.hpp
View file @
b20487d3
...
@@ -75,7 +75,18 @@ struct random_uniform
...
@@ -75,7 +75,18 @@ struct random_uniform
result
.
visit
([
&
](
auto
output
)
{
result
.
visit
([
&
](
auto
output
)
{
using
type
=
typename
decltype
(
output
)
::
value_type
;
using
type
=
typename
decltype
(
output
)
::
value_type
;
if
constexpr
(
std
::
is_integral
<
type
>
{})
if
constexpr
(
std
::
is_integral_v
<
type
>
#ifdef _MSC_VER
// According to the C++ specification, the effect is undefined if the result type for
// the generator is not one of short, int, long, long long, unsigned short, unsigned int,
// unsigned long, or unsigned long long.
// See https://en.cppreference.com/w/cpp/numeric/random/uniform_int_distribution.
//
// The standard library of Microsoft Visual C++ compiler is strict about that.
// The Clang C++ compiler uses the standard library from Microsoft Visual C++ compiler.
&&
!
(
std
::
is_same_v
<
type
,
unsigned
char
>
||
std
::
is_same_v
<
type
,
signed
char
>
)
#endif
)
{
{
// default range for all integer types is
// default range for all integer types is
// (0, std::uniform_int_distribution<type>::max()).
// (0, std::uniform_int_distribution<type>::max()).
...
...
src/include/migraphx/pad_calc.hpp
View file @
b20487d3
...
@@ -64,6 +64,7 @@ shape compute_padded_shape(const shape& input,
...
@@ -64,6 +64,7 @@ shape compute_padded_shape(const shape& input,
// Used for dynamic auto padding of pooling operators where padding needs to be computed at
// Used for dynamic auto padding of pooling operators where padding needs to be computed at
// evaulation time.
// evaulation time.
MIGRAPHX_EXPORT
shape
compute_padded_pool_shape
(
const
shape
&
input
,
shape
compute_padded_pool_shape
(
const
shape
&
input
,
const
shape
&
kernel
,
const
shape
&
kernel
,
const
std
::
vector
<
std
::
size_t
>&
padding
,
const
std
::
vector
<
std
::
size_t
>&
padding
,
...
...
src/targets/gpu/CMakeLists.txt
View file @
b20487d3
...
@@ -88,6 +88,7 @@ add_library(migraphx_device
...
@@ -88,6 +88,7 @@ add_library(migraphx_device
device/reverse.cpp
device/reverse.cpp
device/rnn_variable_seq_lens.cpp
device/rnn_variable_seq_lens.cpp
device/scatter.cpp
device/scatter.cpp
device/targets.cpp
device/topk.cpp
)
device/topk.cpp
)
set_target_properties
(
migraphx_device PROPERTIES EXPORT_NAME device
)
set_target_properties
(
migraphx_device PROPERTIES EXPORT_NAME device
)
...
...
src/targets/gpu/compile_hip.cpp
View file @
b20487d3
...
@@ -366,10 +366,7 @@ bool hip_has_flags(const std::vector<std::string>& flags)
...
@@ -366,10 +366,7 @@ bool hip_has_flags(const std::vector<std::string>& flags)
join_strings
(
flags
,
" "
)
+
" -x hip -c --offload-arch=gfx900 --cuda-device-only"
;
join_strings
(
flags
,
" "
)
+
" -x hip -c --offload-arch=gfx900 --cuda-device-only"
;
std
::
string
src
;
std
::
string
src
;
src_file
input
;
src_file
input
{
"main.cpp"
,
src
};
input
.
path
=
"main.cpp"
;
input
.
content
=
std
::
make_pair
(
src
.
data
(),
src
.
data
()
+
src
.
size
());
try
try
{
{
compiler
.
compile
({
input
});
compiler
.
compile
({
input
});
...
...
src/targets/gpu/device/targets.hpp.in
View file @
b20487d3
...
@@ -24,7 +24,7 @@
...
@@ -24,7 +24,7 @@
#ifndef MIGRAPHX_GUARD_DEVICE_TARGETS_CPP
#ifndef MIGRAPHX_GUARD_DEVICE_TARGETS_CPP
#define MIGRAPHX_GUARD_DEVICE_TARGETS_CPP
#define MIGRAPHX_GUARD_DEVICE_TARGETS_CPP
#include <migraphx/config.hpp>
#include <migraphx/
gpu/device/
config.hpp>
#include <string>
#include <string>
#include <vector>
#include <vector>
...
@@ -34,9 +34,13 @@ namespace gpu {
...
@@ -34,9 +34,13 @@ namespace gpu {
namespace device {
namespace device {
#define MIGRAPHX_GPU_TARGETS "@GPU_TARGETS@" // NOLINT
#define MIGRAPHX_GPU_TARGETS "@GPU_TARGETS@" // NOLINT
MIGRAPHX_DEVICE_EXPORT
const std::vector<std::string>& get_targets();
const std::vector<std::string>& get_targets();
MIGRAPHX_DEVICE_EXPORT
std::string get_targets_as_string();
std::string get_targets_as_string();
MIGRAPHX_DEVICE_EXPORT
std::string get_device_name();
std::string get_device_name();
} // namespace device
} // namespace device
...
...
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