diff options
author | 0cc4m <picard12@live.de> | 2023-05-22 23:33:24 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-05-23 00:33:24 +0300 |
commit | 2e6cd4b02549e343bef3768e6b946f999c82e823 (patch) | |
tree | 70ce2c5dcb9beaac230dfa23d531f6e195d12975 /ggml-opencl.h | |
parent | 7e4ea5beff567f53be92f75f9089e6f11fa5dabd (diff) |
OpenCL Token Generation Acceleration (#1459)
* Move back to C++ for OpenCL
* Refactor OpenCL code to work more like the CUDA code, add missing functions
* Deduplicate dequant kernels
* Add OpenCL compile options
* Use compile args for preprocessing constants
* Restore default platform + device selection by id behavior
---------
Co-authored-by: Johannes Gäßler <johannesg@5d6.de>
Co-authored-by: Henri Vasserman <henv@hot.ee>
Diffstat (limited to 'ggml-opencl.h')
-rw-r--r-- | ggml-opencl.h | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/ggml-opencl.h b/ggml-opencl.h index 7bcc603..5a1a500 100644 --- a/ggml-opencl.h +++ b/ggml-opencl.h @@ -1,23 +1,21 @@ #pragma once +#include "ggml.h" + #ifdef __cplusplus extern "C" { #endif void ggml_cl_init(void); -enum ggml_blas_order { - GGML_BLAS_ORDER_ROW_MAJOR = 101, - GGML_BLAS_ORDER_COLUMN_MAJOR = 102, -}; +bool ggml_cl_can_mul_mat(const struct ggml_tensor * src0, const struct ggml_tensor * src1, struct ggml_tensor * dst); +size_t ggml_cl_mul_mat_get_wsize(const struct ggml_tensor * src0, const struct ggml_tensor * src1, struct ggml_tensor * dst); +void ggml_cl_mul_mat(const struct ggml_tensor * src0, const struct ggml_tensor * src1, struct ggml_tensor * dst, void * wdata, size_t wsize); -enum ggml_blas_op { - GGML_BLAS_OP_N = 111, - GGML_BLAS_OP_T = 112, - GGML_BLAS_OP_C = 113, -}; +void * ggml_cl_host_malloc(size_t size); +void ggml_cl_host_free(void * ptr); -void ggml_cl_sgemm_wrapper(const enum ggml_blas_order order, const enum ggml_blas_op trans_a, const enum ggml_blas_op trans_b, const int m, const int n, const int k, const float alpha, const void *host_a, const int lda, const float *host_b, const int ldb, const float beta, float *host_c, const int ldc, const int btype); +void ggml_cl_transform_tensor(struct ggml_tensor * tensor); #ifdef __cplusplus } |