-
Notifications
You must be signed in to change notification settings - Fork 164
initial ICD loader environment variable support #77
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
Changes from all commits
6c85cd8
167dd91
5012c89
663c28e
399f19e
ed3e2a6
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -115,4 +115,13 @@ Please create a GitHub issue to report an issue or ask questions. | |
| ## Contributing | ||
|
|
||
| Contributions to the OpenCL ICD Loader are welcomed and encouraged. | ||
| You will be prompted with a one-time "click-through" CLA dialog as part of submitting your pull request or other contribution to GitHub. | ||
| You will be prompted with a one-time "click-through" CLA dialog as part of submitting your pull request or other contribution to GitHub. | ||
|
|
||
| ## Table of Debug Environment Variables | ||
|
|
||
| The following debug environment variables are available for use with the OpenCL ICD loader: | ||
|
|
||
| | Environment Variable | Behavior | Example Format | | ||
| |:---------------------------------:|---------------------|----------------------| | ||
| | OCL_ICD_FILENAMES | Specifies a list of additional ICDs to load. The ICDs will be enumerated first, before any ICDs discovered via default mechanisms. | `export OCL_ICD_FILENAMES=libVendorA.so:libVendorB.so`<br/><br/>`set OCL_ICD_FILENAMES=vendor_a.dll;vendor_b.dll` | | ||
kepatil marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| | OCL_ICD_VENDORS | On Linux and Android, specifies a directory to scan for ICDs to enumerate in place of the default `/etc/OpenCL/vendors'. | `export OCL_ICD_VENDORS=/my/local/icd/search/path` | | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If we allow paths in OCL_ICD_ENTRIES as suggested above, I think this is not needed anymore?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. No, I think we should support both options as they have different uses:
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| #cmakedefine HAVE_SECURE_GETENV | ||
| #cmakedefine HAVE___SECURE_GETENV |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,26 @@ | ||
| /* | ||
| * Copyright (c) 2016-2019 The Khronos Group Inc. | ||
| * | ||
| * Licensed under the Apache License, Version 2.0 (the "License"); | ||
| * you may not use this file except in compliance with the License. | ||
| * You may obtain a copy of the License at | ||
| * | ||
| * http://www.apache.org/licenses/LICENSE-2.0 | ||
| * | ||
| * Unless required by applicable law or agreed to in writing, software | ||
| * distributed under the License is distributed on an "AS IS" BASIS, | ||
| * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| * See the License for the specific language governing permissions and | ||
| * limitations under the License. | ||
| * | ||
| * OpenCL is a trademark of Apple Inc. used under license by Khronos. | ||
| */ | ||
|
|
||
| #ifndef _ICD_ENVVARS_H_ | ||
| #define _ICD_ENVVARS_H_ | ||
|
|
||
| char *khrIcd_getenv(const char *name); | ||
| char *khrIcd_secure_getenv(const char *name); | ||
| void khrIcd_free_getenv(char *val); | ||
|
|
||
| #endif |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,39 @@ | ||
| /* | ||
| * Copyright (c) 2016-2019 The Khronos Group Inc. | ||
| * | ||
| * Licensed under the Apache License, Version 2.0 (the "License"); | ||
| * you may not use this file except in compliance with the License. | ||
| * You may obtain a copy of the License at | ||
| * | ||
| * http://www.apache.org/licenses/LICENSE-2.0 | ||
| * | ||
| * Unless required by applicable law or agreed to in writing, software | ||
| * distributed under the License is distributed on an "AS IS" BASIS, | ||
| * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| * See the License for the specific language governing permissions and | ||
| * limitations under the License. | ||
| * | ||
| * OpenCL is a trademark of Apple Inc. used under license by Khronos. | ||
| */ | ||
|
|
||
| #ifndef _ICD_PLATFORM_H_ | ||
| #define _ICD_PLATFORM_H_ | ||
|
|
||
| #if defined(__linux__) || defined(__APPLE__) | ||
|
|
||
| #define PATH_SEPARATOR ':' | ||
| #define DIRECTORY_SYMBOL '/' | ||
| #ifdef __ANDROID__ | ||
| #define ICD_VENDOR_PATH "/system/vendor/Khronos/OpenCL/vendors/"; | ||
| #else | ||
| #define ICD_VENDOR_PATH "/etc/OpenCL/vendors/"; | ||
| #endif // ANDROID | ||
|
|
||
| #elif defined(_WIN32) | ||
|
|
||
| #define PATH_SEPARATOR ';' | ||
| #define DIRECTORY_SYMBOL '\\' | ||
|
|
||
| #endif | ||
|
|
||
| #endif |
Uh oh!
There was an error while loading. Please reload this page.