[cmake] Use list(APPEND instead of string(APPEND for vulkan codegen args

This was causing the shaders to be incorrectly templated because
both the precision argument and the format argument were being treated
as a single argument by argparse and therefore pasted into shaders
incorrectly. In turn this meant that shaders couldn't be compiled
when the precision or format options were turned on.

Fixes #76195

Pull Request resolved: https://github.com/pytorch/pytorch/pull/76196
Approved by: https://github.com/dagitses
This commit is contained in:
Sam Spilsbury
2022-04-25 17:36:36 +00:00
committed by PyTorch MergeBot
parent bc9bba9b43
commit 111b2bf9da

View File

@ -7,10 +7,10 @@ set(VULKAN_GEN_OUTPUT_PATH "${CMAKE_BINARY_DIR}/vulkan/ATen/native/vulkan")
set(VULKAN_GEN_ARG_ENV "")
if(USE_VULKAN_RELAXED_PRECISION)
string(APPEND VULKAN_GEN_ARG_ENV "precision=mediump")
list(APPEND VULKAN_GEN_ARG_ENV "precision=mediump")
endif()
if(USE_VULKAN_FP16_INFERENCE)
string(APPEND VULKAN_GEN_ARG_ENV "format=rgba16f")
list(APPEND VULKAN_GEN_ARG_ENV "format=rgba16f")
endif()
if(USE_VULKAN_SHADERC_RUNTIME)