MCPcopy Create free account
hub / github.com/appdevforall/CodeOnTheGo / ggml_fopen

Function ggml_fopen

subprojects/llama.cpp/ggml/src/ggml.c:581–607  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

579#endif
580
581FILE * ggml_fopen(const char * fname, const char * mode) {
582#ifdef _WIN32
583 FILE * file = NULL;
584
585 // convert fname (UTF-8)
586 wchar_t * wfname = ggml_mbstowcs(fname);
587 if (wfname) {
588 // convert mode (ANSI)
589 wchar_t * wmode = GGML_MALLOC((strlen(mode) + 1) * sizeof(wchar_t));
590 wchar_t * wmode_p = wmode;
591 do {
592 *wmode_p++ = (wchar_t)*mode;
593 } while (*mode++);
594
595 // open file
596 file = _wfopen(wfname, wmode);
597
598 GGML_FREE(wfname);
599 GGML_FREE(wmode);
600 }
601
602 return file;
603#else
604 return fopen(fname, mode);
605#endif
606
607}
608
609static const struct ggml_type_traits type_traits[GGML_TYPE_COUNT] = {
610 [GGML_TYPE_I8] = {

Callers 5

implMethod · 0.85
init_fpMethod · 0.85
gguf_init_from_fileFunction · 0.85
gguf_write_to_fileFunction · 0.85
ggml_graph_dump_dotFunction · 0.85

Calls 1

ggml_mbstowcsFunction · 0.85

Tested by

no test coverage detected