Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
one
spconv
Commits
fad30002
Commit
fad30002
authored
Jan 30, 2021
by
Yan Yan
Browse files
fix a strange bug of cuda 11
parent
f22dd9ae
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
2 deletions
+14
-2
src/spconv/indice.cu
src/spconv/indice.cu
+14
-2
No files found.
src/spconv/indice.cu
View file @
fad30002
...
...
@@ -105,6 +105,7 @@ int create_conv_indice_pair_p2_cuda(
auto
kernelVolume
=
indiceNum
.
size
(
0
);
if
(
numActIn
==
0
)
return
0
;
bool
failed
=
false
;
tv
::
dispatch_torch
<
int32_t
>
(
indicesIn
.
scalar_type
(),
[
&
](
auto
IndexValue
)
{
using
Index
=
TV_DECLTYPE
(
IndexValue
);
using
IndexGrid
=
int32_t
;
...
...
@@ -131,7 +132,8 @@ int create_conv_indice_pair_p2_cuda(
cudaFree
(
d_values
);
TV_CHECK_CUDA_ERR_V2
(
"cudaFree failed"
);
if
(
!
res
)
{
return
-
1
;
// use -1 to tell outside use CPU implementation
failed
=
true
;
return
;
}
assignIndiceOutKernel
<
Index
,
NDim
>
<<<
tv
::
cuda
::
getBlocks
(
numAct
),
tv
::
cuda
::
CUDA_NUM_THREADS
,
0
,
...
...
@@ -190,6 +192,9 @@ int create_conv_indice_pair_p2_cuda(
}
});
});
if
(
failed
){
return
-
1
;
}
return
numAct
;
}
...
...
@@ -211,6 +216,8 @@ int create_submconv_indice_pair_cuda(
auto
kernelVolume
=
indiceNum
.
size
(
0
);
if
(
numActIn
==
0
)
return
0
;
bool
failed
=
false
;
tv
::
dispatch_torch
<
int32_t
>
(
indicesIn
.
scalar_type
(),
[
&
](
auto
IndexValue
)
{
using
Index
=
TV_DECLTYPE
(
IndexValue
);
using
IndexGrid
=
int32_t
;
...
...
@@ -245,7 +252,8 @@ int create_submconv_indice_pair_cuda(
cudaFree
(
d_keyvalues
);
TV_CHECK_CUDA_ERR_V2
(
"cudaFree failed"
);
if
(
!
res
)
{
return
-
1
;
// use -1 to tell outside use CPU implementation
failed
=
true
;
return
;
}
auto
tableSize
=
table
.
get_table_size
();
auto
tableData
=
table
.
data
();
...
...
@@ -349,6 +357,10 @@ int create_submconv_indice_pair_cuda(
}
});
});
if
(
failed
){
return
-
1
;
}
return
numActIn
;
}
...
...
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