Skip to content
This repository has been archived by the owner on Mar 20, 2023. It is now read-only.

Commit

Permalink
Drop cuda_profile.cu.
Browse files Browse the repository at this point in the history
  • Loading branch information
olupton committed Apr 13, 2022
1 parent bd4a06b commit 9a466a6
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 59 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ option(CORENRN_ENABLE_CALIPER_PROFILING "Enable Caliper instrumentation" OFF)
option(CORENRN_ENABLE_LIKWID_PROFILING "Enable LIKWID instrumentation" OFF)
option(CORENRN_ENABLE_CUDA_UNIFIED_MEMORY "Enable CUDA unified memory support" OFF)
option(CORENRN_ENABLE_UNIT_TESTS "Enable unit tests execution" ON)
option(CORENRN_ENABLE_GPU "Enable GPU support using OpenACC" OFF)
option(CORENRN_ENABLE_GPU "Enable GPU support using OpenACC or OpenMP" OFF)
option(CORENRN_ENABLE_SHARED "Enable shared library build" ON)
option(CORENRN_ENABLE_LEGACY_UNITS "Enable legacy FARADAY, R, etc" OFF)
option(CORENRN_ENABLE_PRCELLSTATE "Enable NRN_PRCELLSTATE debug feature" OFF)
Expand Down
4 changes: 2 additions & 2 deletions coreneuron/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ file(
"utils/*.cpp"
"utils/*/*.c"
"utils/*/*.cpp")
file(GLOB_RECURSE CORENEURON_CUDA_FILES "*.cu")
set(SCOPMATH_CODE_FILES
"sim/scopmath/abort.cpp" "sim/scopmath/crout_thread.cpp" "sim/scopmath/newton_thread.cpp"
"sim/scopmath/sparse_thread.cpp" "sim/scopmath/ssimplic_thread.cpp")
Expand Down Expand Up @@ -123,7 +122,8 @@ if(CORENRN_ENABLE_GPU)

set_source_files_properties(${OPENACC_EXCLUDED_FILES} PROPERTIES COMPILE_FLAGS
"-DDISABLE_OPENACC")
list(APPEND CORENEURON_CODE_FILES ${CORENEURON_CUDA_FILES})
# Only compile the explicit CUDA implementation of the Hines solver in GPU builds.
list(APPEND CORENEURON_CODE_FILES ${CMAKE_CURRENT_SOURCE_DIR}/permute/cellorder.cu)

# Eigen-3.5+ provides better GPU support. However, some functions cannot be called directly from
# within an OpenACC region. Therefore, we need to wrap them in a special API (decorate them with
Expand Down
1 change: 0 additions & 1 deletion coreneuron/gpu/nrn_acc_manager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
#include "coreneuron/utils/profile/profiler_interface.h"
#include "coreneuron/permute/cellorder.hpp"
#include "coreneuron/permute/data_layout.hpp"
#include "coreneuron/utils/profile/cuda_profile.h"
#include "coreneuron/sim/scopmath/newton_struct.h"
#include "coreneuron/coreneuron.hpp"
#include "coreneuron/utils/nrnoc_aux.hpp"
Expand Down
16 changes: 14 additions & 2 deletions coreneuron/utils/memory_utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
#include <fstream>
#include <unistd.h>
#include "coreneuron/utils/memory_utils.h"
#include "coreneuron/utils/profile/cuda_profile.h"
#include "coreneuron/mpi/nrnmpi.h"
#include "coreneuron/mpi/core/nrnmpi.hpp"
#include "coreneuron/apps/corenrn_parameters.hpp"
Expand All @@ -36,6 +35,10 @@
#include <malloc.h>
#endif

#ifdef CORENEURON_ENABLE_GPU
#include "cuda_profiler_api.h"
#endif

namespace coreneuron {
double nrn_mallinfo(void) {
// -ve mem usage for non-supported platforms
Expand Down Expand Up @@ -108,7 +111,16 @@ void report_mem_usage(const char* message, bool all_ranks) {
mem_avg);
#ifdef CORENEURON_ENABLE_GPU
if (corenrn_param.gpu) {
print_gpu_memory_usage();
size_t free_byte, total_byte;
cudaError_t cuda_status = cudaMemGetInfo(&free_byte, &total_byte);
if (cudaSuccess != cuda_status) {
std::printf("cudaMemGetInfo failed: %s\n", cudaGetErrorString(cuda_status));
}
constexpr double MiB{1. / (1024. * 1024.)};
std::printf(" GPU Memory (MiBs) : Used = %f, Free = %f, Total = %f\n",
(total_byte - free_byte) * MiB,
free_byte * MiB,
total_byte * MiB);
}
#endif
}
Expand Down
40 changes: 0 additions & 40 deletions coreneuron/utils/profile/cuda_profile.cu

This file was deleted.

13 changes: 0 additions & 13 deletions coreneuron/utils/profile/cuda_profile.h

This file was deleted.

0 comments on commit 9a466a6

Please sign in to comment.