Package com.jogamp.opencl.llb.impl

Examples of com.jogamp.opencl.llb.impl.CLProcAddressTable


            }
        }

        try {

            final CLProcAddressTable table = new CLProcAddressTable(new FunctionAddressResolver() {
                @Override
                public long resolve(String name, DynamicLookupHelper lookup) {

                    if(name.endsWith("KHR") || name.endsWith("EXT")) {
                        long address = ((CLImpl) cl).clGetExtensionFunctionAddress(name);
                        if(address != 0) {
                            return address;
                        }
                    }

                    return lookup.dynamicLookupFunction(name);
                }
            });

            cl = new CLImpl(table);

            //load JOCL and init table
            doPrivileged(new PrivilegedAction<Object>() {
                @Override
                public Object run() {

                    NativeLibrary libOpenCL = JOCLJNILibLoader.loadOpenCL();
                    if(libOpenCL == null) {
                        throw new JogampRuntimeException("OpenCL library not found.");
                    }

                    //eagerly init function to query extension addresses (used in reset())
                    table.initEntry("clGetExtensionFunctionAddress", libOpenCL);
                    table.reset(libOpenCL);
                    return null;
                }
            });

//            System.out.println("\n"+table);
View Full Code Here

TOP

Related Classes of com.jogamp.opencl.llb.impl.CLProcAddressTable

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.