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

Function getKernel

src/backend/cuda/jit.cpp:320–347  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

318}
319
320static CUfunction getKernel(const vector<Node*>& output_nodes,
321 const vector<int>& output_ids,
322 const vector<Node*>& full_nodes,
323 const vector<Node_ids>& full_ids,
324 const bool is_linear, const bool loop0,
325 const bool loop1, const bool loop2,
326 const bool loop3) {
327 const string funcName{getFuncName(output_nodes, output_ids, full_nodes,
328 full_ids, is_linear, loop0, loop1, loop2,
329 loop3)};
330 // A forward lookup in module cache helps avoid recompiling
331 // the JIT source generated from identical JIT-trees.
332 const auto entry{
333 findModule(getActiveDeviceId(), deterministicHash(funcName))};
334
335 if (!entry) {
336 const string jitKer{getKernelString(funcName, full_nodes, full_ids,
337 output_ids, is_linear, loop0, loop1,
338 loop2, loop3)};
339 saveKernel(funcName, jitKer, ".cu");
340
341 const common::Source jit_src{jitKer.c_str(), jitKer.size(),
342 deterministicHash(jitKer)};
343
344 return common::getKernel(funcName, {{jit_src}}, {}, {}, true).get();
345 }
346 return common::getKernel(entry, funcName, true).get();
347}
348
349template<typename T>
350void evalNodes(vector<Param<T>>& outputs, const vector<Node*>& output_nodes) {

Callers 15

evalNodesFunction · 0.70
reorderFunction · 0.50
susan_responsesFunction · 0.50
nonMaximalFunction · 0.50
transpose_inplaceFunction · 0.50
triangleFunction · 0.50
bilateralFunction · 0.50
unwrapFunction · 0.50
gradientFunction · 0.50
morphFunction · 0.50
morph3dFunction · 0.50
sobelFunction · 0.50

Calls 7

getFuncNameFunction · 0.85
findModuleFunction · 0.85
deterministicHashFunction · 0.85
saveKernelFunction · 0.85
getActiveDeviceIdFunction · 0.70
getKernelStringFunction · 0.70
getMethod · 0.45

Tested by

no test coverage detected