This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include "ggml.h" | |
| #include "ggml-cpu.h" | |
| #ifdef GGML_USE_CUDA | |
| #include "ggml-cuda.h" | |
| #endif | |
| #include <vector> | |
| #include <iostream> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include "ggml.h" | |
| #include "ggml-cpu.h" | |
| #ifdef GGML_USE_CUDA | |
| #include "ggml-cuda.h" | |
| #endif | |
| #include <vector> | |
| #include <iostream> | |
| #include <chrono> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include "ggml.h" | |
| #include "ggml-cpu.h" | |
| #ifdef GGML_USE_CUDA | |
| #include "ggml-cuda.h" | |
| #endif | |
| #include <vector> | |
| #include <iostream> | |
| #include <chrono> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 11a12,13 | |
| > #include "ggml-cpu/unary-ops.h" | |
| > #include "ggml-cpu/binary-ops.h" | |
| 4292,4625d4293 | |
| < static void ggml_compute_forward_add_f32( | |
| < const struct ggml_compute_params * params, | |
| < struct ggml_tensor * dst) { | |
| < | |
| < const struct ggml_tensor * src0 = dst->src[0]; | |
| < const struct ggml_tensor * src1 = dst->src[1]; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| diff --git a/ops.cpp b/ops.cpp | |
| index 6190d0d..c44157b 100644 | |
| --- a/ops.cpp | |
| +++ b/ops.cpp | |
| @@ -2347,7 +2347,7 @@ static void ggml_compute_forward_repeat_back_f32( | |
| GGML_ASSERT(nb00 == sizeof(float)); | |
| if (ggml_is_contiguous(dst)) { | |
| - ggml_vec_set_f32(ne0*ne1*ne2*ne3, dst->data, 0); | |
| + ggml_vec_set_f32(ne0*ne1*ne2*ne3, (float *)dst->data, 0); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 12,13c12,15 | |
| < #include "ggml-cpu/unary-ops.h" | |
| < #include "ggml-cpu/binary-ops.h" | |
| --- | |
| > #include "unary-ops.h" | |
| > #include "binary-ops.h" | |
| > #include "vec.h" | |
| > #include "ops.h" | |
| 86,109d87 | |
| < #if defined(GGML_USE_ACCELERATE) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <cuda_runtime.h> | |
| #include <iostream> | |
| #include <chrono> | |
| #define CHECK_CUDA(call) \ | |
| do { \ | |
| cudaError_t err = call; \ | |
| if (err != cudaSuccess) { \ | |
| std::cerr << "CUDA Error: " << cudaGetErrorString(err) << "\n"; \ | |
| exit(EXIT_FAILURE); \ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <cuda_runtime.h> | |
| #include <iostream> | |
| #include <chrono> | |
| #define CHECK_CUDA(call) \ | |
| do { \ | |
| cudaError_t err = call; \ | |
| if (err != cudaSuccess) { \ | |
| std::cerr << "CUDA Error: " << cudaGetErrorString(err) << "\n"; \ | |
| exit(EXIT_FAILURE); \ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <cuda_runtime.h> | |
| #include <iostream> | |
| #include <chrono> | |
| #define CHECK_CUDA(call) \ | |
| if ((call) != cudaSuccess) { \ | |
| std::cerr << "CUDA error at " << __FILE__ << ":" << __LINE__ << std::endl; \ | |
| std::exit(1); \ | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // can run on https://thebookofshaders.com/edit.php | |
| #ifdef GL_ES | |
| precision mediump float; | |
| #endif | |
| uniform vec2 u_resolution; | |
| vec3 hsv2rgb(vec3 c) { | |
| vec4 K = vec4(1.0, 2.0/3.0, 1.0/3.0, 3.0); |