Fix clblast device selection on Linux
This commit is contained in:
parent
c3b810868d
commit
8fbfc80e03
1 changed files with 10 additions and 8 deletions
|
@ -23,6 +23,8 @@
|
||||||
extern "C"
|
extern "C"
|
||||||
{
|
{
|
||||||
|
|
||||||
|
std::string platformenv, deviceenv;
|
||||||
|
|
||||||
//return val: 0=fail, 1=(original ggml, alpaca), 2=(ggmf), 3=(ggjt)
|
//return val: 0=fail, 1=(original ggml, alpaca), 2=(ggmf), 3=(ggjt)
|
||||||
static FileFormat file_format = FileFormat::BADFORMAT;
|
static FileFormat file_format = FileFormat::BADFORMAT;
|
||||||
|
|
||||||
|
@ -40,8 +42,8 @@ extern "C"
|
||||||
parseinfo = parseinfo%100; //keep last 2 digits
|
parseinfo = parseinfo%100; //keep last 2 digits
|
||||||
int platform = parseinfo/10;
|
int platform = parseinfo/10;
|
||||||
int devices = parseinfo%10;
|
int devices = parseinfo%10;
|
||||||
std::string platformenv = "KCPP_CLBLAST_PLATFORM="+std::to_string(platform);
|
platformenv = "KCPP_CLBLAST_PLATFORM="+std::to_string(platform);
|
||||||
std::string deviceenv = "KCPP_CLBLAST_DEVICES="+std::to_string(devices);
|
deviceenv = "KCPP_CLBLAST_DEVICES="+std::to_string(devices);
|
||||||
putenv((char*)platformenv.c_str());
|
putenv((char*)platformenv.c_str());
|
||||||
putenv((char*)deviceenv.c_str());
|
putenv((char*)deviceenv.c_str());
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue