ren ggml-sycl.hpp -> ggml-sycl.h

This commit is contained in:
jianyuzh 2024-01-09 08:48:18 +08:00 committed by Meng, Hengyu
parent 69d76c8b58
commit c709c3cb37
6 changed files with 5 additions and 9 deletions

View file

@ -486,7 +486,7 @@ if (LLAMA_SYCL)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O3") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O3")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsycl -L${MKLROOT}/lib") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsycl -L${MKLROOT}/lib")
set(GGML_HEADERS_SYCL ggml-cuda.h ggml.h ggml-sycl.hpp) set(GGML_HEADERS_SYCL ggml.h ggml-sycl.h)
set(GGML_SOURCES_SYCL ggml-sycl.cpp) set(GGML_SOURCES_SYCL ggml-sycl.cpp)
set(LLAMA_EXTRA_LIBS ${LLAMA_EXTRA_LIBS} sycl OpenCL mkl_core pthread m dl mkl_sycl_blas mkl_sycl_lapack mkl_sycl_dft mkl_sycl_sparse mkl_sycl_vm mkl_sycl_rng mkl_sycl_stats mkl_sycl_data_fitting mkl_intel_ilp64 mkl_tbb_thread) set(LLAMA_EXTRA_LIBS ${LLAMA_EXTRA_LIBS} sycl OpenCL mkl_core pthread m dl mkl_sycl_blas mkl_sycl_lapack mkl_sycl_dft mkl_sycl_sparse mkl_sycl_vm mkl_sycl_rng mkl_sycl_stats mkl_sycl_data_fitting mkl_intel_ilp64 mkl_tbb_thread)

View file

@ -16,7 +16,7 @@
#include <dpct/dpct.hpp> #include <dpct/dpct.hpp>
#include <dpct/blas_utils.hpp> #include <dpct/blas_utils.hpp>
#include <dpct/lib_common_utils.hpp> #include <dpct/lib_common_utils.hpp>
#include "ggml-sycl.hpp" #include "ggml-sycl.h"
#include "ggml.h" #include "ggml.h"
#include "ggml-backend-impl.h" #include "ggml-backend-impl.h"

View file

@ -10,10 +10,8 @@ extern "C" {
#define GGML_SYCL_MAX_DEVICES 16 #define GGML_SYCL_MAX_DEVICES 16
#define GGML_SYCL_NAME "SYCL" #define GGML_SYCL_NAME "SYCL"
// Always success. To check if SYCL is actually loaded, use `ggml_sycl_loaded`.
GGML_API void ggml_init_sycl(void); GGML_API void ggml_init_sycl(void);
// Returns `true` if there are available SYCL devices and cublas loads successfully; otherwise, it returns `false`.
GGML_API bool ggml_sycl_loaded(void); GGML_API bool ggml_sycl_loaded(void);
GGML_API void * ggml_sycl_host_malloc(size_t size); GGML_API void * ggml_sycl_host_malloc(size_t size);
@ -41,7 +39,6 @@ GGML_API bool ggml_sycl_compute_forward(struct ggml_compute_params * params, s
GGML_API int ggml_sycl_get_device_count(void); GGML_API int ggml_sycl_get_device_count(void);
GGML_API void ggml_sycl_get_device_description(int device, char * description, size_t description_size); GGML_API void ggml_sycl_get_device_description(int device, char * description, size_t description_size);
// backend API
GGML_API ggml_backend_t ggml_backend_sycl_init(int device); GGML_API ggml_backend_t ggml_backend_sycl_init(int device);
GGML_API bool ggml_backend_is_sycl(ggml_backend_t backend); GGML_API bool ggml_backend_is_sycl(ggml_backend_t backend);
@ -49,7 +46,6 @@ GGML_API int ggml_backend_sycl_get_device(ggml_backend_t backend);
GGML_API ggml_backend_buffer_type_t ggml_backend_sycl_buffer_type(int device); GGML_API ggml_backend_buffer_type_t ggml_backend_sycl_buffer_type(int device);
// pinned host buffer for use with CPU backend for faster copies between CPU and GPU
GGML_API ggml_backend_buffer_type_t ggml_backend_sycl_host_buffer_type(void); GGML_API ggml_backend_buffer_type_t ggml_backend_sycl_host_buffer_type(void);
int get_main_device(); int get_main_device();

2
ggml.c
View file

@ -249,7 +249,7 @@ inline static void * ggml_aligned_malloc(size_t size) {
#elif defined(GGML_USE_CLBLAST) #elif defined(GGML_USE_CLBLAST)
#include "ggml-opencl.h" #include "ggml-opencl.h"
#elif defined(GGML_USE_SYCL) #elif defined(GGML_USE_SYCL)
#include "ggml-sycl.hpp" #include "ggml-sycl.h"
#endif #endif
// floating point type used to accumulate sums // floating point type used to accumulate sums

View file

@ -12,7 +12,7 @@
#elif defined(GGML_USE_CLBLAST) #elif defined(GGML_USE_CLBLAST)
# include "ggml-opencl.h" # include "ggml-opencl.h"
#elif defined(GGML_USE_SYCL) #elif defined(GGML_USE_SYCL)
# include "ggml-sycl.hpp" # include "ggml-sycl.h"
#endif #endif
#ifdef GGML_USE_METAL #ifdef GGML_USE_METAL

View file

@ -7,7 +7,7 @@
#include "ggml-cuda.h" #include "ggml-cuda.h"
#define LLAMA_MAX_DEVICES GGML_CUDA_MAX_DEVICES #define LLAMA_MAX_DEVICES GGML_CUDA_MAX_DEVICES
#elif defined(GGML_USE_SYCL) #elif defined(GGML_USE_SYCL)
#include "ggml-sycl.hpp" #include "ggml-sycl.h"
#define LLAMA_MAX_DEVICES GGML_SYCL_MAX_DEVICES #define LLAMA_MAX_DEVICES GGML_SYCL_MAX_DEVICES
#else #else
#define LLAMA_MAX_DEVICES 1 #define LLAMA_MAX_DEVICES 1