Ported to C++11

This commit is contained in:
Philippe Tillet
2015-02-04 22:06:15 -05:00
parent 3a296ae3b7
commit bbf2f0188e
40 changed files with 413 additions and 563 deletions

View File

@@ -45,7 +45,7 @@ def main():
return optlist
cvars = sysconfig.get_config_vars()
cvars['OPT'] = "-DNDEBUG -O3 " + str.join(' ', remove_prefixes(cvars['OPT'].split(), ['-g', '-O', '-Wstrict-prototypes', '-DNDEBUG']))
cvars['OPT'] = "-DNDEBUG -O3 -std=c++11 " + str.join(' ', remove_prefixes(cvars['OPT'].split(), ['-g', '-O', '-Wstrict-prototypes', '-DNDEBUG']))
cvars["CFLAGS"] = cvars["BASECFLAGS"] + " " + cvars["OPT"]
cvars["LDFLAGS"] = '-Wl,--no-as-needed ' + cvars["LDFLAGS"]

View File

@@ -1,4 +1,5 @@
#include <list>
#include <functional>
#include <boost/python.hpp>
#include <boost/python/suite/indexing/vector_indexing_suite.hpp>
@@ -190,9 +191,6 @@ namespace detail
return to_list(devices.begin(), devices.end());
}
std::vector<cl::CommandQueue> & get_queue(cl::Context const & ctx)
{ return atd::cl_ext::get_queues(ctx); }
atd::numeric_type extract_dtype(bp::object const & odtype)
{
std::string name = bp::extract<std::string>(odtype.attr("__class__").attr("__name__"))();
@@ -352,7 +350,7 @@ void export_cl()
.def("__init__", bp::make_constructor(&detail::make_context))
#define WRAP(PYNAME, NAME) .add_property(PYNAME, &detail::wrap_context_info<NAME>)
#undef WRAP
.add_property("queues", bp::make_function(&detail::get_queue, bp::return_internal_reference<>()))
.add_property("queues", bp::make_function(static_cast<std::vector<cl::CommandQueue> & (*)(const cl::Context&)>( [](const cl::Context & ctx) -> std::vector<cl::CommandQueue> & { return atd::cl_ext::queues[ctx]; }) , bp::return_internal_reference<>()))
;
bp::class_<cl::CommandQueue>("command_queue", bp::init<cl::Context, cl::Device>())