|
| 1 | +# from https://github.com/pytorch/pytorch/blob/b7e207ca9f046ddd716076965a0cce403ba99052/cmake/Modules/FindSYCLToolkit.cmake#L44 |
| 2 | +function(parse_sycl_compiler_version version_number) |
| 3 | + # Execute the SYCL compiler with the --version flag to match the version string. |
| 4 | + execute_process(COMMAND ${CMAKE_CXX_COMPILER} --version OUTPUT_VARIABLE SYCL_VERSION_STRING) |
| 5 | + string(REGEX REPLACE "Intel\\(R\\) (.*) Compiler ([0-9]+\\.[0-9]+\\.[0-9]+) (.*)" "\\2" |
| 6 | + SYCL_VERSION_STRING_MATCH ${SYCL_VERSION_STRING}) |
| 7 | + string(REPLACE "." ";" SYCL_VERSION_LIST ${SYCL_VERSION_STRING_MATCH}) |
| 8 | + # Split the version number list into major, minor, and patch components. |
| 9 | + list(GET SYCL_VERSION_LIST 0 VERSION_MAJOR) |
| 10 | + list(GET SYCL_VERSION_LIST 1 VERSION_MINOR) |
| 11 | + list(GET SYCL_VERSION_LIST 2 VERSION_PATCH) |
| 12 | + # Calculate the version number in the format XXXXYYZZ, using the formula (major * 10000 + minor * 100 + patch). |
| 13 | + math(EXPR VERSION_NUMBER_MATCH "${VERSION_MAJOR} * 10000 + ${VERSION_MINOR} * 100 + ${VERSION_PATCH}") |
| 14 | + set(${version_number} "${VERSION_NUMBER_MATCH}" PARENT_SCOPE) |
| 15 | +endfunction() |
| 16 | + |
| 17 | +parse_sycl_compiler_version(SYCL_COMPILER_VERSION) |
| 18 | + |
| 19 | +set(SPIRV_EXTENSIONS "+SPV_INTEL_split_barrier") |
| 20 | + |
| 21 | +if (SYCL_COMPILER_VERSION GREATER_EQUAL 20250200) |
| 22 | + string(APPEND SPIRV_EXTENSIONS ",+SPV_INTEL_2d_block_io,+SPV_INTEL_subgroup_matrix_multiply_accumulate") |
| 23 | +endif() |
| 24 | + |
1 | 25 | set(CUTLASS_KERNEL_FLAGS ${CUTLASS_KERNEL_FLAGS} |
2 | 26 | -fsycl |
3 | 27 | -fsycl-device-code-split=per_kernel |
4 | 28 | -fsycl-targets=intel_gpu_pvc,intel_gpu_bmg_g21 |
5 | | - "SHELL:-Xspirv-translator=intel_gpu_pvc --spirv-ext=+SPV_INTEL_split_barrier" |
6 | | - "SHELL:-Xspirv-translator=intel_gpu_bmg_g21 --spirv-ext=+SPV_INTEL_split_barrier" |
| 29 | + "SHELL:-Xspirv-translator=intel_gpu_pvc --spirv-ext=${SPIRV_EXTENSIONS}" |
| 30 | + "SHELL:-Xspirv-translator=intel_gpu_bmg_g21 --spirv-ext=${SPIRV_EXTENSIONS}" |
7 | 31 | -Xs "-options \"-igc_opts 'VISAOptions=-perfmodel,VectorAliasBBThreshold=1000,ExtraOCLOptions=-cl-intel-256-GRF-per-thread'\" -options -ze-opt-large-register-file" |
8 | 32 | ) |
9 | 33 |
|
|
0 commit comments