Skip to content
This repository was archived by the owner on Mar 28, 2023. It is now read-only.

[SYCL] Add tests for some half builtins #880

Merged
merged 8 commits into from
Mar 28, 2022
Merged

Conversation

t4c1
Copy link

@t4c1 t4c1 commented Mar 2, 2022

Added tests for some libclc builtins that work on halfs. We will be making some changes to those, but the tests for them can be merged ahead of time.

Tests some of the changes in intel/llvm#5724

@t4c1 t4c1 requested a review from a team as a code owner March 2, 2022 12:37
@t4c1 t4c1 requested a review from smaslov-intel March 2, 2022 12:37
@t4c1
Copy link
Author

t4c1 commented Mar 3, 2022

@bader Can I ask you for a copy of the logs for failed CI tests?

@bader
Copy link

bader commented Mar 3, 2022

To run this test on OpenCL back-end, the target must support cl_khr_fp16 extension. Intel OpenCL CPU doesn't support it.

@t4c1
Copy link
Author

t4c1 commented Mar 3, 2022

Is it possible to specify an extension in XFAIL? Or should I just set XFAIL for OpenCL backend?

@bader bader changed the title [SYCL] added tests for some half builtins [SYCL] Add tests for some half builtins Mar 3, 2022
bader pushed a commit to intel/llvm that referenced this pull request Mar 14, 2022
… fma, fmin, fmax and fmax (#5724)

For functions fma, fmin, fmax and fmax adds bf16 builtins to libclc and optimizes half builtins to use half instructions if supported by the device.

This PR also contains some changes (everything in clang folder) that have been merged in upstream llvm since last pulldown and are required for building it. There are parts of (something went wrong when merging these, so only parts were merged at first. The changes in this PR are the remainder): https://reviews.llvm.org/D118977 https://reviews.llvm.org/D117887 https://reviews.llvm.org/D119157

Tests for half changes are in intel/llvm-test-suite#880. Tests for bf16 implementations will be added together with adding support for these to runtime in future PRs.
@t4c1 t4c1 requested a review from bader March 14, 2022 14:50
auto A = a_buf.get_access<access::mode::read>(cgh); \
auto D = d_buf.get_access<access::mode::write>(cgh); \
cgh.parallel_for(N / SZ, \
[=](id<1> index) { D[index] = NAME(A[index]); }); \
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it would be more efficient to have a kernel testing all functions instead of a kernel per function.

I don't know how to apply the same logic for different vector length (i.e. reduce # of test kernels), but we probably can consider allocating more buffers (e.g. one buffer per vector length).

bader
bader previously approved these changes Mar 21, 2022
Co-authored-by: Alexey Bader <alexey.bader@intel.com>
@t4c1
Copy link
Author

t4c1 commented Mar 28, 2022

Is this PR waiting for anything?

@bader
Copy link

bader commented Mar 28, 2022

Waiting on code owner review from intel/llvm-reviewers-runtime.
@intel/llvm-reviewers-runtime, @smaslov-intel, ping.

// RUN: %ACC_RUN_PLACEHOLDER %t.out

// OpenCL CPU driver does not support cl_khr_fp16 extension
// UNSUPPORTED: cpu && opencl

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

NIT: would it be better to test for the extension support in the source code itself?

Copy link

@smaslov-intel smaslov-intel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@againull againull merged commit 1f3ab2e into intel:intel Mar 28, 2022
myler pushed a commit to myler/llvm-test-suite that referenced this pull request Jun 17, 2022
Co-authored-by: Alexey Bader <alexey.bader@intel.com>
aelovikov-intel pushed a commit to aelovikov-intel/llvm that referenced this pull request Mar 27, 2023
Co-authored-by: Alexey Bader <alexey.bader@intel.com>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants