Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
openfpm_io
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Sbalzarini Lab
Software
Parallel Computing
OpenFPM
openfpm_io
Commits
7fa25c86
Commit
7fa25c86
authored
3 years ago
by
Pietro Incardona
Browse files
Options
Downloads
Patches
Plain Diff
hip conversion
parent
14dae8cc
Branches
hip_conversion2
Branches containing commit
No related tags found
No related merge requests found
Pipeline
#2911
failed
3 years ago
Stage: build
Stage: test
Changes
5
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
CMakeLists.txt
+17
-3
17 additions, 3 deletions
CMakeLists.txt
configure
+19
-0
19 additions, 0 deletions
configure
src/CMakeLists.txt
+31
-2
31 additions, 2 deletions
src/CMakeLists.txt
src/config/config_cmake.h.in
+6
-0
6 additions, 0 deletions
src/config/config_cmake.h.in
src/main.cpp
+0
-1
0 additions, 1 deletion
src/main.cpp
with
73 additions
and
6 deletions
CMakeLists.txt
+
17
−
3
View file @
7fa25c86
...
...
@@ -19,11 +19,15 @@ set(ENV{HDF5_ROOT} ${HDF5_ROOT})
set
(
OPENFPM_PDATA_DIR CACHE PATH
"OpenFPM_pdata dirs"
)
set
(
PETSC_ROOT CACHE PATH
"If compiling with linear algebra indicate the PETSC root directory"
)
set
(
ENV{PETSC_DIR}
${
PETSC_ROOT
}
)
set
(
HIP_ENABLE CACHE BOOL
"Enable HIP compiler"
)
set
(
AMD_ARCH_COMPILE
"gfx900"
CACHE STRING
"AMD gpu architecture used to compile kernels"
)
if
(
ENABLE_GPU
)
set
(
CUDA_ON_CPU OFF
)
enable_language
(
CUDA
)
find_package
(
CUDA
)
set
(
CUDA_ON_CPU OFF
)
if
(
NOT HIP_ENABLE
)
enable_language
(
CUDA
)
find_package
(
CUDA
)
endif
()
endif
()
set
(
CMAKE_CXX_STANDARD 14
)
...
...
@@ -41,6 +45,16 @@ find_package(MPI REQUIRED)
find_package
(
HDF5 REQUIRED
)
find_package
(
TinyObjLoader
)
find_package
(
PETSc
)
find_package
(
HIP
)
if
(
HIP_FOUND
)
set
(
DEFINE_HIP_GPU
"#define HIP_GPU"
)
set
(
DEFINE_CUDIFY_USE_HIP
"#define CUDIFY_USE_HIP"
)
endif
()
if
(
HIP_FOUND
)
set
(
DEFINE_CUDA_GPU
"#define CUDA_GPU"
)
endif
()
if
(
CUDA_FOUND
)
set
(
OPENFPM_INIT_FILE
"initialize/initialize_wrapper_cuda.cu"
)
...
...
This diff is collapsed.
Click to expand it.
configure
+
19
−
0
View file @
7fa25c86
...
...
@@ -122,7 +122,10 @@ with_petsc
with_eigen
with_vcdevel
enable_gpu
enable_hip
enable_asan
enable_garbageinj
enable_garbageinjv
'
rm
-rf
build
...
...
@@ -251,11 +254,25 @@ do
else
conf_options
=
"
$conf_options
-DCMAKE_CUDA_HOST_COMPILER=
$(
which
$CXX
)
"
fi
if
[
x
"
$CXXCUDA
"
==
x
""
]
;
then
conf_options
=
"
$conf_options
"
else
conf_options
=
"
$conf_options
-DCMAKE_CUDA_COMPILER=
$(
which
$CXXCUDA
)
"
fi
conf_options
=
"
$conf_options
-DENABLE_GPU=ON"
;;
hip
)
conf_options
=
"
$conf_options
-DHIP_ENABLE=ON"
;;
asan
)
conf_options
=
"
$conf_options
-DENABLE_ASAN=ON"
;;
garbageinj
)
conf_options
=
"
$conf_options
-DENABLE_GARBAGE_INJECTOR=ON"
;;
garbageinjv
)
conf_options
=
"
$conf_options
-DENABLE_VCLUSTER_GARBAGE_INJECTOR=ON"
;;
*
)
ac_unrecognized_opts
=
"
$ac_unrecognized_opts$ac_unrecognized_sep
--enable-
$ac_useropt_orig
"
ac_unrecognized_sep
=
', '
;;
...
...
@@ -573,6 +590,7 @@ cd build
## remove enerything
echo
"Calling cmake ../.
$conf_options
"
printf
"cmake ../.
$conf_options
"
>
cmake_build_options
rm
../error_code
DYLD_LIBRARY_PATH
=
$ld_lib_pathopt
cmake ../.
$conf_options
if
[
$?
!=
0
]
;
then
...
...
@@ -601,6 +619,7 @@ clean:
install:
\$
(MAKE) -C build
\$
@
script/install_parallel_debugger
pdata:
\$
(MAKE) -C build
\$
@
...
...
This diff is collapsed.
Click to expand it.
src/CMakeLists.txt
+
31
−
2
View file @
7fa25c86
...
...
@@ -6,12 +6,41 @@ if (CUDA_ON_CPU)
add_definitions
(
-DCUDA_ON_CPU
)
endif
()
if
(
CUDA_FOUND OR CUDA_ON_CPU OR HIP_FOUND
)
add_executable
(
io main.cpp
set
(
CUDA_SOURCES HDF5_wr/HDF5_writer_cuda.cu
)
endif
()
if
(
HIP_ENABLE AND HIP_FOUND
)
list
(
APPEND HIP_HIPCC_FLAGS
${
CMAKE_CXX_FLAGS_DEBUG
}
)
if
(
CMAKE_BUILD_TYPE STREQUAL
"Debug"
)
list
(
APPEND HIP_HIPCC_FLAGS -O0
)
endif
()
set
(
CMAKE_CXX_COMPILER
${
HIP_HIPCC_EXECUTABLE
}
)
list
(
APPEND HIP_HIPCC_FLAGS -D__NVCC__ -D__HIP__ -DCUDART_VERSION=11000 -D__CUDACC__ -D__CUDACC_VER_MAJOR__=11 -D__CUDACC_VER_MINOR__=0 -D__CUDACC_VER_BUILD__=0
)
set_source_files_properties
(
${
CUDA_SOURCES
}
PROPERTIES LANGUAGE CXX
)
hip_add_executable
(
io main.cpp
MetaParser/MetaParser_unit_test.cpp
${
CUDA_SOURCES
}
ObjReader/ObjReader_unit_test.cpp
)
else
()
add_executable
(
io main.cpp
MetaParser/MetaParser_unit_test.cpp
HDF5_wr/HDF5_writer_cuda.cu
${
CUDA_SOURCES
}
ObjReader/ObjReader_unit_test.cpp
)
endif
()
add_dependencies
(
io ofpmmemory
)
add_dependencies
(
io vcluster
)
...
...
This diff is collapsed.
Click to expand it.
src/config/config_cmake.h.in
+
6
−
0
View file @
7fa25c86
/* HIP GPU support */
${DEFINE_HIP_GPU}
/* HIP Cudify GPU support */
${DEFINE_CUDIFY_USE_HIP}
/* Coverty scan */
${DEFINE_COVERTY_SCAN}
...
...
This diff is collapsed.
Click to expand it.
src/main.cpp
+
0
−
1
View file @
7fa25c86
...
...
@@ -8,7 +8,6 @@
#define BOOST_TEST_DYN_LINK
#include
<boost/test/unit_test.hpp>
// initialization function:
bool
init_unit_test
()
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment