void operator()(isaac::expression_tree const & expression_tree, size_t root_idx, leaf_t leaf_t) const { expression_tree::node const & root_node = expression_tree.tree()[root_idx]; if (leaf_t==LHS_NODE_TYPE && root_node.lhs.subtype != COMPOSITE_OPERATOR_TYPE) set_arguments(root_node.lhs, detail::is_assignment(root_node.op)); else if (leaf_t==RHS_NODE_TYPE && root_node.rhs.subtype != COMPOSITE_OPERATOR_TYPE) set_arguments(root_node.rhs, false); }
void set_arguments(tree_node const & lhs_rhs, bool is_assigned) const { switch(lhs_rhs.subtype) { case VALUE_SCALAR_TYPE: return set_arguments(lhs_rhs.dtype, lhs_rhs.vscalar); case DENSE_ARRAY_TYPE: return set_arguments(lhs_rhs.array, is_assigned); case FOR_LOOP_INDEX_TYPE: return; default: throw std::runtime_error("Unrecognized type family"); } }
void enqueue(std::string const & kernel_prefix, std::vector<lazy_program_compiler> & programs, statements_container const & statements) { viennacl::kernel & kernel = programs[0].program().kernel(kernel_prefix); kernel.local_work_size(0, p_.local_size_0); kernel.local_work_size(1, p_.local_size_1); kernel.global_work_size(0,p_.local_size_0*p_.num_groups_0); kernel.global_work_size(1,p_.local_size_1*p_.num_groups_1); scheduler::statement_node const & root = statements.data().front().array()[statements.data().front().root()]; unsigned int current_arg = 0; if (up_to_internal_size_) { kernel.arg(current_arg++, cl_uint(utils::call_on_matrix(root.lhs, utils::internal_size1_fun()))); kernel.arg(current_arg++, cl_uint(utils::call_on_matrix(root.lhs, utils::internal_size2_fun()))); } else { kernel.arg(current_arg++, cl_uint(utils::call_on_matrix(root.lhs, utils::size1_fun()))); kernel.arg(current_arg++, cl_uint(utils::call_on_matrix(root.lhs, utils::size2_fun()))); } set_arguments(statements, kernel, current_arg); kernel.enqueue(); }
int main(int argc, char** argv){ set_arguments(argv, argc); current = load_new(init_heap_size, init_stack_size); forth_start(entry_point); return run(current); }
void DataSource::request_data(QVariant a_args) { set_arguments(a_args); }