minor
This commit is contained in:
parent
d9feb41cb2
commit
427f9af59e
1 changed files with 4 additions and 2 deletions
|
@ -345,6 +345,7 @@ static ggml_cuda_device_info ggml_cuda_init() {
|
||||||
#endif // defined(GGML_USE_HIPBLAS) && defined(__HIP_PLATFORM_AMD__)
|
#endif // defined(GGML_USE_HIPBLAS) && defined(__HIP_PLATFORM_AMD__)
|
||||||
info.devices[id].smpb = prop.sharedMemPerBlock;
|
info.devices[id].smpb = prop.sharedMemPerBlock;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (int id = 0; id < info.device_count; ++id) {
|
for (int id = 0; id < info.device_count; ++id) {
|
||||||
info.default_tensor_split[id] /= total_vram;
|
info.default_tensor_split[id] /= total_vram;
|
||||||
}
|
}
|
||||||
|
@ -393,14 +394,15 @@ struct ggml_cuda_pool_leg : public ggml_cuda_pool {
|
||||||
}
|
}
|
||||||
|
|
||||||
~ggml_cuda_pool_leg() {
|
~ggml_cuda_pool_leg() {
|
||||||
for (int i = 0; i < MAX_BUFFERS; ++i) {
|
|
||||||
ggml_cuda_buffer& b = buffer_pool[i];
|
|
||||||
if (b.ptr != nullptr) {
|
|
||||||
ggml_cuda_set_device(device);
|
ggml_cuda_set_device(device);
|
||||||
|
for (int i = 0; i < MAX_BUFFERS; ++i) {
|
||||||
|
ggml_cuda_buffer & b = buffer_pool[i];
|
||||||
|
if (b.ptr != nullptr) {
|
||||||
CUDA_CHECK(cudaFree(b.ptr));
|
CUDA_CHECK(cudaFree(b.ptr));
|
||||||
pool_size -= b.size;
|
pool_size -= b.size;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
GGML_ASSERT(pool_size == 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
void * alloc(size_t size, size_t * actual_size) override {
|
void * alloc(size_t size, size_t * actual_size) override {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue