Tuning: Merged tune branch.
- Much cleaner and more concise source - Better exceptions handling - Checks local minima to see if retuning is needed. Resolved conflicts: bench/blas.cpp include/isaac/backend/templates/mproduct.h include/isaac/driver/buffer.h lib/array.cpp lib/backend/templates/mproduct.cpp lib/driver/buffer.cpp python/setup.py tune/pysrc/autotune.py tune/pysrc/dataset.py tune/pysrc/misc_tools.py
This commit is contained in:
@@ -106,6 +106,11 @@ namespace detail
|
||||
return ndarray_to_iscarray(np::from_object(obj, to_np_dtype(tools::extract_dtype(odtype))), context);
|
||||
}
|
||||
|
||||
std::shared_ptr<isc::array> create_zeros_array(isc::int_t M, isc::int_t N, bp::object odtype, isc::driver::Context context)
|
||||
{
|
||||
return std::shared_ptr<isc::array>(new isc::array(isc::zeros(M, N, tools::extract_dtype(odtype), context)));
|
||||
}
|
||||
|
||||
std::shared_ptr<isc::array> create_empty_array(bp::object sizes, bp::object odtype, isc::driver::Context context)
|
||||
{
|
||||
typedef std::shared_ptr<isc::array> result_type;
|
||||
@@ -281,9 +286,13 @@ void export_core()
|
||||
.def("__init__", bp::make_constructor(detail::construct_scalar, bp::default_call_policies(), (bp::arg(""), bp::arg("context")=isc::driver::queues.default_context())))
|
||||
;
|
||||
|
||||
//Other numpy-like initializers
|
||||
//Other numpy-like initializers
|
||||
bp::def("empty", &detail::create_empty_array, (bp::arg("shape"), bp::arg("dtype") = bp::scope().attr("float32"), bp::arg("context")=isc::driver::queues.default_context()));
|
||||
|
||||
//Assign
|
||||
bp::def("assign", static_cast<isc::array_expression (*)(isc::array const &, isc::array const &)>(&isc::assign));\
|
||||
bp::def("assign", static_cast<isc::array_expression (*)(isc::array const &, isc::array_expression const &)>(&isc::assign));\
|
||||
|
||||
//Binary
|
||||
#define MAP_FUNCTION(name) \
|
||||
bp::def(#name, static_cast<isc::array_expression (*)(isc::array const &, isc::array const &)>(&isc::name));\
|
||||
@@ -302,6 +311,8 @@ void export_core()
|
||||
bp::def(#name, static_cast<isc::array_expression (*)(isc::array const &)>(&isc::name));\
|
||||
bp::def(#name, static_cast<isc::array_expression (*)(isc::array_expression const &)>(&isc::name));
|
||||
|
||||
bp::def("zeros", &detail::create_zeros_array, (bp::arg("shape"), bp::arg("dtype") = bp::scope().attr("float32"), bp::arg("context")=isc::driver::queues.default_context()));
|
||||
|
||||
MAP_FUNCTION(abs)
|
||||
MAP_FUNCTION(acos)
|
||||
MAP_FUNCTION(asin)
|
||||
|
Reference in New Issue
Block a user