2018-05-17 11:47:35 +02:00
|
|
|
/*
|
2019-03-26 11:59:46 +01:00
|
|
|
* Copyright (C) 2018-2019 Intel Corporation
|
2018-05-17 11:47:35 +02:00
|
|
|
*
|
2018-09-18 09:11:08 +02:00
|
|
|
* SPDX-License-Identifier: MIT
|
2018-05-17 11:47:35 +02:00
|
|
|
*
|
|
|
|
|
*/
|
|
|
|
|
|
2019-12-04 12:36:16 +01:00
|
|
|
#include "core/gmm_helper/gmm_helper.h"
|
2019-09-05 09:35:56 +02:00
|
|
|
#include "core/helpers/debug_helpers.h"
|
2019-11-19 11:49:19 +01:00
|
|
|
#include "core/os_interface/os_library.h"
|
2018-05-17 11:47:35 +02:00
|
|
|
|
|
|
|
|
namespace Os {
|
|
|
|
|
extern const char *gmmDllName;
|
2019-10-15 15:05:47 +02:00
|
|
|
extern const char *gmmInitFuncName;
|
|
|
|
|
extern const char *gmmDestroyFuncName;
|
2018-07-06 09:07:42 +02:00
|
|
|
} // namespace Os
|
2018-05-17 11:47:35 +02:00
|
|
|
|
2019-03-26 11:59:46 +01:00
|
|
|
namespace NEO {
|
2018-05-17 11:47:35 +02:00
|
|
|
|
2018-06-21 11:36:47 +02:00
|
|
|
void GmmHelper::loadLib() {
|
2018-07-23 12:23:48 +02:00
|
|
|
gmmLib.reset(OsLibrary::load(Os::gmmDllName));
|
2018-05-17 11:47:35 +02:00
|
|
|
UNRECOVERABLE_IF(!gmmLib);
|
2019-10-15 15:05:47 +02:00
|
|
|
initGmmFunc = reinterpret_cast<decltype(&InitializeGmm)>(gmmLib->getProcAddress(Os::gmmInitFuncName));
|
|
|
|
|
destroyGmmFunc = reinterpret_cast<decltype(&GmmDestroy)>(gmmLib->getProcAddress(Os::gmmDestroyFuncName));
|
|
|
|
|
UNRECOVERABLE_IF(!initGmmFunc || !destroyGmmFunc);
|
2018-05-17 11:47:35 +02:00
|
|
|
}
|
2019-03-26 11:59:46 +01:00
|
|
|
} // namespace NEO
|