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

Function diagExtract

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

Source from the content-addressed store, hash-verified

52
53template<typename T>
54static void diagExtract(Param out, Param in, int num) {
55 std::array<TemplateArg, 1> targs = {
56 TemplateTypename<T>(),
57 };
58 std::array<std::string, 3> options = {
59 DefineKeyValue(T, dtype_traits<T>::getName()),
60 DefineKeyValue(ZERO, scalar_to_option(scalar<T>(0))),
61 getTypeBuildDefinition<T>()};
62
63 auto diagExtract = common::getKernel(
64 "diagExtractKernel", {{diag_extract_cl_src}}, targs, options);
65
66 cl::NDRange local(256, 1);
67 int groups_x = divup(out.info.dims[0], local[0]);
68 int groups_z = out.info.dims[2];
69 cl::NDRange global(groups_x * local[0],
70 groups_z * local[1] * out.info.dims[3]);
71
72 diagExtract(cl::EnqueueArgs(getQueue(), global, local), *(out.data),
73 out.info, *(in.data), in.info, num, groups_z);
74 CL_DEBUG_FINISH(getQueue());
75}
76
77} // namespace kernel
78} // namespace opencl

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