diff --git a/CMakeLists.txt b/CMakeLists.txt index 0e9183625..8260dd6cd 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -403,15 +403,16 @@ if (LLAMA_KOMPUTE) set(multiValueArgs SOURCES) cmake_parse_arguments(compile_shader "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN}) foreach(source ${compile_shader_SOURCES}) - set(spv_file ${source}.spv) + get_filename_component(filename ${source} NAME) + set(spv_file ${filename}.spv) add_custom_command( OUTPUT ${spv_file} DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${source} - ${CMAKE_CURRENT_SOURCE_DIR}/kompute/common.comp - ${CMAKE_CURRENT_SOURCE_DIR}/kompute/op_getrows.comp - ${CMAKE_CURRENT_SOURCE_DIR}/kompute/op_mul_mv_q_n.comp + ${CMAKE_CURRENT_SOURCE_DIR}/kompute-shaders/common.comp + ${CMAKE_CURRENT_SOURCE_DIR}/kompute-shaders/op_getrows.comp + ${CMAKE_CURRENT_SOURCE_DIR}/kompute-shaders/op_mul_mv_q_n.comp COMMAND ${glslc_executable} --target-env=vulkan1.2 -o ${spv_file} ${CMAKE_CURRENT_SOURCE_DIR}/${source} - COMMENT "Compiling ${source} to ${source}.spv" + COMMENT "Compiling ${source} to ${spv_file}" ) get_filename_component(RAW_FILE_NAME ${spv_file} NAME) @@ -444,35 +445,35 @@ if (LLAMA_KOMPUTE) # Compile our shaders compile_shader(SOURCES - kompute/op_scale.comp - kompute/op_scale_8.comp - kompute/op_add.comp - kompute/op_addrow.comp - kompute/op_mul.comp - kompute/op_mulrow.comp - kompute/op_silu.comp - kompute/op_relu.comp - kompute/op_gelu.comp - kompute/op_softmax.comp - kompute/op_norm.comp - kompute/op_rmsnorm.comp - kompute/op_diagmask.comp - kompute/op_mul_mat_mat_f32.comp - kompute/op_mul_mat_f16.comp - kompute/op_mul_mat_q8_0.comp - kompute/op_mul_mat_q4_0.comp - kompute/op_mul_mat_q4_1.comp - kompute/op_mul_mat_q6_k.comp - kompute/op_getrows_f16.comp - kompute/op_getrows_q4_0.comp - kompute/op_getrows_q4_1.comp - kompute/op_getrows_q6_k.comp - kompute/op_rope_f16.comp - kompute/op_rope_f32.comp - kompute/op_cpy_f16_f16.comp - kompute/op_cpy_f16_f32.comp - kompute/op_cpy_f32_f16.comp - kompute/op_cpy_f32_f32.comp + kompute-shaders/op_scale.comp + kompute-shaders/op_scale_8.comp + kompute-shaders/op_add.comp + kompute-shaders/op_addrow.comp + kompute-shaders/op_mul.comp + kompute-shaders/op_mulrow.comp + kompute-shaders/op_silu.comp + kompute-shaders/op_relu.comp + kompute-shaders/op_gelu.comp + kompute-shaders/op_softmax.comp + kompute-shaders/op_norm.comp + kompute-shaders/op_rmsnorm.comp + kompute-shaders/op_diagmask.comp + kompute-shaders/op_mul_mat_mat_f32.comp + kompute-shaders/op_mul_mat_f16.comp + kompute-shaders/op_mul_mat_q8_0.comp + kompute-shaders/op_mul_mat_q4_0.comp + kompute-shaders/op_mul_mat_q4_1.comp + kompute-shaders/op_mul_mat_q6_k.comp + kompute-shaders/op_getrows_f16.comp + kompute-shaders/op_getrows_q4_0.comp + kompute-shaders/op_getrows_q4_1.comp + kompute-shaders/op_getrows_q6_k.comp + kompute-shaders/op_rope_f16.comp + kompute-shaders/op_rope_f32.comp + kompute-shaders/op_cpy_f16_f16.comp + kompute-shaders/op_cpy_f16_f32.comp + kompute-shaders/op_cpy_f32_f16.comp + kompute-shaders/op_cpy_f32_f32.comp ) # Create a custom target for our generated shaders diff --git a/kompute/common.comp b/kompute-shaders/common.comp similarity index 100% rename from kompute/common.comp rename to kompute-shaders/common.comp diff --git a/kompute/op_add.comp b/kompute-shaders/op_add.comp similarity index 100% rename from kompute/op_add.comp rename to kompute-shaders/op_add.comp diff --git a/kompute/op_addrow.comp b/kompute-shaders/op_addrow.comp similarity index 100% rename from kompute/op_addrow.comp rename to kompute-shaders/op_addrow.comp diff --git a/kompute/op_cpy_f16_f16.comp b/kompute-shaders/op_cpy_f16_f16.comp similarity index 100% rename from kompute/op_cpy_f16_f16.comp rename to kompute-shaders/op_cpy_f16_f16.comp diff --git a/kompute/op_cpy_f16_f32.comp b/kompute-shaders/op_cpy_f16_f32.comp similarity index 100% rename from kompute/op_cpy_f16_f32.comp rename to kompute-shaders/op_cpy_f16_f32.comp diff --git a/kompute/op_cpy_f32_f16.comp b/kompute-shaders/op_cpy_f32_f16.comp similarity index 100% rename from kompute/op_cpy_f32_f16.comp rename to kompute-shaders/op_cpy_f32_f16.comp diff --git a/kompute/op_cpy_f32_f32.comp b/kompute-shaders/op_cpy_f32_f32.comp similarity index 100% rename from kompute/op_cpy_f32_f32.comp rename to kompute-shaders/op_cpy_f32_f32.comp diff --git a/kompute/op_diagmask.comp b/kompute-shaders/op_diagmask.comp similarity index 100% rename from kompute/op_diagmask.comp rename to kompute-shaders/op_diagmask.comp diff --git a/kompute/op_gelu.comp b/kompute-shaders/op_gelu.comp similarity index 100% rename from kompute/op_gelu.comp rename to kompute-shaders/op_gelu.comp diff --git a/kompute/op_getrows.comp b/kompute-shaders/op_getrows.comp similarity index 100% rename from kompute/op_getrows.comp rename to kompute-shaders/op_getrows.comp diff --git a/kompute/op_getrows_f16.comp b/kompute-shaders/op_getrows_f16.comp similarity index 100% rename from kompute/op_getrows_f16.comp rename to kompute-shaders/op_getrows_f16.comp diff --git a/kompute/op_getrows_q4_0.comp b/kompute-shaders/op_getrows_q4_0.comp similarity index 100% rename from kompute/op_getrows_q4_0.comp rename to kompute-shaders/op_getrows_q4_0.comp diff --git a/kompute/op_getrows_q4_1.comp b/kompute-shaders/op_getrows_q4_1.comp similarity index 100% rename from kompute/op_getrows_q4_1.comp rename to kompute-shaders/op_getrows_q4_1.comp diff --git a/kompute/op_getrows_q6_k.comp b/kompute-shaders/op_getrows_q6_k.comp similarity index 100% rename from kompute/op_getrows_q6_k.comp rename to kompute-shaders/op_getrows_q6_k.comp diff --git a/kompute/op_mul.comp b/kompute-shaders/op_mul.comp similarity index 100% rename from kompute/op_mul.comp rename to kompute-shaders/op_mul.comp diff --git a/kompute/op_mul_mat_f16.comp b/kompute-shaders/op_mul_mat_f16.comp similarity index 100% rename from kompute/op_mul_mat_f16.comp rename to kompute-shaders/op_mul_mat_f16.comp diff --git a/kompute/op_mul_mat_mat_f32.comp b/kompute-shaders/op_mul_mat_mat_f32.comp similarity index 100% rename from kompute/op_mul_mat_mat_f32.comp rename to kompute-shaders/op_mul_mat_mat_f32.comp diff --git a/kompute/op_mul_mat_q4_0.comp b/kompute-shaders/op_mul_mat_q4_0.comp similarity index 100% rename from kompute/op_mul_mat_q4_0.comp rename to kompute-shaders/op_mul_mat_q4_0.comp diff --git a/kompute/op_mul_mat_q4_1.comp b/kompute-shaders/op_mul_mat_q4_1.comp similarity index 100% rename from kompute/op_mul_mat_q4_1.comp rename to kompute-shaders/op_mul_mat_q4_1.comp diff --git a/kompute/op_mul_mat_q6_k.comp b/kompute-shaders/op_mul_mat_q6_k.comp similarity index 100% rename from kompute/op_mul_mat_q6_k.comp rename to kompute-shaders/op_mul_mat_q6_k.comp diff --git a/kompute/op_mul_mat_q8_0.comp b/kompute-shaders/op_mul_mat_q8_0.comp similarity index 100% rename from kompute/op_mul_mat_q8_0.comp rename to kompute-shaders/op_mul_mat_q8_0.comp diff --git a/kompute/op_mul_mv_q_n.comp b/kompute-shaders/op_mul_mv_q_n.comp similarity index 100% rename from kompute/op_mul_mv_q_n.comp rename to kompute-shaders/op_mul_mv_q_n.comp diff --git a/kompute/op_mulrow.comp b/kompute-shaders/op_mulrow.comp similarity index 100% rename from kompute/op_mulrow.comp rename to kompute-shaders/op_mulrow.comp diff --git a/kompute/op_norm.comp b/kompute-shaders/op_norm.comp similarity index 100% rename from kompute/op_norm.comp rename to kompute-shaders/op_norm.comp diff --git a/kompute/op_relu.comp b/kompute-shaders/op_relu.comp similarity index 100% rename from kompute/op_relu.comp rename to kompute-shaders/op_relu.comp diff --git a/kompute/op_rmsnorm.comp b/kompute-shaders/op_rmsnorm.comp similarity index 100% rename from kompute/op_rmsnorm.comp rename to kompute-shaders/op_rmsnorm.comp diff --git a/kompute/op_rope_f16.comp b/kompute-shaders/op_rope_f16.comp similarity index 100% rename from kompute/op_rope_f16.comp rename to kompute-shaders/op_rope_f16.comp diff --git a/kompute/op_rope_f32.comp b/kompute-shaders/op_rope_f32.comp similarity index 100% rename from kompute/op_rope_f32.comp rename to kompute-shaders/op_rope_f32.comp diff --git a/kompute/op_scale.comp b/kompute-shaders/op_scale.comp similarity index 100% rename from kompute/op_scale.comp rename to kompute-shaders/op_scale.comp diff --git a/kompute/op_scale_8.comp b/kompute-shaders/op_scale_8.comp similarity index 100% rename from kompute/op_scale_8.comp rename to kompute-shaders/op_scale_8.comp diff --git a/kompute/op_silu.comp b/kompute-shaders/op_silu.comp similarity index 100% rename from kompute/op_silu.comp rename to kompute-shaders/op_silu.comp diff --git a/kompute/op_softmax.comp b/kompute-shaders/op_softmax.comp similarity index 100% rename from kompute/op_softmax.comp rename to kompute-shaders/op_softmax.comp diff --git a/kompute/rope_common.comp b/kompute-shaders/rope_common.comp similarity index 100% rename from kompute/rope_common.comp rename to kompute-shaders/rope_common.comp