Skip to content

Commit

Permalink
Update expose.cpp putenv to _putenv
Browse files Browse the repository at this point in the history
  • Loading branch information
YellowRoseCx authored Apr 12, 2024
1 parent 259bf69 commit a4de003
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions expose.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,15 +50,15 @@ extern "C"
int cl_parseinfo = inputs.clblast_info;

std::string usingclblast = "GGML_OPENCL_CONFIGURED="+std::to_string(cl_parseinfo>0?1:0);
putenv((char*)usingclblast.c_str());
_putenv((char*)usingclblast.c_str());

cl_parseinfo = cl_parseinfo%100; //keep last 2 digits
int platform = cl_parseinfo/10;
int devices = cl_parseinfo%10;
platformenv = "GGML_OPENCL_PLATFORM="+std::to_string(platform);
deviceenv = "GGML_OPENCL_DEVICE="+std::to_string(devices);
putenv((char*)platformenv.c_str());
putenv((char*)deviceenv.c_str());
_putenv((char*)platformenv.c_str());
_putenv((char*)deviceenv.c_str());

std::string vulkan_info_raw = inputs.vulkan_info;
std::string vulkan_info_str = "";
Expand All @@ -74,7 +74,7 @@ extern "C"
}

vulkandeviceenv = "GGML_VK_VISIBLE_DEVICES="+vulkan_info_str;
putenv((char*)vulkandeviceenv.c_str());
_putenv((char*)vulkandeviceenv.c_str());

executable_path = inputs.executable_path;

Expand Down

0 comments on commit a4de003

Please sign in to comment.