diff --git a/otherarch/sdcpp/sdtype_adapter.cpp b/otherarch/sdcpp/sdtype_adapter.cpp index daa4ece48a0216..5f0a9b1a2d0977 100644 --- a/otherarch/sdcpp/sdtype_adapter.cpp +++ b/otherarch/sdcpp/sdtype_adapter.cpp @@ -155,14 +155,14 @@ bool sdtype_load_model(const sd_load_model_inputs inputs) { //duplicated from expose.cpp int cl_parseinfo = inputs.clblast_info; //first digit is whether configured, second is platform, third is devices 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; sdplatformenv = "GGML_OPENCL_PLATFORM="+std::to_string(platform); sddeviceenv = "GGML_OPENCL_DEVICE="+std::to_string(devices); - putenv((char*)sdplatformenv.c_str()); - putenv((char*)sddeviceenv.c_str()); + _putenv((char*)sdplatformenv.c_str()); + _putenv((char*)sddeviceenv.c_str()); std::string vulkan_info_raw = inputs.vulkan_info; std::string vulkan_info_str = ""; for (size_t i = 0; i < vulkan_info_raw.length(); ++i) { @@ -176,7 +176,7 @@ bool sdtype_load_model(const sd_load_model_inputs inputs) { vulkan_info_str = "0"; } sdvulkandeviceenv = "GGML_VK_VISIBLE_DEVICES="+vulkan_info_str; - putenv((char*)sdvulkandeviceenv.c_str()); + _putenv((char*)sdvulkandeviceenv.c_str()); sd_params = new SDParams(); sd_params->model_path = inputs.model_filename;