28 #ifndef SPLA_CL_MAP_HPP
29 #define SPLA_CL_MAP_HPP
41 auto* acc = get_acc_cl();
47 .
add_type(
"TYPE", get_ttype<T>().
template as<Type>())
48 .
add_op(
"OP_UNARY", op.template as<OpUnary>())
52 kernel.setArg(0, dest);
53 kernel.setArg(1, source);
56 cl::NDRange global(align(n, acc->get_default_wgs()));
57 cl::NDRange local(acc->get_default_wgs());
58 queue.enqueueNDRangeKernel(kernel, cl::NullRange, global, local);
Runtime opencl program builder.
Definition: cl_program_builder.hpp:55
CLProgramBuilder & add_op(const char *name, const ref_ptr< OpUnary > &op)
Definition: cl_program_builder.cpp:49
CLProgramBuilder & set_name(const char *name)
Definition: cl_program_builder.cpp:37
CLProgramBuilder & add_type(const char *alias, const ref_ptr< Type > &type)
Definition: cl_program_builder.cpp:45
cl::Kernel make_kernel(const char *name)
Definition: cl_program_builder.hpp:67
CLProgramBuilder & set_source(const char *source)
Definition: cl_program_builder.cpp:61
void acquire()
Definition: cl_program_builder.cpp:65
Automates reference counting and behaves as shared smart pointer.
Definition: ref.hpp:117
std::uint32_t uint
Library index and size type.
Definition: config.hpp:56
Definition: algorithm.hpp:37
void cl_map(cl::CommandQueue &queue, const cl::Buffer &source, cl::Buffer &dest, uint n, const ref_ptr< TOpUnary< T, T >> &op)
Definition: cl_map.hpp:38