Skip to content

Commit

Permalink
Updating tests
Browse files Browse the repository at this point in the history
Signed-off-by: Alejandro Saucedo <axsauze@gmail.com>
  • Loading branch information
axsaucedo committed Jan 21, 2024
1 parent 1931a1c commit ee04190
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 8 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,9 @@ vk_swiftshader_icd.json
tmp_kp_shader.comp.spv
tmp_kp_shader.comp

# Shaders
test/shaders/glsl/*.hpp

# Docs
_build/

1 change: 0 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,6 @@ mk_cmake:
-DKOMPUTE_OPT_BUILT_IN_VULKAN_HEADER_TAG="v1.3.275" \
-DKOMPUTE_OPT_CODE_COVERAGE=ON \
-DKOMPUTE_OPT_CODE_COVERAGE=ON \
-DKOMPUTE_OPT_USE_SPDLOG=1 \
-DCMAKE_EXPORT_COMPILE_COMMANDS=ON \
-DKOMPUTE_OPT_LOG_LEVEL=Debug \
$(MK_CMAKE_EXTRA_FLAGS) \
Expand Down
6 changes: 4 additions & 2 deletions cmake/vulkan_shader_compiler.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,10 @@ function(vulkan_compile_shader)
get_property(VULKAN_COMPILE_SHADER_CWD GLOBAL PROPERTY VULKAN_COMPILE_SHADER_CWD_PROPERTY)
## The directory may not be created so we need to ensure its present
get_filename_component(SHADER_COMPILE_SPV_PATH ${SHADER_COMPILE_SPV_FILE_FULL} DIRECTORY)
add_custom_target(build-time-make-directory ALL
COMMAND ${CMAKE_COMMAND} -E make_directory ${SHADER_COMPILE_SPV_PATH})
if(NOT EXISTS ${SHADER_COMPILE_SPV_PATH})
add_custom_target(build-time-make-directory ALL
COMMAND ${CMAKE_COMMAND} -E make_directory ${SHADER_COMPILE_SPV_PATH})
endif()
## Requires custom command function as this is the only way to call
## a function during compile time from cmake (ie through cmake script)
add_custom_command(OUTPUT "${SHADER_COMPILE_HEADER_FILE_FULL}"
Expand Down
10 changes: 5 additions & 5 deletions test/shaders/glsl/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ vulkan_compile_shader(INFILE test_shader.comp
OUTFILE test_shader.hpp
NAMESPACE "kp")

add_library(test_shaders_glsl INTERFACE "${CMAKE_CURRENT_BINARY_DIR}/test_logistic_regression_shader.hpp"
"${CMAKE_CURRENT_BINARY_DIR}/test_op_custom_shader.hpp"
"${CMAKE_CURRENT_BINARY_DIR}/test_workgroup_shader.hpp"
"${CMAKE_CURRENT_BINARY_DIR}/test_shader.hpp")
add_library(test_shaders_glsl INTERFACE test_logistic_regression_shader.hpp
test_op_custom_shader.hpp
test_workgroup_shader.hpp
test_shader.hpp)

target_include_directories(test_shaders_glsl INTERFACE $<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}>)
target_include_directories(test_shaders_glsl INTERFACE $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>)

0 comments on commit ee04190

Please sign in to comment.