Skip to content

Commit 65aff2a

Browse files
committed
opencl: rename backend opencl2 -> opencl
1 parent 97872eb commit 65aff2a

15 files changed

+9
-22
lines changed
File renamed without changes.

ggml/src/CMakeLists.txt

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -303,13 +303,6 @@ else ()
303303
ggml_add_cpu_backend_variant_impl("")
304304
endif()
305305

306-
if (GGML_OPENCL)
307-
set(GGML_OPENCL2 ON)
308-
add_compile_definitions(GGML_USE_OPENCL)
309-
else ()
310-
set(GGML_OPENCL2 OFF)
311-
endif ()
312-
313306
ggml_add_backend(BLAS)
314307
ggml_add_backend(CANN)
315308
ggml_add_backend(CUDA)
@@ -320,7 +313,7 @@ ggml_add_backend(MUSA)
320313
ggml_add_backend(RPC)
321314
ggml_add_backend(SYCL)
322315
ggml_add_backend(Vulkan)
323-
ggml_add_backend(OpenCL2)
316+
ggml_add_backend(OpenCL)
324317

325318
foreach (target ggml-base ggml)
326319
target_include_directories(${target} PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/../include> $<INSTALL_INTERFACE:include>)

ggml/src/ggml-backend-reg.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,8 @@
4646
#include "ggml-vulkan.h"
4747
#endif
4848

49-
#ifdef GGML_USE_OPENCL2
50-
#include "ggml-opencl2.h"
49+
#ifdef GGML_USE_OPENCL
50+
#include "ggml-opencl.h"
5151
#endif
5252

5353
#ifdef GGML_USE_BLAS
@@ -150,7 +150,7 @@ struct ggml_backend_registry {
150150
#ifdef GGML_USE_VULKAN
151151
register_backend(ggml_backend_vk_reg());
152152
#endif
153-
#ifdef GGML_USE_OPENCL2
153+
#ifdef GGML_USE_OPENCL
154154
register_backend(ggml_backend_opencl2_reg());
155155
#endif
156156
#ifdef GGML_USE_CANN
@@ -545,6 +545,7 @@ void ggml_backend_load_all_from_path(const char * dir_path) {
545545
ggml_backend_load_best("rpc", silent, dir_path);
546546
ggml_backend_load_best("sycl", silent, dir_path);
547547
ggml_backend_load_best("vulkan", silent, dir_path);
548+
ggml_backend_load_best("opencl", silent, dir_path);
548549
ggml_backend_load_best("musa", silent, dir_path);
549550
ggml_backend_load_best("cpu", silent, dir_path);
550551
}

ggml/src/ggml-opencl2/CMakeLists.txt renamed to ggml/src/ggml-opencl/CMakeLists.txt

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,21 +4,14 @@ find_package(OpenCL)
44
if (OpenCL_FOUND)
55
find_package(Python3 REQUIRED)
66

7-
set(TARGET_NAME ggml-opencl2)
7+
set(TARGET_NAME ggml-opencl)
88

99
ggml_add_backend_library(${TARGET_NAME}
10-
ggml-opencl2.cpp
11-
../../include/ggml-opencl2.h)
10+
ggml-opencl.cpp
11+
../../include/ggml-opencl.h)
1212
target_link_libraries(${TARGET_NAME} PRIVATE ggml-base ${OpenCL_LIBRARIES})
1313
target_include_directories(${TARGET_NAME} PRIVATE . .. ${OpenCL_INCLUDE_DIRS})
1414

15-
# TODO - this is kind of strange. We have been calling this backend OpenCL2,
16-
# so everything (function names, folder name, etc) except macro switches
17-
# has been OpenCL2. Now, the backend frameworke enforces the use of the folder
18-
# name as the backend name and switch. So, GGML_USE_OPENCL2 is used in
19-
# ggml-backend-reg.cpp, but the rest still uses GGML_USE_OPENCL.
20-
add_compile_definitions(GGML_USE_OPENCL)
21-
2215
if (GGML_OPENCL_PROFILING)
2316
message(STATUS "OpenCL profiling enabled (increases CPU overhead)")
2417
add_compile_definitions(GGML_OPENCL_PROFILING)

ggml/src/ggml-opencl2/ggml-opencl2.cpp renamed to ggml/src/ggml-opencl/ggml-opencl.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
#pragma GCC diagnostic ignored "-Wgnu-anonymous-struct"
88
#pragma GCC diagnostic ignored "-Woverlength-strings"
99

10-
#include "ggml-opencl2.h"
10+
#include "ggml-opencl.h"
1111
#include "ggml-backend.h"
1212
#include "ggml-impl.h"
1313
#include "ggml-backend-impl.h"

0 commit comments

Comments
 (0)