2015-01-12 13:20:53 -05:00
|
|
|
#ifndef ATIDLAS_BACKEND_TEMPLATES_MAXPY_H
|
|
|
|
#define ATIDLAS_BACKEND_TEMPLATES_MAXPY_H
|
|
|
|
|
|
|
|
#include <vector>
|
2015-01-17 10:48:02 -05:00
|
|
|
#include "atidlas/backend/templates/base.h"
|
2015-01-12 13:20:53 -05:00
|
|
|
|
|
|
|
namespace atidlas
|
|
|
|
{
|
|
|
|
|
2015-01-17 10:48:02 -05:00
|
|
|
class maxpy_parameters : public base::parameters_type
|
2015-01-12 13:20:53 -05:00
|
|
|
{
|
|
|
|
public:
|
2015-01-27 02:41:27 -05:00
|
|
|
maxpy_parameters(unsigned int _simd_width, unsigned int _local_size_0, unsigned int _local_size_1, unsigned int _num_groups_0, unsigned int _num_groups_1, fetching_policy_type _fetching_policy);
|
2015-01-12 13:20:53 -05:00
|
|
|
|
|
|
|
unsigned int num_groups_0;
|
|
|
|
unsigned int num_groups_1;
|
|
|
|
fetching_policy_type fetching_policy;
|
|
|
|
};
|
|
|
|
|
2015-01-17 10:48:02 -05:00
|
|
|
class maxpy : public base_impl<maxpy, maxpy_parameters>
|
2015-01-12 13:20:53 -05:00
|
|
|
{
|
|
|
|
private:
|
2015-02-01 22:28:49 -05:00
|
|
|
int check_invalid_impl(cl::Device const &, expressions_tuple const &) const;
|
|
|
|
std::string generate_impl(unsigned int label, expressions_tuple const & expressions, std::vector<mapping_type> const & mappings, unsigned int simd_width) const;
|
|
|
|
std::vector<std::string> generate_impl(unsigned int label, expressions_tuple const & expressions, std::vector<mapping_type> const & mappings) const;
|
2015-01-12 13:20:53 -05:00
|
|
|
public:
|
|
|
|
maxpy(parameters_type const & parameters, binding_policy_t binding_policy = BIND_ALL_UNIQUE);
|
2015-01-27 02:41:27 -05:00
|
|
|
maxpy(unsigned int simd, unsigned int ls1, unsigned int ls2, unsigned int ng1, unsigned int ng2, fetching_policy_type fetch, binding_policy_t bind = BIND_ALL_UNIQUE);
|
2015-02-01 22:28:49 -05:00
|
|
|
std::vector<int_t> input_sizes(expressions_tuple const & expressions);
|
2015-02-05 04:42:57 -05:00
|
|
|
void enqueue(cl::CommandQueue & queue, std::vector<cl_ext::lazy_compiler> & programs, unsigned int label, controller<expressions_tuple> const &);
|
2015-01-12 13:20:53 -05:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|