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

Function removeKernels

src/library/common/kern_cache.c:135–159  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

133}
134
135static void
136removeKernels(ListHead *truncList, struct KernelCache *kcache, size_t truncSize)
137{
138 size_t remSize = 0;
139 size_t ksize;
140 ListNode *l;
141 KernelNode *knode;
142
143 listInitHead(truncList);
144
145 while (remSize < truncSize) {
146 l = listNodeLast(&kcache->lruKern);
147 if (l == &kcache->lruKern) {
148 break;
149 }
150
151 knode = container_of(l, lruNode, KernelNode);
152 listDel(l);
153 listDel(&knode->dimNode);
154 listAddToTail(truncList, &knode->lruNode);
155 ksize = fullKernelSize(&knode->kern);
156 remSize += ksize;
157 kcache->totalSize -= ksize;
158 }
159}
160
161static void
162putRemovedKernels(struct KernelCache *kcache, ListHead *truncList)

Callers 2

addKernelToCacheFunction · 0.85
cleanKernelCacheFunction · 0.85

Calls 5

listInitHeadFunction · 0.85
listNodeLastFunction · 0.85
listDelFunction · 0.85
listAddToTailFunction · 0.85
fullKernelSizeFunction · 0.85

Tested by

no test coverage detected