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
91bff175
Commit
91bff175
authored
Jun 13, 2018
by
Paul
Browse files
Formatting
parent
3d03e158
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
3 deletions
+5
-3
src/include/rtg/raw_data.hpp
src/include/rtg/raw_data.hpp
+5
-3
No files found.
src/include/rtg/raw_data.hpp
View file @
91bff175
...
@@ -94,7 +94,9 @@ struct raw_data : raw_data_base
...
@@ -94,7 +94,9 @@ struct raw_data : raw_data_base
operator
T
*
()
operator
T
*
()
{
{
using
type
=
std
::
remove_cv_t
<
T
>
;
using
type
=
std
::
remove_cv_t
<
T
>
;
assert
((
std
::
is_void
<
T
>
{}
or
std
::
is_same
<
char
,
type
>
{}
or
std
::
is_same
<
unsigned
char
,
type
>
{}
or
self
->
get_shape
().
type
()
==
rtg
::
shape
::
get_type
<
T
>
{}));
assert
((
std
::
is_void
<
T
>
{}
or
std
::
is_same
<
char
,
type
>
{}
or
std
::
is_same
<
unsigned
char
,
type
>
{}
or
self
->
get_shape
().
type
()
==
rtg
::
shape
::
get_type
<
T
>
{}));
return
reinterpret_cast
<
type
*>
(
self
->
data
());
return
reinterpret_cast
<
type
*>
(
self
->
data
());
}
}
};
};
...
@@ -103,10 +105,10 @@ struct raw_data : raw_data_base
...
@@ -103,10 +105,10 @@ struct raw_data : raw_data_base
auto_cast
implicit
()
const
{
return
{
static_cast
<
const
Derived
*>
(
this
)};
}
auto_cast
implicit
()
const
{
return
{
static_cast
<
const
Derived
*>
(
this
)};
}
/// Get a tensor_view to the data
/// Get a tensor_view to the data
template
<
class
T
>
template
<
class
T
>
tensor_view
<
T
>
get
()
const
tensor_view
<
T
>
get
()
const
{
{
auto
&&
s
=
static_cast
<
const
Derived
&>
(
*
this
).
get_shape
();
auto
&&
s
=
static_cast
<
const
Derived
&>
(
*
this
).
get_shape
();
auto
&&
buffer
=
static_cast
<
const
Derived
&>
(
*
this
).
data
();
auto
&&
buffer
=
static_cast
<
const
Derived
&>
(
*
this
).
data
();
if
(
s
.
type
()
!=
rtg
::
shape
::
get_type
<
T
>
{})
if
(
s
.
type
()
!=
rtg
::
shape
::
get_type
<
T
>
{})
RTG_THROW
(
"Incorrect data type for raw data"
);
RTG_THROW
(
"Incorrect data type for raw data"
);
...
...
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