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
73e64f33
"vscode:/vscode.git/clone" did not exist on "f8ae600ce4b3e728e7e852908603a225f2fe5932"
Commit
73e64f33
authored
May 03, 2019
by
Paul
Browse files
Formatting
parent
01543cc4
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
15 deletions
+20
-15
src/include/migraphx/reflect.hpp
src/include/migraphx/reflect.hpp
+11
-13
src/targets/gpu/include/migraphx/gpu/miopen.hpp
src/targets/gpu/include/migraphx/gpu/miopen.hpp
+9
-2
No files found.
src/include/migraphx/reflect.hpp
View file @
73e64f33
...
@@ -39,36 +39,33 @@ auto reflectable_impl(rank<1>, T&& x)
...
@@ -39,36 +39,33 @@ auto reflectable_impl(rank<1>, T&& x)
template
<
class
T
>
template
<
class
T
>
auto
reflectable_impl
(
rank
<
0
>
,
T
&&
)
->
decltype
(
std
::
false_type
{});
auto
reflectable_impl
(
rank
<
0
>
,
T
&&
)
->
decltype
(
std
::
false_type
{});
template
<
class
T
>
template
<
class
T
>
struct
remove_rvalue_reference
struct
remove_rvalue_reference
{
{
using
type
=
T
;
using
type
=
T
;
};
};
template
<
class
T
>
template
<
class
T
>
struct
remove_rvalue_reference
<
T
&&>
struct
remove_rvalue_reference
<
T
&&>
{
{
using
type
=
T
;
using
type
=
T
;
};
};
template
<
class
T
>
template
<
class
T
>
struct
wrapper
struct
wrapper
{
{
using
type
=
typename
remove_rvalue_reference
<
T
>::
type
;
using
type
=
typename
remove_rvalue_reference
<
T
>::
type
;
type
data
;
type
data
;
type
get
()
const
type
get
()
const
{
return
data
;
}
{
return
data
;
}
};
};
template
<
class
T
>
template
<
class
T
>
wrapper
<
T
>
wrap
(
std
::
remove_reference_t
<
T
>&
x
)
wrapper
<
T
>
wrap
(
std
::
remove_reference_t
<
T
>&
x
)
{
{
return
wrapper
<
T
>
{
std
::
forward
<
T
>
(
x
)};
return
wrapper
<
T
>
{
std
::
forward
<
T
>
(
x
)};
}
}
template
<
class
...
Ts
>
template
<
class
...
Ts
>
std
::
tuple
<
typename
remove_rvalue_reference
<
Ts
>::
type
...
>
auto_tuple
(
Ts
&&
...
xs
)
std
::
tuple
<
typename
remove_rvalue_reference
<
Ts
>::
type
...
>
auto_tuple
(
Ts
&&
...
xs
)
{
{
return
{
std
::
forward
<
Ts
>
(
xs
)...};
return
{
std
::
forward
<
Ts
>
(
xs
)...};
...
@@ -95,10 +92,11 @@ auto reflect_tie(T& x)
...
@@ -95,10 +92,11 @@ auto reflect_tie(T& x)
template
<
class
T
,
class
F
>
template
<
class
T
,
class
F
>
void
reflect_each
(
T
&
x
,
F
f
)
void
reflect_each
(
T
&
x
,
F
f
)
{
{
return
reflect
(
x
,
[](
auto
&&
y
,
auto
...
ys
)
{
return
pack
(
detail
::
wrap
<
decltype
(
y
)
>
(
y
),
ys
...);
})(
return
reflect
(
x
,
[](
auto
&&
y
,
auto
...
ys
)
{
[
&
](
auto
&&
...
xs
)
{
return
pack
(
detail
::
wrap
<
decltype
(
y
)
>
(
y
),
ys
...);
each_args
([
&
](
auto
p
)
{
p
([
&
](
auto
&&
y
,
auto
...
ys
)
{
f
(
y
.
get
(),
ys
...);
});
},
xs
...);
})([
&
](
auto
&&
...
xs
)
{
});
each_args
([
&
](
auto
p
)
{
p
([
&
](
auto
&&
y
,
auto
...
ys
)
{
f
(
y
.
get
(),
ys
...);
});
},
xs
...);
});
}
}
}
// namespace MIGRAPHX_INLINE_NS
}
// namespace MIGRAPHX_INLINE_NS
...
...
src/targets/gpu/include/migraphx/gpu/miopen.hpp
View file @
73e64f33
...
@@ -171,7 +171,10 @@ auto reflect(miopenActivationDescriptor_t ad, F f)
...
@@ -171,7 +171,10 @@ auto reflect(miopenActivationDescriptor_t ad, F f)
double
beta
=
0.0
;
double
beta
=
0.0
;
double
gamma
=
0.0
;
double
gamma
=
0.0
;
miopenGetActivationDescriptor
(
ad
,
&
mode
,
&
alpha
,
&
beta
,
&
gamma
);
miopenGetActivationDescriptor
(
ad
,
&
mode
,
&
alpha
,
&
beta
,
&
gamma
);
return
pack
(
f
(
std
::
move
(
mode
),
"mode"
),
f
(
std
::
move
(
alpha
),
"alpha"
),
f
(
std
::
move
(
beta
),
"beta"
),
f
(
std
::
move
(
gamma
),
"gamma"
));
return
pack
(
f
(
std
::
move
(
mode
),
"mode"
),
f
(
std
::
move
(
alpha
),
"alpha"
),
f
(
std
::
move
(
beta
),
"beta"
),
f
(
std
::
move
(
gamma
),
"gamma"
));
}
}
template
<
class
F
>
template
<
class
F
>
...
@@ -184,7 +187,11 @@ auto reflect(miopenLRNDescriptor_t lrnd, F f)
...
@@ -184,7 +187,11 @@ auto reflect(miopenLRNDescriptor_t lrnd, F f)
double
beta
=
0.0
;
double
beta
=
0.0
;
double
k
=
0.0
;
double
k
=
0.0
;
miopenGetLRNDescriptor
(
lrnd
,
&
mode
,
&
n
,
&
alpha
,
&
beta
,
&
k
);
miopenGetLRNDescriptor
(
lrnd
,
&
mode
,
&
n
,
&
alpha
,
&
beta
,
&
k
);
return
pack
(
f
(
std
::
move
(
mode
),
"mode"
),
f
(
std
::
move
(
n
),
"n"
),
f
(
std
::
move
(
alpha
),
"alpha"
),
f
(
std
::
move
(
beta
),
"beta"
),
f
(
std
::
move
(
k
),
"k"
));
return
pack
(
f
(
std
::
move
(
mode
),
"mode"
),
f
(
std
::
move
(
n
),
"n"
),
f
(
std
::
move
(
alpha
),
"alpha"
),
f
(
std
::
move
(
beta
),
"beta"
),
f
(
std
::
move
(
k
),
"k"
));
}
}
}
// namespace gpu
}
// namespace gpu
...
...
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