MCPcopy Create free account
hub / github.com/arrayfire/arrayfire / diagCreate

Function diagCreate

src/backend/opencl/kernel/diagonal.hpp:30–51  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

28
29template<typename T>
30static void diagCreate(Param out, Param in, int num) {
31 std::array<TemplateArg, 1> targs = {
32 TemplateTypename<T>(),
33 };
34 std::array<std::string, 3> options = {
35 DefineKeyValue(T, dtype_traits<T>::getName()),
36 DefineKeyValue(ZERO, scalar_to_option(scalar<T>(0))),
37 getTypeBuildDefinition<T>()};
38
39 auto diagCreate = common::getKernel("diagCreateKernel",
40 {{diag_create_cl_src}}, targs, options);
41
42 cl::NDRange local(32, 8);
43 int groups_x = divup(out.info.dims[0], local[0]);
44 int groups_y = divup(out.info.dims[1], local[1]);
45 cl::NDRange global(groups_x * local[0] * out.info.dims[2],
46 groups_y * local[1]);
47
48 diagCreate(cl::EnqueueArgs(getQueue(), global, local), *(out.data),
49 out.info, *(in.data), in.info, num, groups_x);
50 CL_DEBUG_FINISH(getQueue());
51}
52
53template<typename T>
54static void diagExtract(Param out, Param in, int num) {

Callers

nothing calls this directly

Calls 5

getNameFunction · 0.85
EnqueueArgsClass · 0.85
scalar_to_optionFunction · 0.50
getKernelFunction · 0.50
getQueueFunction · 0.50

Tested by

no test coverage detected