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

Function errorCacheTestCase

src/library/common/tests/t_gens_cache.c:157–203  ·  view source on GitHub ↗

test case for kache error functionality

Source from the content-addressed store, hash-verified

155
156// test case for kache error functionality
157static int
158errorCacheTestCase(
159 const char *msg,
160 struct KernelCache *kcache,
161 solver_id_t sid,
162 SubproblemDim *dims,
163 unsigned int nrDims,
164 cl_context context,
165 cl_device_id device,
166 unsigned long extra,
167 Kernel *kern)
168{
169 KernelKey key;
170 Kernel* krn1;
171 int r;
172 bool fail;
173
174 key.device = device;
175 key.context = context;
176 key.nrDims = nrDims;
177 memset(key.subdims, 0, sizeof(key.subdims));
178 r = nrDims;
179 if (nrDims > MAX_SUBDIMS)
180 r = MAX_SUBDIMS;
181 memcpy(key.subdims, dims, sizeof(SubproblemDim) * r);
182
183 printf("%s", msg);
184 if (kern == NULL) {
185 krn1 = findKernel(kcache, sid, &key, &extra);
186 fail = (krn1 != NULL);
187 }
188 else {
189 r = addKernelToCache(kcache, sid, kern, &key, kernExtraCmp);
190 fail = (r == 0);
191 }
192
193 if (fail) {
194 printf("FAIL\n");
195 r = -1;
196 }
197 else {
198 printf("PASS\n");
199 r = 0;
200 }
201
202 return r;
203}
204
205static int
206testCache(cl_context context, cl_device_id device)

Callers 1

testCacheFunction · 0.85

Calls 2

findKernelFunction · 0.85
addKernelToCacheFunction · 0.85

Tested by

no test coverage detected