Skip to content

Commit 8aff1c3

Browse files
committed
opencl: rename backend opencl2 -> opencl
1 parent d4f39c4 commit 8aff1c3

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
@@ -305,13 +305,6 @@ else ()
305305
ggml_add_cpu_backend_variant_impl("")
306306
endif()
307307

308-
if (GGML_OPENCL)
309-
set(GGML_OPENCL2 ON)
310-
add_compile_definitions(GGML_USE_OPENCL)
311-
else ()
312-
set(GGML_OPENCL2 OFF)
313-
endif ()
314-
315308
ggml_add_backend(BLAS)
316309
ggml_add_backend(CANN)
317310
ggml_add_backend(CUDA)
@@ -322,7 +315,7 @@ ggml_add_backend(MUSA)
322315
ggml_add_backend(RPC)
323316
ggml_add_backend(SYCL)
324317
ggml_add_backend(Vulkan)
325-
ggml_add_backend(OpenCL2)
318+
ggml_add_backend(OpenCL)
326319

327320
foreach (target ggml-base ggml)
328321
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
@@ -531,6 +531,7 @@ void ggml_backend_load_all() {
531531
ggml_backend_load_best("rpc", silent);
532532
ggml_backend_load_best("sycl", silent);
533533
ggml_backend_load_best("vulkan", silent);
534+
ggml_backend_load_best("opencl", silent);
534535
ggml_backend_load_best("musa", silent);
535536
ggml_backend_load_best("cpu", silent);
536537
}

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)