[Vulkan] Add -Os flag to shader compilation (#57199)

Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/57199

Reduces the size of compiled shaders, and also potentially adds some performance boost.

Test Plan: Imported from OSS

Reviewed By: xta0

Differential Revision: D28293816

Pulled By: SS-JIA

fbshipit-source-id: 424dc0bce24d6115ba2bf8405027e967f6cb9497
This commit is contained in:
Sicheng Stephen Jia 2021-05-07 13:13:11 -07:00 committed by Facebook GitHub Bot
parent 731dcd75f5
commit 96fce78ac4

View file

@ -43,7 +43,7 @@ def genCppH(hFilePath, cppFilePath, srcDirPath, glslcPath, tmpDirPath, env):
print("spvPath {}".format(spvPath))
cmd = [
glslcPath, "-fshader-stage=compute",
glslcPath, "-fshader-stage=compute", "-Os",
srcPath, "-o", spvPath,
"--target-env=vulkan1.0",
"-Werror"