Files
compute-runtime/runtime/gmm_helper/gmm_interface.cpp
Mateusz Jablonski caa477115f Remove support for static gmmlib
Signed-off-by: Mateusz Jablonski <mateusz.jablonski@intel.com>

https://github.com/intel/compute-runtime/pull/91

Change-Id: I90184d7aabf3dd0d8a74ff40115213241b4ca724
2018-10-02 18:21:51 +02:00

34 lines
943 B
C++

/*
* Copyright (C) 2018 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
*/
#include "runtime/gmm_helper/gmm_helper.h"
#include "runtime/helpers/debug_helpers.h"
#include "runtime/os_interface/os_library.h"
namespace Os {
extern const char *gmmDllName;
extern const char *gmmEntryName;
} // namespace Os
namespace OCLRT {
void GmmHelper::loadLib() {
gmmLib.reset(OsLibrary::load(Os::gmmDllName));
bool isLoaded = false;
UNRECOVERABLE_IF(!gmmLib);
auto openGmmFunc = reinterpret_cast<decltype(&OpenGmm)>(gmmLib->getProcAddress(Os::gmmEntryName));
auto status = openGmmFunc(&gmmEntries);
if (status == GMM_SUCCESS) {
isLoaded = gmmEntries.pfnCreateClientContext &&
gmmEntries.pfnCreateSingletonContext &&
gmmEntries.pfnDeleteClientContext &&
gmmEntries.pfnDestroySingletonContext;
}
UNRECOVERABLE_IF(!isLoaded);
}
} // namespace OCLRT