MCPcopy Create free account
hub / github.com/clMathLibraries/clBLAS / putKernel

Function putKernel

src/library/common/kern_cache.c:206–235  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

204}
205
206void
207putKernel(struct KernelCache *kcache, Kernel *kern)
208{
209 KernelNode *knode;
210 unsigned long refcnt;
211
212 if (kern == NULL) {
213 return;
214 }
215
216 knode = container_of(kern, kern, KernelNode);
217 assert(knode->magic == KNODE_MAGIC);
218
219 if (kcache) {
220 KCACHE_LOCK(kcache);
221 }
222 refcnt = --knode->refcnt;
223 if (kcache) {
224 KCACHE_UNLOCK(kcache);
225 }
226
227 if (!refcnt) {
228 if (kern->dtor) {
229 kern->dtor(kern);
230 }
231 clReleaseProgram(kern->program);
232 clReleaseContext(knode->key.context);
233 free(knode);
234 }
235}
236
237struct KernelCache
238*createKernelCache(

Callers 6

destroyKernelsFunction · 0.85
makeSolutionSeqFunction · 0.85
freeSolutionStepFunction · 0.85
loadKernelFunction · 0.85
makeKernelFunction · 0.85
putRemovedKernelsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected