File tree Expand file tree Collapse file tree 1 file changed +12
-9
lines changed Expand file tree Collapse file tree 1 file changed +12
-9
lines changed Original file line number Diff line number Diff line change @@ -438,21 +438,24 @@ if (LLAMA_MPI)
438
438
endif ()
439
439
440
440
if (LLAMA_CLBLAST )
441
- # build CLBlast from source
442
- # Add CLBlast directory
443
- add_subdirectory (../CLBlast ${CMAKE_CURRENT_BINARY_DIR} /clblast )
444
-
445
- # Include directories for CLBlast
446
- include_directories (../CLBlast/include )
447
-
448
- message (STATUS "CLBlast source found" )
441
+ message (STATUS "Building with CLBlast" )
449
442
450
443
set (GGML_HEADERS_OPENCL ggml-opencl.h )
451
444
set (GGML_SOURCES_OPENCL ggml-opencl.cpp )
452
445
453
446
add_compile_definitions (GGML_USE_CLBLAST )
454
447
455
- set (LLAMA_EXTRA_LIBS ${LLAMA_EXTRA_LIBS} clblast )
448
+ # link our libOpenCL.so (this is only used during compile time)
449
+ add_library (OpenCL SHARED IMPORTED )
450
+ set_target_properties (OpenCL PROPERTIES IMPORTED_LOCATION ${PROJECT_SOURCE_DIR} /../OpenCL/lib/libOpenCL.so )
451
+
452
+ # add our prebuilt clblast library
453
+ add_library (clblast SHARED IMPORTED )
454
+ set_target_properties (clblast PROPERTIES IMPORTED_LOCATION ${PROJECT_SOURCE_DIR} /../../android/app/src/main/jniLibs/${ANDROID_ABI}/libclblast.so )
455
+
456
+ set (LLAMA_EXTRA_LIBS ${LLAMA_EXTRA_LIBS} clblast OpenCL )
457
+ set (LLAMA_EXTRA_INCLUDES ${LLAMA_EXTRA_INCLUDES} ../CLBlast/include )
458
+ set (LLAMA_EXTRA_INCLUDES ${LLAMA_EXTRA_INCLUDES} ../OpenCL/include )
456
459
endif ()
457
460
458
461
if (LLAMA_VULKAN )
You can’t perform that action at this time.
0 commit comments