All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
execute.hpp
Go to the documentation of this file.
#ifndef VIENNACL_DEVICE_SPECIFIC_EXECUTE_HPP
#define VIENNACL_DEVICE_SPECIFIC_EXECUTE_HPP
/* =========================================================================
Copyright (c) 2010-2016, Institute for Microelectronics,
Institute for Analysis and Scientific Computing,
TU Wien.
Portions of this software are copyright by UChicago Argonne, LLC.
-----------------
ViennaCL - The Vienna Computing Library
-----------------
Project Head: Karl Rupp rupp@iue.tuwien.ac.at
(A list of authors and contributors can be found in the manual)
License: MIT (X11), see file LICENSE in the base directory
============================================================================= */
#include <cstring>
#include <vector>
#include <typeinfo>
#include "viennacl/scheduler/forwards.h"
#include "viennacl/device_specific/forwards.h"
#include "viennacl/device_specific/templates/template_base.hpp"
#include "viennacl/device_specific/tree_parsing.hpp"
#include "viennacl/device_specific/execution_handler.hpp"
#include "viennacl/tools/tools.hpp"
#include "viennacl/tools/timer.hpp"
namespace viennacl
{
namespace device_specific
{
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
std::string program_name = tree_parsing::statements_representation(statements, BIND_TO_HANDLE);
execution_handler handler(program_name, ctx, ctx.current_device(), force_compilation);
handler.add(program_name, T, statements);
handler.execute(program_name, statements);
}
}
}
#endif
viennacl::device_specific::execution_handler
Definition: execution_handler.hpp:39
tools.hpp
Various little tools used here and there in ViennaCL.
viennacl::ocl::current_context
viennacl::ocl::context & current_context()
Convenience function for returning the current context.
Definition: backend.hpp:213
viennacl::ocl::context
Manages an OpenCL context and provides the respective convenience functions for creating buffers...
Definition: context.hpp:55
viennacl::device_specific::execution_handler::add
void add(std::string const &key, template_base const &T, statements_container const &statements)
Definition: execution_handler.hpp:70
viennacl::device_specific::template_base
Definition: template_base.hpp:54
template_base.hpp
forwards.h
Forwards declaration.
forwards.h
Provides the datastructures for dealing with a single statement such as 'x = y + z;'.
viennacl::device_specific::execute
void execute(template_base const &T, statements_container const &statements, viennacl::ocl::context &ctx=viennacl::ocl::current_context(), bool force_compilation=false)
Definition: execute.hpp:44
viennacl::device_specific::tree_parsing::statements_representation
std::string statements_representation(statements_container const &statements, binding_policy_t binding_policy)
Definition: tree_parsing.hpp:494
timer.hpp
A simple, yet (mostly) sufficiently accurate timer for benchmarking and profiling.
tree_parsing.hpp
Code for parsing the expression trees.
viennacl::device_specific::BIND_TO_HANDLE
Definition: forwards.h:248
execution_handler.hpp
Helper for handling fallbacks, lazy compilation, input-dependent kernels, etc.
viennacl::device_specific::statements_container
Definition: forwards.h:262