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
dgl
Commits
396d7180
Unverified
Commit
396d7180
authored
Mar 01, 2022
by
Quan (Andy) Gan
Committed by
GitHub
Mar 01, 2022
Browse files
[Build] Working around broken name mangling in MSVC 16.5.5 + CUDA 11.3 (#3790)
* fix * explain * oops
parent
0ec43924
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
38 additions
and
4 deletions
+38
-4
src/graph/transform/cuda/cuda_to_block.cu
src/graph/transform/cuda/cuda_to_block.cu
+7
-4
src/graph/transform/to_bipartite.cc
src/graph/transform/to_bipartite.cc
+31
-0
No files found.
src/graph/transform/cuda/cuda_to_block.cu
View file @
396d7180
...
...
@@ -381,9 +381,12 @@ ToBlockGPU(
}
// namespace
template
<
>
// Use explicit names to get around MSVC's broken mangling that thinks the following two
// functions are the same.
// Using template<> fails to export the symbols.
std
::
tuple
<
HeteroGraphPtr
,
std
::
vector
<
IdArray
>>
ToBlock
<
kDLGPU
,
int32_t
>
(
// ToBlock<kDLGPU, int32_t>
ToBlockGPU32
(
HeteroGraphPtr
graph
,
const
std
::
vector
<
IdArray
>
&
rhs_nodes
,
bool
include_rhs_in_lhs
,
...
...
@@ -391,9 +394,9 @@ ToBlock<kDLGPU, int32_t>(
return
ToBlockGPU
<
int32_t
>
(
graph
,
rhs_nodes
,
include_rhs_in_lhs
,
lhs_nodes
);
}
template
<
>
std
::
tuple
<
HeteroGraphPtr
,
std
::
vector
<
IdArray
>>
ToBlock
<
kDLGPU
,
int64_t
>
(
// ToBlock<kDLGPU, int64_t>
ToBlockGPU64
(
HeteroGraphPtr
graph
,
const
std
::
vector
<
IdArray
>
&
rhs_nodes
,
bool
include_rhs_in_lhs
,
...
...
src/graph/transform/to_bipartite.cc
View file @
396d7180
...
...
@@ -159,6 +159,37 @@ ToBlock<kDLCPU, int64_t>(HeteroGraphPtr graph,
return
ToBlockCPU
<
int64_t
>
(
graph
,
rhs_nodes
,
include_rhs_in_lhs
,
lhs_nodes
);
}
#ifdef DGL_USE_CUDA
// Forward declaration of GPU ToBlock implementations - actual implementation is in
// ./cuda/cuda_to_block.cu
// This is to get around the broken name mangling in VS2019 CL 16.5.5 + CUDA 11.3
// which complains that the two template specializations have the same signature.
std
::
tuple
<
HeteroGraphPtr
,
std
::
vector
<
IdArray
>>
ToBlockGPU32
(
HeteroGraphPtr
,
const
std
::
vector
<
IdArray
>&
,
bool
,
std
::
vector
<
IdArray
>*
const
);
std
::
tuple
<
HeteroGraphPtr
,
std
::
vector
<
IdArray
>>
ToBlockGPU64
(
HeteroGraphPtr
,
const
std
::
vector
<
IdArray
>&
,
bool
,
std
::
vector
<
IdArray
>*
const
);
template
<
>
std
::
tuple
<
HeteroGraphPtr
,
std
::
vector
<
IdArray
>>
ToBlock
<
kDLGPU
,
int32_t
>
(
HeteroGraphPtr
graph
,
const
std
::
vector
<
IdArray
>
&
rhs_nodes
,
bool
include_rhs_in_lhs
,
std
::
vector
<
IdArray
>*
const
lhs_nodes
)
{
return
ToBlockGPU32
(
graph
,
rhs_nodes
,
include_rhs_in_lhs
,
lhs_nodes
);
}
template
<
>
std
::
tuple
<
HeteroGraphPtr
,
std
::
vector
<
IdArray
>>
ToBlock
<
kDLGPU
,
int64_t
>
(
HeteroGraphPtr
graph
,
const
std
::
vector
<
IdArray
>
&
rhs_nodes
,
bool
include_rhs_in_lhs
,
std
::
vector
<
IdArray
>*
const
lhs_nodes
)
{
return
ToBlockGPU64
(
graph
,
rhs_nodes
,
include_rhs_in_lhs
,
lhs_nodes
);
}
#endif // DGL_USE_CUDA
DGL_REGISTER_GLOBAL
(
"transform._CAPI_DGLToBlock"
)
.
set_body
([]
(
DGLArgs
args
,
DGLRetValue
*
rv
)
{
const
HeteroGraphRef
graph_ref
=
args
[
0
];
...
...
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