| 14764 | ///////////////////////////////// |
| 14765 | |
| 14766 | static void ggml_ensure_tensor_data_at_memory(struct ggml_tensor * tensor) { |
| 14767 | #if defined(GGML_USE_CUBLAS) |
| 14768 | if (tensor->backend == GGML_BACKEND_CPU) { |
| 14769 | // in this case, the data is already placed in the memory at compute time |
| 14770 | return; |
| 14771 | } |
| 14772 | |
| 14773 | if (tensor->buffer == NULL || tensor->data == NULL) { |
| 14774 | GGML_ASSERT(false && "not implemented: tensor has no buffer or data"); |
| 14775 | } |
| 14776 | |
| 14777 | fprintf(stderr, "WARNING: transfering tensor %s to CPU at inference is safe but slow\n", ggml_get_name(tensor)); |
| 14778 | ggml_cuda_copy_to_host(tensor); |
| 14779 | #else |
| 14780 | UNUSED(tensor); |
| 14781 | #endif |
| 14782 | } |
| 14783 | |
| 14784 | static void ggml_compute_forward(struct ggml_compute_params * params, struct ggml_tensor * tensor) { |
| 14785 | GGML_ASSERT(params); |
no test coverage detected