diff --git a/Makefile b/Makefile index f6e8eb73e..2b841ab40 100644 --- a/Makefile +++ b/Makefile @@ -698,7 +698,7 @@ ggml-metal-embed.o: ggml-metal.metal ggml-common.h endif endif # LLAMA_METAL -OBJS += ggml-alloc.o ggml-backend.o ggml-quants.o unicode.o unicode-data.o +OBJS += ggml-alloc.o ggml-backend.o ggml-quants.o nvapi.o unicode.o unicode-data.o COMMON_H_DEPS = common/common.h common/sampling.h common/log.h llama.h COMMON_DEPS = common.o sampling.o grammar-parser.o build-info.o json-schema-to-grammar.o @@ -794,13 +794,16 @@ ggml-quants.o: ggml-quants.c ggml.h ggml-quants.h ggml-common.h ggml-blas.o: ggml-blas.cpp ggml-blas.h $(CXX) $(CXXFLAGS) -c $< -o $@ +nvapi.o: nvapi.cpp nvapi.h + $(CXX) $(CXXFLAGS) -c $< -o $@ + unicode.o: unicode.cpp unicode.h $(CXX) $(CXXFLAGS) -c $< -o $@ unicode-data.o: unicode-data.cpp unicode-data.h $(CXX) $(CXXFLAGS) -c $< -o $@ -llama.o: llama.cpp unicode.h ggml.h ggml-alloc.h ggml-backend.h ggml-cuda.h ggml-metal.h llama.h +llama.o: llama.cpp nvapi.h unicode.h ggml.h ggml-alloc.h ggml-backend.h ggml-cuda.h ggml-metal.h llama.h $(CXX) $(CXXFLAGS) -c $< -o $@ common.o: common/common.cpp $(COMMON_H_DEPS) diff --git a/nvapi.cpp b/nvapi.cpp index 9c19d4b4a..8e16ec145 100644 --- a/nvapi.cpp +++ b/nvapi.cpp @@ -1,5 +1,8 @@ #include "nvapi.h" +// TODO: remove +#include + #ifdef _WIN32 #include #elif __linux__ @@ -84,7 +87,7 @@ void nvapi_free() { if (lib) { FreeLibrary(lib); } - #else + #elif __linux__ if (lib) { dlclose(lib); } @@ -101,6 +104,7 @@ void nvapi_set_pstate(int ids[], int ids_size, int pstate) { } // TODO + printf("nvapi_set_pstate: %d", pstate); } void nvapi_set_pstate_high() { diff --git a/nvapi.h b/nvapi.h index d73b983ec..4a6e4d530 100644 --- a/nvapi.h +++ b/nvapi.h @@ -7,6 +7,10 @@ extern "C" { void nvapi_init(); void nvapi_free(); +void nvapi_set_pstate(int ids[], int ids_size, int pstate); +void nvapi_set_pstate_high(); +void nvapi_set_pstate_low(); + #ifdef __cplusplus } #endif