You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The KernelCompiler/sycl.cpp E2E test only exercised std::abs from <complex> when validating that cl_intel_devicelib_complex is wired up through the runtime kernel compiler. This extends coverage to additional C99 complex math functions using float _Complex type.
Changes
DeviceLibrariesSource: replace std::complex<float> usage with C99 float _Complex type and corresponding C99 complex math functions (csinf, ccosf, ctanf, cexpf, clogf, csqrtf, cpowf, csinhf) via #include <complex.h>. Use CMPLXF macro for construction and crealf/cabsf for extracting results. Also replace std::abs(std::complex<float>{...}) with cabsf(CMPLXF(...)).
test_device_libraries: grow the shared float buffer from 4 to 12 elements; the existing ptr[i] != 1.0f check covers every new slot for input (1, 1).
CopilotAI
changed the title
[SYCL][E2E] Extend KernelCompiler/sycl.cpp with std::complex math function tests
[SYCL][E2E] Extend KernelCompiler/sycl.cpp with std::complex math coverage
May 29, 2026
@copilot
The test is not correct, math functions for complex number returns std::complex instead of float, should not use float pointer to return their results, please fix it.
@copilot
The test is not correct, math functions for complex number returns std::complex instead of float, should not use float pointer to return their results, please fix it.
Fixed in 2nd commit. The kernel now takes a std::complex<float> *cptr parameter and stores the full complex results directly (cptr[0] = std::sin(input), etc.). The host side allocates with sycl::malloc_shared<std::complex<float>> and verifies both .real() and .imag() parts.
@copilot
Replace the std::complex math function and data types with corresponding c99 complex math functions from <complex.h> and c99 complex data types and fix the clang format issue as well.
@copilot
Replace the std::complex math function and data types with corresponding c99 complex math functions from <complex.h> and c99 complex data types and fix the clang format issue as well.
Done. Replaced std::complex<float> with C99 float _Complex type and corresponding functions (csinf, ccosf, ctanf, cexpf, clogf, csqrtf, cpowf, csinhf), using CMPLXF for construction and crealf/cabsf for extracting results. The kernel is back to a single float* parameter.
CopilotAI
changed the title
[SYCL][E2E] Extend KernelCompiler/sycl.cpp with std::complex math coverage
[SYCL][E2E] Extend KernelCompiler/sycl.cpp with C99 complex math coverage
Jun 1, 2026
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
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.
The
KernelCompiler/sycl.cppE2E test only exercisedstd::absfrom<complex>when validating thatcl_intel_devicelib_complexis wired up through the runtime kernel compiler. This extends coverage to additional C99 complex math functions usingfloat _Complextype.Changes
DeviceLibrariesSource: replacestd::complex<float>usage with C99float _Complextype and corresponding C99 complex math functions (csinf,ccosf,ctanf,cexpf,clogf,csqrtf,cpowf,csinhf) via#include <complex.h>. UseCMPLXFmacro for construction andcrealf/cabsffor extracting results. Also replacestd::abs(std::complex<float>{...})withcabsf(CMPLXF(...)).test_device_libraries: grow the shared float buffer from 4 to 12 elements; the existingptr[i] != 1.0fcheck covers every new slot for input(1, 1).