Gabe Black has submitted this change. ( https://gem5-review.googlesource.com/c/public/gem5/+/40873 )

Change subject: scons,gpu: Use a config header for the BUILD_GPU setting.
......................................................................

scons,gpu: Use a config header for the BUILD_GPU setting.

The BUILD_GPU setting was being set by adding a -D to the command line
at the top level SConstruct. Instead, add BUILD_GPU to export_vars so
that it ends up in a config/build_gpu.hh header. Also switch it from the
fairly dangerous #ifdef style to the safer #if.

Change-Id: Ic93d37c9d7671023a6978842dbb2750c3e92f8d8
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/40873
Reviewed-by: Gabe Black <[email protected]>
Maintainer: Gabe Black <[email protected]>
Tested-by: kokoro <[email protected]>
---
M SConstruct
M src/mem/ruby/profiler/Profiler.cc
2 files changed, 6 insertions(+), 8 deletions(-)

Approvals:
  Gabe Black: Looks good to me, approved; Looks good to me, approved
  kokoro: Regressions pass



diff --git a/SConstruct b/SConstruct
index ae4c86a..2c55d5f 100755
--- a/SConstruct
+++ b/SConstruct
@@ -809,8 +809,8 @@

# These variables get exported to #defines in config/*.hh (see src/SConscript).
 export_vars += ['USE_FENV', 'TARGET_ISA', 'TARGET_GPU_ISA',
-                'USE_POSIX_CLOCK', 'USE_KVM', 'USE_TUNTAP', 'PROTOCOL',
-                'HAVE_PROTOBUF', 'HAVE_VALGRIND',
+                'USE_POSIX_CLOCK', 'USE_KVM', 'USE_TUNTAP', 'BUILD_GPU',
+                'PROTOCOL', 'HAVE_PROTOBUF', 'HAVE_VALGRIND',
                 'HAVE_PERF_ATTR_EXCLUDE_HOST', 'USE_PNG',
                 'NUMBER_BITS_PER_SET', 'USE_HDF5']

@@ -1028,9 +1028,6 @@
             warning("Can't connect EtherTap with a tap device.")
             env['USE_TUNTAP'] = False

-    if env['BUILD_GPU']:
-        env.Append(CPPDEFINES=['BUILD_GPU'])
-
     # Warn about missing optional functionality
     if env['USE_KVM']:
         if not main['HAVE_PERF_ATTR_EXCLUDE_HOST']:
diff --git a/src/mem/ruby/profiler/Profiler.cc b/src/mem/ruby/profiler/Profiler.cc
index 312cf1d..7e66311 100644
--- a/src/mem/ruby/profiler/Profiler.cc
+++ b/src/mem/ruby/profiler/Profiler.cc
@@ -52,6 +52,7 @@

 #include "base/stl_helpers.hh"
 #include "base/str.hh"
+#include "config/build_gpu.hh"
 #include "mem/ruby/network/Network.hh"
 #include "mem/ruby/profiler/AddressProfiler.hh"
 #include "mem/ruby/protocol/MachineType.hh"
@@ -70,7 +71,7 @@
  * here, but until then these ifdefs will
  * serve.
  */
-#ifdef BUILD_GPU
+#if BUILD_GPU
 #include "mem/ruby/system/GPUCoalescer.hh"

 #endif
@@ -391,7 +392,7 @@
                 rubyProfilerStats.
                     m_outstandReqHistSeqr.add(seq->getOutstandReqHist());
             }
-#ifdef BUILD_GPU
+#if BUILD_GPU
             GPUCoalescer *coal = ctr->getGPUCoalescer();
             if (coal != NULL) {
                 rubyProfilerStats.
@@ -488,7 +489,7 @@
                     }
                 }
             }
-#ifdef BUILD_GPU
+#if BUILD_GPU
             GPUCoalescer *coal = ctr->getGPUCoalescer();
             if (coal != NULL) {
                 // add all the latencies

--
To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/40873
To unsubscribe, or for help writing mail filters, visit https://gem5-review.googlesource.com/settings

Gerrit-Project: public/gem5
Gerrit-Branch: develop
Gerrit-Change-Id: Ic93d37c9d7671023a6978842dbb2750c3e92f8d8
Gerrit-Change-Number: 40873
Gerrit-PatchSet: 15
Gerrit-Owner: Gabe Black <[email protected]>
Gerrit-Reviewer: Andreas Sandberg <[email protected]>
Gerrit-Reviewer: Bobby R. Bruce <[email protected]>
Gerrit-Reviewer: Gabe Black <[email protected]>
Gerrit-Reviewer: Giacomo Travaglini <[email protected]>
Gerrit-Reviewer: kokoro <[email protected]>
Gerrit-MessageType: merged
_______________________________________________
gem5-dev mailing list -- [email protected]
To unsubscribe send an email to [email protected]
%(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s

Reply via email to