rsDispatch.cpp revision 394e9a6e1b10229cf0465c50a679dda539c30876
1/*
2 * Copyright (C) 2011-2012 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 *      http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16#define LOG_TAG "libDispatch"
17#include <android/log.h>
18
19#include "rsDispatch.h"
20#include <dlfcn.h>
21#include <limits.h>
22
23#define LOG_API(...)
24#define REDUCE_API_LEVEL INT_MAX
25
26bool loadSymbols(void* handle, dispatchTable& dispatchTab, int device_api) {
27    //fucntion to set the native lib path for 64bit compat lib.
28#ifdef __LP64__
29    dispatchTab.SetNativeLibDir = (SetNativeLibDirFnPtr)dlsym(handle, "rsaContextSetNativeLibDir");
30    if (dispatchTab.SetNativeLibDir == NULL) {
31        LOG_API("Couldn't initialize dispatchTab.SetNativeLibDir");
32        return false;
33    }
34#endif
35    dispatchTab.AllocationGetType = (AllocationGetTypeFnPtr)dlsym(handle, "rsaAllocationGetType");
36    if (dispatchTab.AllocationGetType == NULL) {
37        LOG_API("Couldn't initialize dispatchTab.AllocationGetType");
38        return false;
39    }
40    dispatchTab.TypeGetNativeData = (TypeGetNativeDataFnPtr)dlsym(handle, "rsaTypeGetNativeData");
41    if (dispatchTab.TypeGetNativeData == NULL) {
42        LOG_API("Couldn't initialize dispatchTab.TypeGetNativeData");
43        return false;
44    }
45    dispatchTab.ElementGetNativeData = (ElementGetNativeDataFnPtr)dlsym(handle, "rsaElementGetNativeData");
46    if (dispatchTab.ElementGetNativeData == NULL) {
47        LOG_API("Couldn't initialize dispatchTab.ElementGetNativeData");
48        return false;
49    }
50    dispatchTab.ElementGetSubElements = (ElementGetSubElementsFnPtr)dlsym(handle, "rsaElementGetSubElements");
51    if (dispatchTab.ElementGetSubElements == NULL) {
52        LOG_API("Couldn't initialize dispatchTab.ElementGetSubElements");
53        return false;
54    }
55    dispatchTab.DeviceCreate = (DeviceCreateFnPtr)dlsym(handle, "rsDeviceCreate");
56    if (dispatchTab.DeviceCreate == NULL) {
57        LOG_API("Couldn't initialize dispatchTab.DeviceCreate");
58        return false;
59    }
60    dispatchTab.DeviceDestroy = (DeviceDestroyFnPtr)dlsym(handle, "rsDeviceDestroy");
61    if (dispatchTab.DeviceDestroy == NULL) {
62        LOG_API("Couldn't initialize dispatchTab.DeviceDestroy");
63        return false;
64    }
65    dispatchTab.DeviceSetConfig = (DeviceSetConfigFnPtr)dlsym(handle, "rsDeviceSetConfig");
66    if (dispatchTab.DeviceSetConfig == NULL) {
67        LOG_API("Couldn't initialize dispatchTab.DeviceSetConfig");
68        return false;
69    }
70    dispatchTab.ContextCreate = (ContextCreateFnPtr)dlsym(handle, "rsContextCreate");;
71    if (dispatchTab.ContextCreate == NULL) {
72        LOG_API("Couldn't initialize dispatchTab.ContextCreate");
73        return false;
74    }
75    dispatchTab.GetName = (GetNameFnPtr)dlsym(handle, "rsaGetName");;
76    if (dispatchTab.GetName == NULL) {
77        LOG_API("Couldn't initialize dispatchTab.GetName");
78        return false;
79    }
80    dispatchTab.ContextDestroy = (ContextDestroyFnPtr)dlsym(handle, "rsContextDestroy");
81    if (dispatchTab.ContextDestroy == NULL) {
82        LOG_API("Couldn't initialize dispatchTab.ContextDestroy");
83        return false;
84    }
85    dispatchTab.ContextGetMessage = (ContextGetMessageFnPtr)dlsym(handle, "rsContextGetMessage");
86    if (dispatchTab.ContextGetMessage == NULL) {
87        LOG_API("Couldn't initialize dispatchTab.ContextGetMessage");
88        return false;
89    }
90    dispatchTab.ContextPeekMessage = (ContextPeekMessageFnPtr)dlsym(handle, "rsContextPeekMessage");
91    if (dispatchTab.ContextPeekMessage == NULL) {
92        LOG_API("Couldn't initialize dispatchTab.ContextPeekMessage");
93        return false;
94    }
95    dispatchTab.ContextSendMessage = (ContextSendMessageFnPtr)dlsym(handle, "rsContextSendMessage");
96    if (dispatchTab.ContextSendMessage == NULL) {
97        LOG_API("Couldn't initialize dispatchTab.ContextSendMessage");
98        return false;
99    }
100    dispatchTab.ContextInitToClient = (ContextInitToClientFnPtr)dlsym(handle, "rsContextInitToClient");
101    if (dispatchTab.ContextInitToClient == NULL) {
102        LOG_API("Couldn't initialize dispatchTab.ContextInitToClient");
103        return false;
104    }
105    dispatchTab.ContextDeinitToClient = (ContextDeinitToClientFnPtr)dlsym(handle, "rsContextDeinitToClient");
106    if (dispatchTab.ContextDeinitToClient == NULL) {
107        LOG_API("Couldn't initialize dispatchTab.ContextDeinitToClient");
108        return false;
109    }
110    dispatchTab.TypeCreate = (TypeCreateFnPtr)dlsym(handle, "rsTypeCreate");
111    if (dispatchTab.TypeCreate == NULL) {
112        LOG_API("Couldn't initialize dispatchTab.TypeCreate");
113        return false;
114    }
115    dispatchTab.AllocationCreateTyped = (AllocationCreateTypedFnPtr)dlsym(handle, "rsAllocationCreateTyped");
116    if (dispatchTab.AllocationCreateTyped == NULL) {
117        LOG_API("Couldn't initialize dispatchTab.AllocationCreateTyped");
118        return false;
119    }
120    dispatchTab.AllocationCreateFromBitmap = (AllocationCreateFromBitmapFnPtr)dlsym(handle, "rsAllocationCreateFromBitmap");
121    if (dispatchTab.AllocationCreateFromBitmap == NULL) {
122        LOG_API("Couldn't initialize dispatchTab.AllocationCreateFromBitmap");
123        return false;
124    }
125    dispatchTab.AllocationCubeCreateFromBitmap = (AllocationCubeCreateFromBitmapFnPtr)dlsym(handle, "rsAllocationCubeCreateFromBitmap");
126    if (dispatchTab.AllocationCubeCreateFromBitmap == NULL) {
127        LOG_API("Couldn't initialize dispatchTab.AllocationCubeCreateFromBitmap");
128        return false;
129    }
130    dispatchTab.AllocationGetSurface = (AllocationGetSurfaceFnPtr)dlsym(handle, "rsAllocationGetSurface");
131    if (dispatchTab.AllocationGetSurface == NULL) {
132        LOG_API("Couldn't initialize dispatchTab.AllocationGetSurface");
133        return false;
134    }
135    dispatchTab.AllocationSetSurface = (AllocationSetSurfaceFnPtr)dlsym(handle, "rsAllocationSetSurface");
136    if (dispatchTab.AllocationSetSurface == NULL) {
137        LOG_API("Couldn't initialize dispatchTab.AllocationSetSurface");
138        return false;
139    }
140    dispatchTab.ContextFinish = (ContextFinishFnPtr)dlsym(handle, "rsContextFinish");
141    if (dispatchTab.ContextFinish == NULL) {
142        LOG_API("Couldn't initialize dispatchTab.ContextFinish");
143        return false;
144    }
145    dispatchTab.ContextDump = (ContextDumpFnPtr)dlsym(handle, "rsContextDump");
146    if (dispatchTab.ContextDump == NULL) {
147        LOG_API("Couldn't initialize dispatchTab.ContextDump");
148        return false;
149    }
150    dispatchTab.ContextSetPriority = (ContextSetPriorityFnPtr)dlsym(handle, "rsContextSetPriority");
151    if (dispatchTab.ContextSetPriority == NULL) {
152        LOG_API("Couldn't initialize dispatchTab.ContextSetPriority");
153        return false;
154    }
155    dispatchTab.AssignName = (AssignNameFnPtr)dlsym(handle, "rsAssignName");
156    if (dispatchTab.AssignName == NULL) {
157        LOG_API("Couldn't initialize dispatchTab.AssignName");
158        return false;
159    }
160    dispatchTab.ObjDestroy = (ObjDestroyFnPtr)dlsym(handle, "rsObjDestroy");
161    if (dispatchTab.ObjDestroy == NULL) {
162        LOG_API("Couldn't initialize dispatchTab.ObjDestroy");
163        return false;
164    }
165    dispatchTab.ElementCreate = (ElementCreateFnPtr)dlsym(handle, "rsElementCreate");
166    if (dispatchTab.ElementCreate == NULL) {
167        LOG_API("Couldn't initialize dispatchTab.ElementCreate");
168        return false;
169    }
170    dispatchTab.ElementCreate2 = (ElementCreate2FnPtr)dlsym(handle, "rsElementCreate2");
171    if (dispatchTab.ElementCreate2 == NULL) {
172        LOG_API("Couldn't initialize dispatchTab.ElementCreate2");
173        return false;
174    }
175    dispatchTab.AllocationCopyToBitmap = (AllocationCopyToBitmapFnPtr)dlsym(handle, "rsAllocationCopyToBitmap");
176    if (dispatchTab.AllocationCopyToBitmap == NULL) {
177        LOG_API("Couldn't initialize dispatchTab.AllocationCopyToBitmap");
178        return false;
179    }
180    dispatchTab.Allocation1DData = (Allocation1DDataFnPtr)dlsym(handle, "rsAllocation1DData");
181    if (dispatchTab.Allocation1DData == NULL) {
182        LOG_API("Couldn't initialize dispatchTab.Allocation1DData");
183        return false;
184    }
185    dispatchTab.Allocation1DElementData = (Allocation1DElementDataFnPtr)dlsym(handle, "rsAllocation1DElementData");
186    if (dispatchTab.Allocation1DElementData == NULL) {
187        LOG_API("Couldn't initialize dispatchTab.Allocation1DElementData");
188        return false;
189    }
190    dispatchTab.Allocation2DData = (Allocation2DDataFnPtr)dlsym(handle, "rsAllocation2DData");
191    if (dispatchTab.Allocation2DData == NULL) {
192        LOG_API("Couldn't initialize dispatchTab.Allocation2DData");
193        return false;
194    }
195    dispatchTab.Allocation3DData = (Allocation3DDataFnPtr)dlsym(handle, "rsAllocation3DData");
196    if (dispatchTab.Allocation3DData == NULL) {
197        LOG_API("Couldn't initialize dispatchTab.Allocation3DData");
198        return false;
199    }
200    dispatchTab.AllocationGenerateMipmaps = (AllocationGenerateMipmapsFnPtr)dlsym(handle, "rsAllocationGenerateMipmaps");
201    if (dispatchTab.AllocationGenerateMipmaps == NULL) {
202        LOG_API("Couldn't initialize dispatchTab.AllocationGenerateMipmaps");
203        return false;
204    }
205    dispatchTab.AllocationRead = (AllocationReadFnPtr)dlsym(handle, "rsAllocationRead");
206    if (dispatchTab.AllocationRead == NULL) {
207        LOG_API("Couldn't initialize dispatchTab.AllocationRead");
208        return false;
209    }
210    dispatchTab.Allocation1DRead = (Allocation1DReadFnPtr)dlsym(handle, "rsAllocation1DRead");
211    if (dispatchTab.Allocation1DRead == NULL) {
212        LOG_API("Couldn't initialize dispatchTab.Allocation1DRead");
213        return false;
214    }
215    dispatchTab.Allocation2DRead = (Allocation2DReadFnPtr)dlsym(handle, "rsAllocation2DRead");
216    if (dispatchTab.Allocation2DRead == NULL) {
217        LOG_API("Couldn't initialize dispatchTab.Allocation2DRead");
218        return false;
219    }
220    dispatchTab.AllocationSyncAll = (AllocationSyncAllFnPtr)dlsym(handle, "rsAllocationSyncAll");
221    if (dispatchTab.AllocationSyncAll == NULL) {
222        LOG_API("Couldn't initialize dispatchTab.AllocationSyncAll");
223        return false;
224    }
225    dispatchTab.AllocationResize1D = (AllocationResize1DFnPtr)dlsym(handle, "rsAllocationResize1D");
226    if (dispatchTab.AllocationResize1D == NULL) {
227        LOG_API("Couldn't initialize dispatchTab.AllocationResize1D");
228        return false;
229    }
230    dispatchTab.AllocationCopy2DRange = (AllocationCopy2DRangeFnPtr)dlsym(handle, "rsAllocationCopy2DRange");
231    if (dispatchTab.AllocationCopy2DRange == NULL) {
232        LOG_API("Couldn't initialize dispatchTab.AllocationCopy2DRange");
233        return false;
234    }
235    dispatchTab.AllocationCopy3DRange = (AllocationCopy3DRangeFnPtr)dlsym(handle, "rsAllocationCopy3DRange");
236    if (dispatchTab.AllocationCopy3DRange == NULL) {
237        LOG_API("Couldn't initialize dispatchTab.AllocationCopy3DRange");
238        return false;
239    }
240    dispatchTab.SamplerCreate = (SamplerCreateFnPtr)dlsym(handle, "rsSamplerCreate");
241    if (dispatchTab.SamplerCreate == NULL) {
242        LOG_API("Couldn't initialize dispatchTab.SamplerCreate");
243        return false;
244    }
245    dispatchTab.ScriptBindAllocation = (ScriptBindAllocationFnPtr)dlsym(handle, "rsScriptBindAllocation");
246    if (dispatchTab.ScriptBindAllocation == NULL) {
247        LOG_API("Couldn't initialize dispatchTab.ScriptBindAllocation");
248        return false;
249    }
250    dispatchTab.ScriptSetTimeZone = (ScriptSetTimeZoneFnPtr)dlsym(handle, "rsScriptSetTimeZone");
251    if (dispatchTab.ScriptSetTimeZone == NULL) {
252        LOG_API("Couldn't initialize dispatchTab.ScriptSetTimeZone");
253        return false;
254    }
255    dispatchTab.ScriptInvoke = (ScriptInvokeFnPtr)dlsym(handle, "rsScriptInvoke");
256    if (dispatchTab.ScriptInvoke == NULL) {
257        LOG_API("Couldn't initialize dispatchTab.ScriptInvoke");
258        return false;
259    }
260    dispatchTab.ScriptInvokeV = (ScriptInvokeVFnPtr)dlsym(handle, "rsScriptInvokeV");
261    if (dispatchTab.ScriptInvokeV == NULL) {
262        LOG_API("Couldn't initialize dispatchTab.ScriptInvokeV");
263        return false;
264    }
265    dispatchTab.ScriptForEach = (ScriptForEachFnPtr)dlsym(handle, "rsScriptForEach");
266    if (dispatchTab.ScriptForEach == NULL) {
267        LOG_API("Couldn't initialize dispatchTab.ScriptForEach");
268        return false;
269    }
270    dispatchTab.ScriptSetVarI = (ScriptSetVarIFnPtr)dlsym(handle, "rsScriptSetVarI");
271    if (dispatchTab.ScriptSetVarI == NULL) {
272        LOG_API("Couldn't initialize dispatchTab.ScriptSetVarI");
273        return false;
274    }
275    dispatchTab.ScriptSetVarObj = (ScriptSetVarObjFnPtr)dlsym(handle, "rsScriptSetVarObj");
276    if (dispatchTab.ScriptSetVarObj == NULL) {
277        LOG_API("Couldn't initialize dispatchTab.ScriptSetVarObj");
278        return false;
279    }
280    dispatchTab.ScriptSetVarJ = (ScriptSetVarJFnPtr)dlsym(handle, "rsScriptSetVarJ");
281    if (dispatchTab.ScriptSetVarJ == NULL) {
282        LOG_API("Couldn't initialize dispatchTab.ScriptSetVarJ");
283        return false;
284    }
285    dispatchTab.ScriptSetVarF = (ScriptSetVarFFnPtr)dlsym(handle, "rsScriptSetVarF");
286    if (dispatchTab.ScriptSetVarF == NULL) {
287        LOG_API("Couldn't initialize dispatchTab.ScriptSetVarF");
288        return false;
289    }
290    dispatchTab.ScriptSetVarD = (ScriptSetVarDFnPtr)dlsym(handle, "rsScriptSetVarD");
291    if (dispatchTab.ScriptSetVarD == NULL) {
292        LOG_API("Couldn't initialize dispatchTab.ScriptSetVarD");
293        return false;
294    }
295    dispatchTab.ScriptSetVarV = (ScriptSetVarVFnPtr)dlsym(handle, "rsScriptSetVarV");
296    if (dispatchTab.ScriptSetVarV == NULL) {
297        LOG_API("Couldn't initialize dispatchTab.ScriptSetVarV");
298        return false;
299    }
300    dispatchTab.ScriptGetVarV = (ScriptGetVarVFnPtr)dlsym(handle, "rsScriptGetVarV");
301    if (dispatchTab.ScriptGetVarV == NULL) {
302        LOG_API("Couldn't initialize dispatchTab.ScriptGetVarV");
303        return false;
304    }
305    dispatchTab.ScriptSetVarVE = (ScriptSetVarVEFnPtr)dlsym(handle, "rsScriptSetVarVE");
306    if (dispatchTab.ScriptSetVarVE == NULL) {
307        LOG_API("Couldn't initialize dispatchTab.ScriptSetVarVE");
308        return false;
309    }
310    dispatchTab.ScriptCCreate = (ScriptCCreateFnPtr)dlsym(handle, "rsScriptCCreate");
311    if (dispatchTab.ScriptCCreate == NULL) {
312        LOG_API("Couldn't initialize dispatchTab.ScriptCCreate");
313        return false;
314    }
315    dispatchTab.ScriptIntrinsicCreate = (ScriptIntrinsicCreateFnPtr)dlsym(handle, "rsScriptIntrinsicCreate");
316    if (dispatchTab.ScriptIntrinsicCreate == NULL) {
317        LOG_API("Couldn't initialize dispatchTab.ScriptIntrinsicCreate");
318        return false;
319    }
320    dispatchTab.ScriptKernelIDCreate = (ScriptKernelIDCreateFnPtr)dlsym(handle, "rsScriptKernelIDCreate");
321    if (dispatchTab.ScriptKernelIDCreate == NULL) {
322        LOG_API("Couldn't initialize dispatchTab.ScriptKernelIDCreate");
323        return false;
324    }
325    dispatchTab.ScriptFieldIDCreate = (ScriptFieldIDCreateFnPtr)dlsym(handle, "rsScriptFieldIDCreate");
326    if (dispatchTab.ScriptFieldIDCreate == NULL) {
327        LOG_API("Couldn't initialize dispatchTab.ScriptFieldIDCreate");
328        return false;
329    }
330    dispatchTab.ScriptGroupCreate = (ScriptGroupCreateFnPtr)dlsym(handle, "rsScriptGroupCreate");
331    if (dispatchTab.ScriptGroupCreate == NULL) {
332        LOG_API("Couldn't initialize dispatchTab.ScriptGroupCreate");
333        return false;
334    }
335    dispatchTab.ScriptGroupSetOutput = (ScriptGroupSetOutputFnPtr)dlsym(handle, "rsScriptGroupSetOutput");
336    if (dispatchTab.ScriptGroupSetOutput == NULL) {
337        LOG_API("Couldn't initialize dispatchTab.ScriptGroupSetOutput");
338        return false;
339    }
340    dispatchTab.ScriptGroupSetInput = (ScriptGroupSetInputFnPtr)dlsym(handle, "rsScriptGroupSetInput");
341    if (dispatchTab.ScriptGroupSetInput == NULL) {
342        LOG_API("Couldn't initialize dispatchTab.ScriptGroupSetInput");
343        return false;
344    }
345    dispatchTab.ScriptGroupExecute = (ScriptGroupExecuteFnPtr)dlsym(handle, "rsScriptGroupExecute");
346    if (dispatchTab.ScriptGroupExecute == NULL) {
347        LOG_API("Couldn't initialize dispatchTab.ScriptGroupExecute");
348        return false;
349    }
350    dispatchTab.AllocationIoSend = (AllocationIoSendFnPtr)dlsym(handle, "rsAllocationIoSend");
351    if (dispatchTab.AllocationIoSend == NULL) {
352        LOG_API("Couldn't initialize dispatchTab.AllocationIoSend");
353        return false;
354    }
355    dispatchTab.AllocationIoReceive = (AllocationIoReceiveFnPtr)dlsym(handle, "rsAllocationIoReceive");
356    if (dispatchTab.AllocationIoReceive == NULL) {
357        LOG_API("Couldn't initialize dispatchTab.AllocationIoReceive");
358        return false;
359    }
360    // API_21 functions
361    if (device_api >= 21) {
362        dispatchTab.AllocationGetPointer = (AllocationGetPointerFnPtr)dlsym(handle, "rsAllocationGetPointer");
363        if (dispatchTab.AllocationGetPointer == NULL) {
364            LOG_API("Couldn't initialize dispatchTab.AllocationGetPointer");
365            return false;
366        }
367    }
368    // API_23 functions
369    if (device_api >= 23) {
370        //ScriptGroup V2 functions
371        dispatchTab.ScriptInvokeIDCreate = (ScriptInvokeIDCreateFnPtr)dlsym(handle, "rsScriptInvokeIDCreate");
372        if (dispatchTab.ScriptInvokeIDCreate == NULL) {
373            LOG_API("Couldn't initialize dispatchTab.ScriptInvokeIDCreate");
374            return false;
375        }
376        dispatchTab.ClosureCreate = (ClosureCreateFnPtr)dlsym(handle, "rsClosureCreate");
377        if (dispatchTab.ClosureCreate == NULL) {
378            LOG_API("Couldn't initialize dispatchTab.ClosureCreate");
379            return false;
380        }
381        dispatchTab.InvokeClosureCreate = (InvokeClosureCreateFnPtr)dlsym(handle, "rsInvokeClosureCreate");
382        if (dispatchTab.InvokeClosureCreate == NULL) {
383            LOG_API("Couldn't initialize dispatchTab.InvokeClosureCreate");
384            return false;
385        }
386        dispatchTab.ClosureSetArg = (ClosureSetArgFnPtr)dlsym(handle, "rsClosureSetArg");
387        if (dispatchTab.ClosureSetArg == NULL) {
388            LOG_API("Couldn't initialize dispatchTab.ClosureSetArg");
389            return false;
390        }
391        dispatchTab.ClosureSetGlobal = (ClosureSetGlobalFnPtr)dlsym(handle, "rsClosureSetGlobal");
392        if (dispatchTab.ClosureSetGlobal == NULL) {
393            LOG_API("Couldn't initialize dispatchTab.ClosureSetGlobal");
394            return false;
395        }
396        dispatchTab.ScriptGroup2Create = (ScriptGroup2CreateFnPtr)dlsym(handle, "rsScriptGroup2Create");
397        if (dispatchTab.ScriptGroup2Create == NULL) {
398            LOG_API("Couldn't initialize dispatchTab.ScriptGroup2Create");
399            return false;
400        }
401        dispatchTab.AllocationElementData = (AllocationElementDataFnPtr)dlsym(handle, "rsAllocationElementData");
402        if (dispatchTab.AllocationElementData == NULL) {
403            LOG_API("Couldn't initialize dispatchTab.AllocationElementData");
404            return false;
405        }
406        dispatchTab.AllocationElementRead = (AllocationElementReadFnPtr)dlsym(handle, "rsAllocationElementRead");
407        if (dispatchTab.AllocationElementRead == NULL) {
408            LOG_API("Couldn't initialize dispatchTab.AllocationElementRead");
409            return false;
410        }
411        dispatchTab.Allocation3DRead = (Allocation3DReadFnPtr)dlsym(handle, "rsAllocation3DRead");
412        if (dispatchTab.Allocation3DRead == NULL) {
413            LOG_API("Couldn't initialize dispatchTab.Allocation3DRead");
414            return false;
415        }
416        dispatchTab.ScriptForEachMulti = (ScriptForEachMultiFnPtr)dlsym(handle, "rsScriptForEachMulti");
417        if (dispatchTab.ScriptForEachMulti == NULL) {
418            LOG_API("Couldn't initialize dispatchTab.ScriptForEachMulti");
419            return false;
420        }
421    }
422    // TODO: Update the API level when reduce is added.
423    if (device_api >= REDUCE_API_LEVEL) {
424        dispatchTab.ScriptReduce = (ScriptReduceFnPtr)dlsym(handle, "rsScriptReduce");
425        if (dispatchTab.ScriptReduce == nullptr) {
426            LOG_API("Couldn't initialize dispatchTab.ScriptReduce");
427            return false;
428        }
429    }
430
431    return true;
432
433}
434
435
436bool loadIOSuppSyms(void* handleIO, ioSuppDT& ioDispatch){
437    ioDispatch.sAllocationSetSurface = (sAllocationSetSurfaceFnPtr)dlsym(handleIO, "AllocationSetSurface");
438    if (ioDispatch.sAllocationSetSurface == NULL) {
439        LOG_API("Couldn't initialize ioDispatch.sAllocationSetSurface");
440        return false;
441    }
442    return true;
443}
444