intel / intel/llvm

[OpenCL] cl_khr_integer_dot_product is much slower than dp4a emulation

Open
#18,212 8 comments 0 reactions 0 assignees View on GitHub
bug confirmed OCL CPU Experimental RT
Dominant language
LLVM
Stars
1.5k
Forks
854
Avg merge
3d 17h
Merged PRs (30d)
137

Description

Hi all,

the new `cl_khr_integer_dot_product` addition in 2025.1 release is broken.
- On Windows (`2025.19.3.0.17_230222`), the `__opencl_c_integer_dot_product_input_4x8bit` and `__opencl_c_integer_dot_product_input_4x8bit_packed` feature macros are now present, but the `dot(char4, char4)`/`dot_acc_sat(char4, char4, int)` functions fail to compile with errors `instructions in function CompilerException Failed to lookup symbol add_kernel JIT session error: Symbols not found: [ _Z3dotDv4_cS_ ]` / `[ _Z11dot_acc_satDv4_cS_i ]`.
- On Linux (`2025.19.3.0.17_230222`), both
```c
int dp4a(const char4 a, const char4 b, const int c) {
return c+dot(a, b); // 0.020 TIOPs/s
}
```
and
```c
int dp4a(const char4 a, const char4 b, const int c) {
return dot_acc_sat(a, b, c); // 0.015 TIOPs/s
}
```
perform much slower than the emulation variant
```c
int dp4a(const char4 a, const char4 b, const int c) {
return c+a.x*b.x+a.y*b.y+a.z*b.z+a.w*b.w; // 0.064 TIOPs/s
}
```
as measured on my i7-8700K CPU with my [OpenCL-Benchmark](https://github.com/ProjectPhysX/OpenCL-Benchmark). The full [dp4a function implementation is here](https://github.com/ProjectPhysX/OpenCL-Benchmark/blob/master/src/kernel.cpp#L6-L18). The performance behavior is the same on [AMD Ryzen 9 7950X](https://github.com/ProjectPhysX/OpenCL-Benchmark/issues/27#issue-2985033552).

Kind regards,
Moritz

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.