Add compile-time dispatching examples for generic BLAS and portFFT backends - #752
Open
zjin-lcf wants to merge 1 commit into
Open
Add compile-time dispatching examples for generic BLAS and portFFT backends#752zjin-lcf wants to merge 1 commit into
zjin-lcf wants to merge 1 commit into
Conversation
…ckends The SYCL-only generic BLAS and portFFT backends cannot be combined with any other backend, so the existing compile-time examples (which pair mklcpu with a vendor GPU backend) do not cover them. Add standalone single-device examples so users can validate these backends: - blas: level3/gemm_usm_generic (built with ENABLE_GENERIC_BLAS_BACKEND) - dft: complex_fwd_usm_portfft (built with ENABLE_PORTFFT_BACKEND, COMPLEX domain only) The BLAS and DFT compile-time CMakeLists are restructured to guard each backend combination independently instead of returning early. The examples README documents both new examples with sample output. Both examples were verified on an Intel Arc B580 GPU with the DPC++ compiler. Addresses uxlfoundation#714 Co-authored-by: Cursor <cursoragent@cursor.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Closes #714.
The SYCL-only generic BLAS and portFFT backends cannot be combined with any other backend, so the existing compile-time dispatching examples (which pair
mklcpuwith a vendor GPU backend) do not cover them. This PR adds standalone, single-device compile-time dispatching examples so users can build and run something to validate these backends:examples/blas/compile_time_dispatching/level3/gemm_usm_generic.cpp— GEMM viabackend_selector<backend::generic>, built whenENABLE_GENERIC_BLAS_BACKENDis on (linksonemath_blas_generic).examples/dft/compile_time_dispatching/complex_fwd_usm_portfft.cpp— complex in-place forward DFT viabackend_selector<backend::portfft>, built whenENABLE_PORTFFT_BACKENDis on (linksonemath_dft_portfft). Only the COMPLEX domain is used since portFFT does not support REAL.The BLAS and DFT compile-time
CMakeLists.txtfiles are restructured to guard each backend combination independently (instead of an earlyreturn()), so the new SYCL-only examples build alongside the existing ones. Both examples are registered as ctests and documented inexamples/README.mdwith sample output.Test plan
Built and run on an
Intel(R) Arc(TM) B580 GraphicsGPU with the DPC++ (icpx 2025.3.1) compiler:cmake -B build -G Ninja \ -DCMAKE_CXX_COMPILER=icpx -DCMAKE_C_COMPILER=icx \ -DENABLE_MKLGPU_BACKEND=OFF -DENABLE_MKLCPU_BACKEND=OFF \ -DENABLE_GENERIC_BLAS_BACKEND=ON -DENABLE_PORTFFT_BACKEND=ON \ -DTARGET_DOMAINS="blas;dft" \ -DBUILD_EXAMPLES=ON -DBUILD_SHARED_LIBS=ON \ -DGENERIC_BLAS_TUNING_TARGET=INTEL_GPU cmake --build build -jResults:
example_blas_gemm_usm_generic— ran OK, exit 0.example_dft_complex_fwd_usm_portfft— ran OK, exit 0.Note for the reporter: the first run of each example is slow because the kernels are JIT-compiled by IGC on the B580; this can look like a hang. Allowing it to finish (or building AOT with
-fsycl-targets=spir64_gen -Xs "-device bmg") resolves it.