sycl: fix example build (#2570)

This commit is contained in:
Stefan Sydow 2024-11-18 13:57:23 +01:00 committed by GitHub
parent 01d3bd7d5c
commit d24f981fb2
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 9 additions and 6 deletions

View File

@ -137,7 +137,7 @@ if (WHISPER_SDL2)
set_target_properties(lsp PROPERTIES FOLDER "examples") set_target_properties(lsp PROPERTIES FOLDER "examples")
if (GGML_SYCL) if (GGML_SYCL)
add_subdirectory(sycl) add_subdirectory(sycl)
set_target_properties(sycl PROPERTIES FOLDER "examples") set_target_properties(ls-sycl-device PROPERTIES FOLDER "examples")
endif() endif()
endif (WHISPER_SDL2) endif (WHISPER_SDL2)
endif() endif()

View File

@ -5,5 +5,5 @@
set(TARGET ls-sycl-device) set(TARGET ls-sycl-device)
add_executable(${TARGET} ls-sycl-device.cpp) add_executable(${TARGET} ls-sycl-device.cpp)
install(TARGETS ${TARGET} RUNTIME) install(TARGETS ${TARGET} RUNTIME)
target_link_libraries(${TARGET} PRIVATE common llama ${CMAKE_THREAD_LIBS_INIT}) target_link_libraries(${TARGET} PRIVATE common whisper ${CMAKE_THREAD_LIBS_INIT})
target_compile_features(${TARGET} PRIVATE cxx_std_17) target_compile_features(${TARGET} PRIVATE cxx_std_17)

View File

@ -7,10 +7,13 @@ cd build
source /opt/intel/oneapi/setvars.sh source /opt/intel/oneapi/setvars.sh
#for FP16 #for FP16
#cmake .. -DWHISPER_SYCL=ON -DCMAKE_C_COMPILER=icx -DCMAKE_CXX_COMPILER=icpx -DWHISPER_SYCL_F16=ON # faster for long-prompt inference #cmake .. -DGGML_SYCL=ON -DCMAKE_C_COMPILER=icx -DCMAKE_CXX_COMPILER=icpx -DWHISPER_SYCL_F16=ON # faster for long-prompt inference
#for FP32 #for FP32
cmake .. -DWHISPER_SYCL=ON -DCMAKE_C_COMPILER=icx -DCMAKE_CXX_COMPILER=icpx cmake .. -DGGML_SYCL=ON -DCMAKE_C_COMPILER=icx -DCMAKE_CXX_COMPILER=icpx
#for other features from the examples, e.g. stream and talk link with SDL2:
#cmake .. -DGGML_SYCL=ON -DWHISPER_SDL2=ON -DCMAKE_C_COMPILER=icx -DCMAKE_CXX_COMPILER=icpx
#build example/main only #build example/main only
#cmake --build . --config Release --target main #cmake --build . --config Release --target main