mirror of
https://github.com/ggerganov/llama.cpp.git
synced 2025-01-27 20:43:07 +01:00
ggml: added/removed const references for simple types and structures less 16 bytes
Reference: https://stackoverflow.com/a/3314034
This commit is contained in:
parent
a1649cc13f
commit
44ec40a43a
@ -376,7 +376,7 @@ static std::vector<ggml_backend_dev_t> parse_device_list(const std::string & val
|
|||||||
return devices;
|
return devices;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void add_rpc_devices(std::string servers) {
|
static void add_rpc_devices(const std::string & servers) {
|
||||||
auto rpc_servers = string_split<std::string>(servers, ',');
|
auto rpc_servers = string_split<std::string>(servers, ',');
|
||||||
if (rpc_servers.empty()) {
|
if (rpc_servers.empty()) {
|
||||||
throw std::invalid_argument("no RPC servers specified");
|
throw std::invalid_argument("no RPC servers specified");
|
||||||
|
@ -1153,7 +1153,7 @@ struct gguf_writer {
|
|||||||
buf.insert(buf.end(), val.begin(), val.end());
|
buf.insert(buf.end(), val.begin(), val.end());
|
||||||
}
|
}
|
||||||
|
|
||||||
void write(const bool & val) const {
|
void write(const bool val) const {
|
||||||
const int8_t val8 = val ? 1 : 0;
|
const int8_t val8 = val ? 1 : 0;
|
||||||
write(val8);
|
write(val8);
|
||||||
}
|
}
|
||||||
@ -1172,11 +1172,11 @@ struct gguf_writer {
|
|||||||
write(std::string(val));
|
write(std::string(val));
|
||||||
}
|
}
|
||||||
|
|
||||||
void write(const enum ggml_type & val) const {
|
void write(const enum ggml_type val) const {
|
||||||
write(int32_t(val));
|
write(int32_t(val));
|
||||||
}
|
}
|
||||||
|
|
||||||
void write(const enum gguf_type & val) const {
|
void write(const enum gguf_type val) const {
|
||||||
write(int32_t(val));
|
write(int32_t(val));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user