Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add build option for clGetExtensionFunctionAddress behavior #11

Open
bashbaug opened this issue Aug 17, 2020 · 0 comments
Open

add build option for clGetExtensionFunctionAddress behavior #11

bashbaug opened this issue Aug 17, 2020 · 0 comments

Comments

@bashbaug
Copy link
Owner

clGetExtensionFunctionAddress has been deprecated but it still can be useful in some cases and some applications rely on it. The OpenCL runtime loader should optionally support it by dynamically loading the real OpenCL ICD loader similar to clGetPlatformIDs even if the default is to return NULL to encourage use of clGetExtensionFunctionAddressForPlatform instead.

This behavior is currently hard coded with an ifdef:

CL_API_ENTRY void* CL_API_CALL clGetExtensionFunctionAddress(
    const char* function_name)
{
#if 0
    static _sclModuleHandle module = _sclOpenICDLoader();
    _sclpfn_clGetExtensionFunctionAddress _clGetExtensionFunctionAddress =
        (_sclpfn_clGetExtensionFunctionAddress)::GetProcAddress(
            module, "clGetExtensionFunctionAddress");
    if (_clGetExtensionFunctionAddress) {
        return _clGetExtensionFunctionAddress(function_name);
    }
#endif
    return NULL;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant