28 #ifndef SPLA_CL_FILL_HPP
29 #define SPLA_CL_FILL_HPP
41 .
add_type(
"TYPE", get_ttype<T>().
template as<Type>())
46 auto* acc = get_acc_cl();
48 uint block_size = acc->get_default_wgs();
51 cl::NDRange global(block_size * n_groups_to_dispatch);
52 cl::NDRange local(block_size);
54 fill_zero.setArg(0, values);
55 fill_zero.setArg(1, n);
56 queue.enqueueNDRangeKernel(fill_zero, cl::NDRange(), global, local);
63 .
add_type(
"TYPE", get_ttype<T>().
template as<Type>())
67 auto fill_value = builder.
make_kernel(
"fill_value");
68 auto* acc = get_acc_cl();
70 uint block_size = acc->get_default_wgs();
73 cl::NDRange global(block_size * n_groups_to_dispatch);
74 cl::NDRange local(block_size);
76 fill_value.setArg(0, values);
77 fill_value.setArg(1, n);
78 fill_value.setArg(2, value);
79 queue.enqueueNDRangeKernel(fill_value, cl::NDRange(), global, local);
Runtime opencl program builder.
Definition: cl_program_builder.hpp:55
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
std::uint32_t uint
Library index and size type.
Definition: config.hpp:56
Definition: algorithm.hpp:37
void cl_fill_value(cl::CommandQueue &queue, const cl::Buffer &values, uint n, T value)
Definition: cl_fill.hpp:60
void cl_fill_zero(cl::CommandQueue &queue, cl::Buffer &values, uint n)
Definition: cl_fill.hpp:38
T min(T a, T b)
Definition: op.cpp:152
T max(T a, T b)
Definition: op.cpp:155