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
OpenDAS
apex
Commits
ba2407e2
Commit
ba2407e2
authored
May 12, 2020
by
rohithkrn
Browse files
Merge remote-tracking branch 'rocm_up/master' into apex_amp_bfp15
parents
d283f97f
02a5274b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
3 deletions
+10
-3
csrc/multi_tensor_apply.cuh
csrc/multi_tensor_apply.cuh
+10
-3
No files found.
csrc/multi_tensor_apply.cuh
View file @
ba2407e2
...
@@ -56,7 +56,7 @@ void multi_tensor_apply(
...
@@ -56,7 +56,7 @@ void multi_tensor_apply(
for
(
int
t
=
0
;
t
<
tensor_lists
[
l
].
size
();
t
++
)
for
(
int
t
=
0
;
t
<
tensor_lists
[
l
].
size
();
t
++
)
{
{
// TODO: Print which tensor fails.
// TODO: Print which tensor fails.
bool
contiguous_memory
=
tensor_lists
[
l
][
t
].
is_contiguous
();
bool
contiguous_memory
=
(
tensor_lists
[
l
][
t
].
is_sparse
())
?
tensor_lists
[
l
][
t
].
_values
().
is_contiguous
()
:
tensor_lists
[
l
][
t
].
is_contiguous
();
#ifdef VERSION_GE_1_5
#ifdef VERSION_GE_1_5
contiguous_memory
=
(
contiguous_memory
||
tensor_lists
[
l
][
t
].
is_contiguous
(
at
::
MemoryFormat
::
ChannelsLast
));
contiguous_memory
=
(
contiguous_memory
||
tensor_lists
[
l
][
t
].
is_contiguous
(
at
::
MemoryFormat
::
ChannelsLast
));
#endif
#endif
...
@@ -78,8 +78,15 @@ void multi_tensor_apply(
...
@@ -78,8 +78,15 @@ void multi_tensor_apply(
for
(
int
t
=
0
;
t
<
ntensors
;
t
++
)
for
(
int
t
=
0
;
t
<
ntensors
;
t
++
)
{
{
tl
.
sizes
[
loc_tensor_info
]
=
tensor_lists
[
0
][
t
].
numel
();
tl
.
sizes
[
loc_tensor_info
]
=
tensor_lists
[
0
][
t
].
numel
();
for
(
int
d
=
0
;
d
<
depth
;
d
++
)
for
(
int
d
=
0
;
d
<
depth
;
d
++
)
{
tl
.
addresses
[
d
][
loc_tensor_info
]
=
tensor_lists
[
d
][
t
].
data_ptr
();
if
(
tensor_lists
[
d
][
t
].
is_sparse
())
{
at
::
Tensor
dst
=
at
::
zeros
(
tensor_lists
[
d
][
t
].
sizes
(),
tensor_lists
[
d
][
t
].
options
().
layout
(
at
::
kStrided
));
dst
.
add_
(
tensor_lists
[
d
][
t
]);
tl
.
addresses
[
d
][
loc_tensor_info
]
=
dst
.
data_ptr
();
}
else
{
tl
.
addresses
[
d
][
loc_tensor_info
]
=
tensor_lists
[
d
][
t
].
data_ptr
();
}
}
loc_tensor_info
++
;
loc_tensor_info
++
;
int
chunks_this_tensor
=
(
tensor_lists
[
0
][
t
].
numel
()
+
chunk_size
-
1
)
/
chunk_size
;
int
chunks_this_tensor
=
(
tensor_lists
[
0
][
t
].
numel
()
+
chunk_size
-
1
)
/
chunk_size
;
...
...
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