Skip to content

Commit

Permalink
Move Wddm::init template method to inl file
Browse files Browse the repository at this point in the history
Change-Id: Ic49242c25c8e553a74ada61533b7db31bead7d7d
  • Loading branch information
BartoszDunajski authored and Compute-Runtime-Automation committed Apr 27, 2018
1 parent 95e200d commit c2455b4
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 36 deletions.
37 changes: 1 addition & 36 deletions runtime/os_interface/windows/wddm.h
Original file line number Diff line number Diff line change
Expand Up @@ -111,42 +111,7 @@ class Wddm {
bool configureDeviceAddressSpace();

template <typename GfxFamily>
bool init() {
bool success = false;
if (gdi != nullptr && gdi->isInitialized() && !initialized) {
do {
success = openAdapter();
if (!success)
break;
success = queryAdapterInfo();
if (!success)
break;
success = createDevice();
if (!success)
break;
success = createPagingQueue();
if (!success)
break;
success = Gmm::initContext(gfxPlatform.get(),
featureTable.get(),
waTable.get(),
gtSystemInfo.get());
if (!success)
break;
success = configureDeviceAddressSpace<GfxFamily>();
if (!success)
break;
context = createContext();
if (context == static_cast<D3DKMT_HANDLE>(0))
break;
success = createMonitoredFence();
if (!success)
break;
initialized = true;
} while (!success);
}
return initialized;
}
bool init();

bool isInitialized() const {
return initialized;
Expand Down
38 changes: 38 additions & 0 deletions runtime/os_interface/windows/wddm.inl
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,42 @@ bool Wddm::configureDeviceAddressSpace() {
maximumApplicationAddress + 1u,
0, 0, featureTable->ftrL3IACoherency, 0, 0);
}

template <typename GfxFamily>
bool Wddm::init() {
bool success = false;
if (gdi != nullptr && gdi->isInitialized() && !initialized) {
do {
success = openAdapter();
if (!success)
break;
success = queryAdapterInfo();
if (!success)
break;
success = createDevice();
if (!success)
break;
success = createPagingQueue();
if (!success)
break;
success = Gmm::initContext(gfxPlatform.get(),
featureTable.get(),
waTable.get(),
gtSystemInfo.get());
if (!success)
break;
success = configureDeviceAddressSpace<GfxFamily>();
if (!success)
break;
context = createContext();
if (context == static_cast<D3DKMT_HANDLE>(0))
break;
success = createMonitoredFence();
if (!success)
break;
initialized = true;
} while (!success);
}
return initialized;
}
} // namespace OCLRT

0 comments on commit c2455b4

Please sign in to comment.