summaryrefslogtreecommitdiff
path: root/ggml-cuda.cu
diff options
context:
space:
mode:
Diffstat (limited to 'ggml-cuda.cu')
-rw-r--r--ggml-cuda.cu12
1 files changed, 12 insertions, 0 deletions
diff --git a/ggml-cuda.cu b/ggml-cuda.cu
index df0cbe18..5b415c64 100644
--- a/ggml-cuda.cu
+++ b/ggml-cuda.cu
@@ -6469,3 +6469,15 @@ bool ggml_cuda_compute_forward(struct ggml_compute_params * params, struct ggml_
func(tensor->src[0], tensor->src[1], tensor);
return true;
}
+
+int ggml_cuda_get_device_count() {
+ int device_count;
+ CUDA_CHECK(cudaGetDeviceCount(&device_count));
+ return device_count;
+}
+
+void ggml_cuda_get_device_description(int device, char * description, size_t description_size) {
+ cudaDeviceProp prop;
+ CUDA_CHECK(cudaGetDeviceProperties(&prop, device));
+ snprintf(description, description_size, "%s", prop.name);
+}