diff --git a/aksetup_helper.py b/aksetup_helper.py index 345cc94dcff37ba4242a861c728410e877de9ce0..924df5d6accca5878e9a69b5445fa0c36fb54ecd 100644 --- a/aksetup_helper.py +++ b/aksetup_helper.py @@ -483,15 +483,47 @@ class BoostLibraries(Libraries): def set_up_shipped_boost_if_requested(conf): """Set up the package to use a shipped version of Boost. - Return a list of extra C files to build. + Return a tuple of a list of extra C files to build and extra + defines to be used. """ + from os.path import exists + import sys + if conf["USE_SHIPPED_BOOST"]: - from os.path import exists if not exists("bpl-subset/bpl_subset/boost/version.hpp"): - raise RuntimeError("The shipped Boost library was not found.") + print >>sys.stderr, "------------------------------------------------------------------------" + print >>sys.stderr, "The shipped Boost library was not found, but USE_SHIPPED_BOOST is True." + print >>sys.stderr, "(It should be under bpl-subset/)" + print >>sys.stderr, "------------------------------------------------------------------------" + print >>sys.stderr, "If you got this package from git, you probably want to do" + print >>sys.stderr, "" + print >>sys.stderr, " $ git submodule init" + print >>sys.stderr, " $ git submodule update" + print >>sys.stderr, "" + print >>sys.stderr, "to fetch what you are presently missing. If you got this from" + print >>sys.stderr, "a distributed package on the net, that package is broken and" + print >>sys.stderr, "should be fixed. For now, I will turn off 'USE_SHIPPED_BOOST'" + print >>sys.stderr, "to try and see if the build succeeds that way, but in the long" + print >>sys.stderr, "run you might want to either get the missing bits or turn" + print >>sys.stderr, "'USE_SHIPPED_BOOST' off." + print >>sys.stderr, "------------------------------------------------------------------------" + conf["USE_SHIPPED_BOOST"] = False + + delay = 10 + + from time import sleep + import sys + while delay: + sys.stdout.write("Continuing in %d seconds... \r" % delay) + sys.stdout.flush() + delay -= 1 + sleep(1) + + if conf["USE_SHIPPED_BOOST"]: conf["BOOST_INC_DIR"] = ["bpl-subset/bpl_subset"] conf["BOOST_LIB_DIR"] = [] conf["BOOST_PYTHON_LIBNAME"] = [] + conf["BOOST_THREAD_LIBNAME"] = [] from glob import glob source_files = (glob("bpl-subset/bpl_subset/libs/*/*/*/*.cpp") diff --git a/examples/matrix-multiply.py b/examples/matrix-multiply.py index 142591f14e7bbeb568c9558386c87a64fd7bf10a..c8fab12e19b5d4499bd241e53c7433049ad7e642 100644 --- a/examples/matrix-multiply.py +++ b/examples/matrix-multiply.py @@ -161,8 +161,12 @@ h_c = numpy.empty((c_height, c_width)).astype(numpy.float32) kernel_params = {"block_size": block_size, "w_a":a_width, "h_a":a_height, "w_b":b_width} +if "NVIDIA" in queue.device.vendor: + options = "-cl-mad-enable -cl-fast-relaxed-math" +else: + options = None prg = cl.Program(ctx, KERNEL_CODE % kernel_params, - ).build(options="-cl-mad-enable -cl-fast-relaxed-math") + ).build(options=options) kernel = prg.matrixMul #print prg.binaries[0]