Skip to content

Commit 2e35ae7

Browse files
authored
Move khrIcdInitializeTrace call to platform initialization so it is only called once. (#180)
1 parent 7072cf2 commit 2e35ae7

4 files changed

Lines changed: 5 additions & 1 deletion

File tree

loader/icd.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,6 @@ void khrIcdInitializeTrace(void)
4848
// entrypoint to initialize the ICD and add all vendors
4949
void khrIcdInitialize(void)
5050
{
51-
khrIcdInitializeTrace();
5251
// enumerate vendors present on the system
5352
khrIcdOsVendorsEnumerateOnce();
5453
}

loader/icd.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,9 @@ extern struct _cl_icd_dispatch khrMasterDispatch;
126126
// API (e.g, getPlatformIDs, etc).
127127
void khrIcdInitialize(void);
128128

129+
// entrypoint to check and initialize trace.
130+
void khrIcdInitializeTrace(void);
131+
129132
// go through the list of vendors (in /etc/OpenCL.conf or through
130133
// the registry) and call khrIcdVendorAdd for each vendor encountered
131134
// n.b, this call is OS-specific

loader/linux/icd_linux.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ void khrIcdOsVendorsEnumerate(void)
4444
const char* vendorPath = ICD_VENDOR_PATH;
4545
char* envPath = NULL;
4646

47+
khrIcdInitializeTrace();
4748
khrIcdVendorsEnumerateEnv();
4849

4950
envPath = khrIcd_secure_getenv("OCL_ICD_VENDORS");

loader/windows/icd_windows.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,7 @@ BOOL CALLBACK khrIcdOsVendorsEnumerate(PINIT_ONCE InitOnce, PVOID Parameter, PVO
113113
HKEY platformsKey = NULL;
114114
DWORD dwIndex;
115115

116+
khrIcdInitializeTrace();
116117
khrIcdVendorsEnumerateEnv();
117118

118119
currentStatus = khrIcdOsVendorsEnumerateDXGK();

0 commit comments

Comments
 (0)