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

Function iota

src/backend/opencl/kernel/iota.hpp:29–53  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

27
28template<typename T>
29void iota(Param out, const af::dim4& sdims) {
30 constexpr int IOTA_TX = 32;
31 constexpr int IOTA_TY = 8;
32 constexpr int TILEX = 512;
33 constexpr int TILEY = 32;
34
35 std::array<std::string, 2> options = {
36 DefineKeyValue(T, dtype_traits<T>::getName()),
37 getTypeBuildDefinition<T>()};
38
39 auto iota = common::getKernel("iota_kernel", {{iota_cl_src}},
40 TemplateArgs(TemplateTypename<T>()), options);
41 cl::NDRange local(IOTA_TX, IOTA_TY, 1);
42
43 int blocksPerMatX = divup(out.info.dims[0], TILEX);
44 int blocksPerMatY = divup(out.info.dims[1], TILEY);
45 cl::NDRange global(local[0] * blocksPerMatX * out.info.dims[2],
46 local[1] * blocksPerMatY * out.info.dims[3], 1);
47
48 iota(cl::EnqueueArgs(getQueue(), global, local), *out.data, out.info,
49 static_cast<int>(sdims[0]), static_cast<int>(sdims[1]),
50 static_cast<int>(sdims[2]), static_cast<int>(sdims[3]), blocksPerMatX,
51 blocksPerMatY);
52 CL_DEBUG_FINISH(getQueue());
53}
54} // namespace kernel
55} // namespace opencl
56} // namespace arrayfire

Callers 2

siftFunction · 0.70
convertPivotFunction · 0.50

Calls 5

getNameFunction · 0.85
TemplateArgsFunction · 0.85
EnqueueArgsClass · 0.85
getKernelFunction · 0.50
getQueueFunction · 0.50

Tested by

no test coverage detected