Deleted Added
sdiff udiff text old ( 12013:755a563d1883 ) new ( 12015:469a2f126b4c )
full compact
1# -*- mode:python -*-
2
3# Copyright (c) 2013, 2015, 2016 ARM Limited
4# All rights reserved.
5#
6# The license below extends only to copyright in the software and shall
7# not be construed as granting a license to any other intellectual
8# property including but not limited to intellectual property relating

--- 1310 unchanged lines hidden (view full) ---

1319 build_dir = os.path.relpath(root, ext_dir)
1320 main.SConscript(joinpath(root, 'SConscript'),
1321 variant_dir=joinpath(build_root, build_dir))
1322
1323main.Prepend(CPPPATH=Dir('ext/pybind11/include/'))
1324
1325###################################################
1326#
1327# This function is used to set up a directory with switching headers
1328#
1329###################################################
1330
1331main['ALL_ISA_LIST'] = all_isa_list
1332main['ALL_GPU_ISA_LIST'] = all_gpu_isa_list
1333def make_switching_dir(dname, switch_headers, env):
1334 # Generate the header. target[0] is the full path of the output
1335 # header to generate. 'source' is a dummy variable, since we get the
1336 # list of ISAs from env['ALL_ISA_LIST'].
1337 def gen_switch_hdr(target, source, env):
1338 fname = str(target[0])
1339 isa = env['TARGET_ISA'].lower()
1340 try:
1341 f = open(fname, 'w')
1342 print >>f, '#include "%s/%s/%s"' % (dname, isa, basename(fname))
1343 f.close()
1344 except IOError:
1345 print "Failed to create %s" % fname
1346 raise
1347
1348 # Build SCons Action object. 'varlist' specifies env vars that this
1349 # action depends on; when env['ALL_ISA_LIST'] changes these actions
1350 # should get re-executed.
1351 switch_hdr_action = MakeAction(gen_switch_hdr,
1352 Transform("GENERATE"), varlist=['ALL_ISA_LIST'])
1353
1354 # Instantiate actions for each header
1355 for hdr in switch_headers:
1356 env.Command(hdr, [], switch_hdr_action)
1357
1358Export('make_switching_dir')
1359
1360def make_gpu_switching_dir(dname, switch_headers, env):
1361 # Generate the header. target[0] is the full path of the output
1362 # header to generate. 'source' is a dummy variable, since we get the
1363 # list of ISAs from env['ALL_ISA_LIST'].
1364 def gen_switch_hdr(target, source, env):
1365 fname = str(target[0])
1366
1367 isa = env['TARGET_GPU_ISA'].lower()

--- 191 unchanged lines hidden ---