Skip to content

[SYCL] Add scalar-only builtins entry heade#21681

Draft
koparasy wants to merge 1 commit intointel:syclfrom
koparasy:sycl-scalar-builtins
Draft

[SYCL] Add scalar-only builtins entry heade#21681
koparasy wants to merge 1 commit intointel:syclfrom
koparasy:sycl-scalar-builtins

Conversation

@koparasy
Copy link
Copy Markdown
Contributor

@koparasy koparasy commented Apr 2, 2026

This PR adds sycl/builtins_scalar.hpp, a lighter-weight entry point for code that uses only scalar builtin functions.

Today, scalar-only users still pull in the full gentype/vector/marray builtin machinery through sycl/builtins.hpp. This change refactors the builtin implementation so scalar-safe pieces are separated from gentype-specific utilities, while keeping the existing full builtins path unchanged.

The motivation is compile-time reduction for scalar-only consumers. In a minimal softmax kernel where the only source difference is including sycl/builtins.hpp vs sycl/builtins_scalar.hpp, device-only syntax checking time dropped from 0.632s to 0.310s:

> diff softmax_kernel.cpp softmax_kernel_scalar.cpp 
6c6
< #include <sycl/builtins.hpp>
---
> #include <sycl/builtins_scalar.hpp>

> time clang++ -fsycl -fsycl-device-only -ftime-trace   softmax_kernel.cpp -fsyntax-only 
real    0m0.632s
user    0m0.587s
sys     0m0.038s
> time clang++ -fsycl -fsycl-device-only -ftime-trace   softmax_kernel_scalar.cpp -fsyntax-only 

real    0m0.310s
user    0m0.280s
sys     0m0.030s

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant