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
0dd8ee4f
Commit
0dd8ee4f
authored
Aug 18, 2018
by
Paul
Browse files
Formatting
parent
bb93c9d5
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
4 deletions
+7
-4
src/include/migraph/literal.hpp
src/include/migraph/literal.hpp
+7
-4
No files found.
src/include/migraph/literal.hpp
View file @
0dd8ee4f
...
@@ -27,26 +27,29 @@ struct literal : raw_data<literal>
...
@@ -27,26 +27,29 @@ struct literal : raw_data<literal>
}
}
template
<
class
T
>
template
<
class
T
>
literal
(
shape
s
,
const
std
::
vector
<
T
>&
x
)
:
buffer
(
std
::
make_unique
<
char
[]
>
(
s
.
bytes
())),
m_shape
(
s
)
literal
(
shape
s
,
const
std
::
vector
<
T
>&
x
)
:
buffer
(
std
::
make_unique
<
char
[]
>
(
s
.
bytes
())),
m_shape
(
s
)
{
{
static_assert
(
std
::
is_trivial
<
T
>
{},
"Literals can only be trivial types"
);
static_assert
(
std
::
is_trivial
<
T
>
{},
"Literals can only be trivial types"
);
fill
(
x
.
begin
(),
x
.
end
());
fill
(
x
.
begin
(),
x
.
end
());
}
}
template
<
class
T
>
template
<
class
T
>
literal
(
shape
s
,
const
std
::
initializer_list
<
T
>&
x
)
:
buffer
(
std
::
make_unique
<
char
[]
>
(
s
.
bytes
())),
m_shape
(
s
)
literal
(
shape
s
,
const
std
::
initializer_list
<
T
>&
x
)
:
buffer
(
std
::
make_unique
<
char
[]
>
(
s
.
bytes
())),
m_shape
(
s
)
{
{
static_assert
(
std
::
is_trivial
<
T
>
{},
"Literals can only be trivial types"
);
static_assert
(
std
::
is_trivial
<
T
>
{},
"Literals can only be trivial types"
);
fill
(
x
.
begin
(),
x
.
end
());
fill
(
x
.
begin
(),
x
.
end
());
}
}
template
<
class
Iterator
>
template
<
class
Iterator
>
literal
(
shape
s
,
Iterator
start
,
Iterator
end
)
:
buffer
(
std
::
make_unique
<
char
[]
>
(
s
.
bytes
())),
m_shape
(
s
)
literal
(
shape
s
,
Iterator
start
,
Iterator
end
)
:
buffer
(
std
::
make_unique
<
char
[]
>
(
s
.
bytes
())),
m_shape
(
s
)
{
{
fill
(
start
,
end
);
fill
(
start
,
end
);
}
}
literal
(
shape
s
,
const
char
*
x
)
:
buffer
(
std
::
make_unique
<
char
[]
>
(
s
.
bytes
())),
m_shape
(
s
)
literal
(
shape
s
,
const
char
*
x
)
:
buffer
(
std
::
make_unique
<
char
[]
>
(
s
.
bytes
())),
m_shape
(
s
)
{
{
std
::
copy
(
x
,
x
+
s
.
bytes
(),
buffer
.
get
());
std
::
copy
(
x
,
x
+
s
.
bytes
(),
buffer
.
get
());
}
}
...
...
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