2014-08-30 18:02:17 -04:00
|
|
|
#ifndef VIENNACL_DEVICE_SPECIFIC_EXECUTE_HPP
|
|
|
|
#define VIENNACL_DEVICE_SPECIFIC_EXECUTE_HPP
|
|
|
|
|
|
|
|
#include <cstring>
|
|
|
|
#include <vector>
|
|
|
|
#include <typeinfo>
|
|
|
|
|
|
|
|
#include "viennacl/tools/tools.hpp"
|
|
|
|
#include "viennacl/tools/timer.hpp"
|
|
|
|
#include "viennacl/scheduler/forwards.h"
|
|
|
|
|
|
|
|
#include "atidlas/forwards.h"
|
|
|
|
#include "atidlas/templates/template_base.hpp"
|
2014-09-01 19:37:05 -04:00
|
|
|
#include "atidlas/tools/tree_parsing.hpp"
|
|
|
|
#include "atidlas/tools/execution_handler.hpp"
|
2014-08-30 18:02:17 -04:00
|
|
|
|
|
|
|
namespace atidlas
|
|
|
|
{
|
|
|
|
|
|
|
|
inline void execute(template_base const & T, statements_container const & statements, viennacl::ocl::context & ctx = viennacl::ocl::current_context(), bool force_compilation = false)
|
|
|
|
{
|
|
|
|
//Generate program name
|
2014-09-01 19:37:05 -04:00
|
|
|
std::string program_name = tools::statements_representation(statements, BIND_TO_HANDLE);
|
2014-08-30 18:02:17 -04:00
|
|
|
execution_handler handler(program_name, ctx, ctx.current_device(), force_compilation);
|
|
|
|
handler.add(program_name, T, statements);
|
|
|
|
handler.execute(program_name, statements);
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|