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
composable_kernel
Commits
8789fec4
Commit
8789fec4
authored
Sep 12, 2022
by
Po-Yen, Chen
Browse files
Simply initialize tensor with floating point values
parent
77f87d3a
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
3 deletions
+5
-3
example/37_permute/common.hpp
example/37_permute/common.hpp
+1
-0
example/37_permute/run_permute_example.inc
example/37_permute/run_permute_example.inc
+4
-3
No files found.
example/37_permute/common.hpp
View file @
8789fec4
...
...
@@ -19,6 +19,7 @@
#include "ck/library/utility/check_err.hpp"
#include "ck/library/utility/device_memory.hpp"
#include "ck/library/utility/fill.hpp"
#include "ck/library/utility/host_tensor.hpp"
#include "ck/library/utility/host_tensor_generator.hpp"
...
...
example/37_permute/run_permute_example.inc
View file @
8789fec4
...
...
@@ -27,7 +27,8 @@ bool run_permute(const ExecutionConfig& config, const Problem& problem)
{
auto
*
const
elems
=
reinterpret_cast
<
detail
::
get_bundled_t
<
ADataType
,
NUM_ELEMS_IN_BUNDLE
>*>
(
data
(
a
.
mData
));
std
::
iota
(
elems
,
elems
+
(
size
(
a
.
mData
)
*
NUM_ELEMS_IN_BUNDLE
),
1
);
ck
::
utils
::
FillUniformDistribution
<
ADataType
>
{
-
1.
f
,
1.
f
}(
elems
,
elems
+
(
size
(
a
.
mData
)
*
NUM_ELEMS_IN_BUNDLE
));
}
DeviceMem
a_device_buf
(
sizeof
(
ADataType
)
*
a
.
mDesc
.
GetElementSpaceSize
());
...
...
@@ -103,8 +104,8 @@ bool run_permute(const ExecutionConfig& config, const Problem& problem)
b
.
mDesc
.
GetElementSpaceSize
()
*
NUM_ELEMS_IN_BUNDLE
},
ck
::
span
<
const
DataType
>
{
extended_host_b
.
mData
},
"Error: incorrect results in output tensor"
,
1
e
-
10
,
1
e
-
10
);
1
e
-
5
,
1
e
-
5
);
#endif
}
...
...
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