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 <gabe.black@gmail.com> Maintainer: Gabe Black <gabe.black@gmail.com> Tested-by: kokoro <noreply+kokoro@google.com>
This commit is contained in:
@@ -809,8 +809,8 @@ sticky_vars.AddVariables(
|
||||
|
||||
# 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 @@ Build variables for {dir}:
|
||||
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']:
|
||||
|
||||
@@ -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 @@ Profiler::collateStats()
|
||||
rubyProfilerStats.
|
||||
m_outstandReqHistSeqr.add(seq->getOutstandReqHist());
|
||||
}
|
||||
#ifdef BUILD_GPU
|
||||
#if BUILD_GPU
|
||||
GPUCoalescer *coal = ctr->getGPUCoalescer();
|
||||
if (coal != NULL) {
|
||||
rubyProfilerStats.
|
||||
@@ -488,7 +489,7 @@ Profiler::collateStats()
|
||||
}
|
||||
}
|
||||
}
|
||||
#ifdef BUILD_GPU
|
||||
#if BUILD_GPU
|
||||
GPUCoalescer *coal = ctr->getGPUCoalescer();
|
||||
if (coal != NULL) {
|
||||
// add all the latencies
|
||||
|
||||
Reference in New Issue
Block a user