Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
ScalFMM
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
5
Issues
5
List
Boards
Labels
Service Desk
Milestones
Operations
Operations
Incidents
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
solverstack
ScalFMM
Commits
d36b1758
Commit
d36b1758
authored
Feb 17, 2015
by
BRAMAS Berenger
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Enable compilation with CUDA (when we generate the library)
parent
b5991826
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
44 additions
and
0 deletions
+44
-0
CMakeLists.txt
CMakeLists.txt
+20
-0
Src/CMakeLists.txt
Src/CMakeLists.txt
+24
-0
No files found.
CMakeLists.txt
View file @
d36b1758
...
...
@@ -289,8 +289,28 @@ if( ScalFMM_USE_STARPU )
MESSAGE
(
STATUS
" STARPU_LIBRARIES =
${
STARPU_LIBRARIES
}
"
)
MESSAGE
(
STATUS
" STARPU_INCLUDES =
${
STARPU_INCLUDES
}
"
)
OPTION
(
ScalFMM_USE_CUDA
"Set to ON to use CUDA with StarPU"
OFF
)
if
(
ScalFMM_USE_CUDA
)
execute_process
(
COMMAND nvcc --version ERROR_VARIABLE cuda_error_output OUTPUT_QUIET
)
if
(
cuda_error_output
)
message
(
FATAL_ERROR
"nvcc is needed with CUDA."
)
endif
()
if
(
NOT DEFINED CUSTOM_CUDA_FLAGS
)
SET
(
CUSTOM_CUDA_FLAGS
"-std=c++11;-arch=sm_20"
CACHE STRING
"Set your CUDA flags, for example : -arch=sm_20;-ptxas-options=-v;-use_fast_math"
)
endif
()
# This is needed to remove backslash after space in ADD_CUSTOM_COMMAND
SEPARATE_ARGUMENTS
(
CUSTOM_CUDA_FLAGS
)
MESSAGE
(
STATUS
"CUSTOM_CUDA_FLAGS =
${
CUSTOM_CUDA_FLAGS
}
"
)
# Add libcudart and cuda.h
# link_directories($ENV{CUDA_LIB})
include_directories
(
${
$ENV{CUDA_INC
}
}
)
SET
(
SCALFMM_LIBRARIES
"
${
SCALFMM_LIBRARIES
}
; -L$ENV{CUDA_LIB}; -lcudart"
)
endif
()
endif
(
ScalFMM_USE_STARPU
)
list
(
APPEND FUSE_LIST
"STARPU"
)
list
(
APPEND FUSE_LIST
"CUDA"
)
#
##################################################################
# Use SSE #
...
...
Src/CMakeLists.txt
View file @
d36b1758
...
...
@@ -17,11 +17,35 @@ file(
./*.cpp
)
# Add CUDA files once they are compiled from cu to .o
if
(
ScalFMM_USE_CUDA
)
# Find all the CU files in my project
file
(
GLOB_RECURSE source_cu_files ./*.cu
)
# Iterate and add builind command for each file
set
(
SCALFMM_CUDA_SOURCES
""
)
FOREACH
(
_file
${
source_cu_files
}
)
GET_FILENAME_COMPONENT
(
_filewe
${
_file
}
NAME_WE
)
SET
(
_filehpp_output
${
CMAKE_CURRENT_BINARY_DIR
}
/
${
_filewe
}
.o
)
ADD_CUSTOM_COMMAND
(
OUTPUT
${
_filehpp_output
}
DEPENDS
${
_file
}
COMMAND echo ARGS Compiling
${
_filewe
}
COMMAND nvcc ARGS -c
${
_file
}
-o
${
_filehpp_output
}
${
CUSTOM_CUDA_FLAGS
}
)
LIST
(
APPEND SCALFMM_CUDA_SOURCES
${
_filehpp_output
}
)
ENDFOREACH
()
MESSAGE
(
STATUS
"SCALFMM_CUDA_SOURCES =
${
SCALFMM_CUDA_SOURCES
}
"
)
endif
()
# Adding cpp files to project
add_library
(
scalfmm
STATIC
${
source_lib_files
}
${
SCALFMM_CUDA_SOURCES
}
)
# Add blas library (even if it is set to off)
...
...
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