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
edcecdd0
Unverified
Commit
edcecdd0
authored
Sep 12, 2023
by
czkkkkkk
Committed by
GitHub
Sep 12, 2023
Browse files
[CMAKE] Move DGL cuda file declaration to the main CMakeLists.txt (#6300)
parent
da1d5de2
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
22 deletions
+19
-22
CMakeLists.txt
CMakeLists.txt
+15
-1
cmake/modules/CUDA.cmake
cmake/modules/CUDA.cmake
+4
-21
No files found.
CMakeLists.txt
View file @
edcecdd0
...
@@ -259,8 +259,22 @@ list(APPEND DGL_SRC ${DGL_RPC_SRC})
...
@@ -259,8 +259,22 @@ list(APPEND DGL_SRC ${DGL_RPC_SRC})
# Configure cuda
# Configure cuda
if
(
USE_CUDA
)
if
(
USE_CUDA
)
dgl_config_cuda
(
DGL_CUDA_SRC
)
file
(
GLOB_RECURSE DGL_CUDA_SRC
src/array/cuda/*.cc
src/array/cuda/*.cu
src/array/cuda/uvm/*.cc
src/array/cuda/uvm/*.cu
src/kernel/cuda/*.cc
src/kernel/cuda/*.cu
src/partition/cuda/*.cu
src/runtime/cuda/*.cc
src/runtime/cuda/*.cu
src/geometry/cuda/*.cu
src/graph/transform/cuda/*.cu
src/graph/sampling/randomwalks/*.cu
)
list
(
APPEND DGL_SRC
${
DGL_CUDA_SRC
}
)
list
(
APPEND DGL_SRC
${
DGL_CUDA_SRC
}
)
dgl_config_cuda
(
DGL_LINKER_LIBS
)
cuda_add_library
(
dgl SHARED
${
DGL_SRC
}
)
cuda_add_library
(
dgl SHARED
${
DGL_SRC
}
)
else
(
USE_CUDA
)
else
(
USE_CUDA
)
add_library
(
dgl SHARED
${
DGL_SRC
}
)
add_library
(
dgl SHARED
${
DGL_SRC
}
)
...
...
cmake/modules/CUDA.cmake
View file @
edcecdd0
...
@@ -203,10 +203,10 @@ function(dgl_select_nvcc_arch_flags out_variable)
...
@@ -203,10 +203,10 @@ function(dgl_select_nvcc_arch_flags out_variable)
endfunction
()
endfunction
()
################################################################################################
################################################################################################
# Config cuda compilation
.
# Config cuda compilation
and append CUDA libraries to linker_libs
# Usage:
# Usage:
#
dgl_config_cuda(
<dgl_cuda_src>
)
# dgl_config_cuda(
linker_libs
)
macro
(
dgl_config_cuda
out_variable
)
macro
(
dgl_config_cuda
linker_libs
)
if
(
NOT CUDA_FOUND
)
if
(
NOT CUDA_FOUND
)
message
(
FATAL_ERROR
"Cannot find CUDA."
)
message
(
FATAL_ERROR
"Cannot find CUDA."
)
endif
()
endif
()
...
@@ -216,21 +216,6 @@ macro(dgl_config_cuda out_variable)
...
@@ -216,21 +216,6 @@ macro(dgl_config_cuda out_variable)
add_definitions
(
-DDGL_USE_CUDA
)
add_definitions
(
-DDGL_USE_CUDA
)
file
(
GLOB_RECURSE DGL_CUDA_SRC
src/array/cuda/*.cc
src/array/cuda/*.cu
src/array/cuda/uvm/*.cc
src/array/cuda/uvm/*.cu
src/kernel/cuda/*.cc
src/kernel/cuda/*.cu
src/partition/cuda/*.cu
src/runtime/cuda/*.cc
src/runtime/cuda/*.cu
src/geometry/cuda/*.cu
src/graph/transform/cuda/*.cu
src/graph/sampling/randomwalks/*.cu
)
# NVCC flags
# NVCC flags
# Manually set everything
# Manually set everything
set
(
CUDA_PROPAGATE_HOST_FLAGS OFF
)
set
(
CUDA_PROPAGATE_HOST_FLAGS OFF
)
...
@@ -252,10 +237,8 @@ macro(dgl_config_cuda out_variable)
...
@@ -252,10 +237,8 @@ macro(dgl_config_cuda out_variable)
message
(
STATUS
"CUDA_NVCC_FLAGS:
${
CUDA_NVCC_FLAGS
}
"
)
message
(
STATUS
"CUDA_NVCC_FLAGS:
${
CUDA_NVCC_FLAGS
}
"
)
list
(
APPEND
DGL_LINKER_LIBS
list
(
APPEND
${
linker_libs
}
${
CUDA_CUDART_LIBRARY
}
${
CUDA_CUDART_LIBRARY
}
${
CUDA_CUBLAS_LIBRARIES
}
${
CUDA_CUBLAS_LIBRARIES
}
${
CUDA_cusparse_LIBRARY
}
)
${
CUDA_cusparse_LIBRARY
}
)
set
(
${
out_variable
}
${
DGL_CUDA_SRC
}
)
endmacro
()
endmacro
()
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