Skip to content

Commit c2455b4

Browse files
Move Wddm::init template method to inl file
Change-Id: Ic49242c25c8e553a74ada61533b7db31bead7d7d
1 parent 95e200d commit c2455b4

File tree

2 files changed

+39
-36
lines changed

2 files changed

+39
-36
lines changed

runtime/os_interface/windows/wddm.h

Lines changed: 1 addition & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -111,42 +111,7 @@ class Wddm {
111111
bool configureDeviceAddressSpace();
112112

113113
template <typename GfxFamily>
114-
bool init() {
115-
bool success = false;
116-
if (gdi != nullptr && gdi->isInitialized() && !initialized) {
117-
do {
118-
success = openAdapter();
119-
if (!success)
120-
break;
121-
success = queryAdapterInfo();
122-
if (!success)
123-
break;
124-
success = createDevice();
125-
if (!success)
126-
break;
127-
success = createPagingQueue();
128-
if (!success)
129-
break;
130-
success = Gmm::initContext(gfxPlatform.get(),
131-
featureTable.get(),
132-
waTable.get(),
133-
gtSystemInfo.get());
134-
if (!success)
135-
break;
136-
success = configureDeviceAddressSpace<GfxFamily>();
137-
if (!success)
138-
break;
139-
context = createContext();
140-
if (context == static_cast<D3DKMT_HANDLE>(0))
141-
break;
142-
success = createMonitoredFence();
143-
if (!success)
144-
break;
145-
initialized = true;
146-
} while (!success);
147-
}
148-
return initialized;
149-
}
114+
bool init();
150115

151116
bool isInitialized() const {
152117
return initialized;

runtime/os_interface/windows/wddm.inl

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,4 +36,42 @@ bool Wddm::configureDeviceAddressSpace() {
3636
maximumApplicationAddress + 1u,
3737
0, 0, featureTable->ftrL3IACoherency, 0, 0);
3838
}
39+
40+
template <typename GfxFamily>
41+
bool Wddm::init() {
42+
bool success = false;
43+
if (gdi != nullptr && gdi->isInitialized() && !initialized) {
44+
do {
45+
success = openAdapter();
46+
if (!success)
47+
break;
48+
success = queryAdapterInfo();
49+
if (!success)
50+
break;
51+
success = createDevice();
52+
if (!success)
53+
break;
54+
success = createPagingQueue();
55+
if (!success)
56+
break;
57+
success = Gmm::initContext(gfxPlatform.get(),
58+
featureTable.get(),
59+
waTable.get(),
60+
gtSystemInfo.get());
61+
if (!success)
62+
break;
63+
success = configureDeviceAddressSpace<GfxFamily>();
64+
if (!success)
65+
break;
66+
context = createContext();
67+
if (context == static_cast<D3DKMT_HANDLE>(0))
68+
break;
69+
success = createMonitoredFence();
70+
if (!success)
71+
break;
72+
initialized = true;
73+
} while (!success);
74+
}
75+
return initialized;
76+
}
3977
} // namespace OCLRT

0 commit comments

Comments
 (0)