Skip to content

[SYCL][ESIMD] Add ESIMD tests on TPM #5

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 66 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
66 commits
Select commit Hold shift + click to select a range
ad00dbf
[SYCL] dpc++ tests
vladimirlaz May 21, 2020
91b44b3
Pulldown for community changes
vladimirlaz Jun 24, 2020
d7ad9ce
Remove unstable tests and fix framework issues
vladimirlaz Jun 25, 2020
ed14f43
[SYCL] Test for error build-log if exceeded arguments size limit.
smaslov-intel Jul 7, 2020
07d05d1
Update SYCL/Basic/regression/build_log.cpp
smaslov-intel Jul 9, 2020
2d7522e
Add ability to pass extra environment variables to tests
vladimirlaz Jul 21, 2020
20cb6c1
Added support for new CPU architectures
vladimirlaz Jul 22, 2020
b3b4f9c
Add possibility to iteratively execute SYCL tests for specified backe…
vladimirlaz Jul 22, 2020
e42da89
Make LIT infra respect CMAKE_CXX_FLAGS and CMAKE_C_FLAGS variables
vladimirlaz Jul 22, 2020
f5a24ab
Add library search paths on windows
vladimirlaz Jul 24, 2020
e119c17
Fix build issue
vladimirlaz Jul 24, 2020
0e1c36c
Merge llvm/llvm-test-suite master branch into intel
vladimirlaz Jul 30, 2020
eac64f8
Merge pull request #13 from intel/pulldown
vladimirlaz Jul 30, 2020
b9f1223
Fix tests according to recent changes in compiler
vladimirlaz Jul 30, 2020
4d3f7d9
Fix unstable test
vladimirlaz Aug 10, 2020
ff22962
Add compatibility for renaming SYCL namespaces
vladimirlaz Aug 14, 2020
a0ddc70
[SYCL] Changing PI_LEVEL0 to PI_LEVEL_ZERO.
glyons-intel Aug 19, 2020
79bdb16
Regression test for zeCommandListCreate()
glyons-intel Aug 19, 2020
78eb8cf
Incorporating code review comments.
glyons-intel Aug 19, 2020
4dda44e
Disable test on windows due to hang there
vladimirlaz Aug 21, 2020
a4a85e0
Disable test on CUDA
vladimirlaz Aug 21, 2020
26bbeac
Add infrastructure for use external applications as SYCL tests
vladimirlaz Aug 21, 2020
303245e
Remove unstable tests
vladimirlaz Aug 31, 2020
28d8e53
Use all target devices for AOT GPU compilation
vladimirlaz Aug 31, 2020
0c5b35d
Merge remote-tracking branch master into pulldown
vladimirlaz Sep 2, 2020
3d7a270
Merge pull request #22 from intel/pulldown
vladimirlaz Sep 2, 2020
7f6a849
Add support for executing LIT tests from external directory
vladimirlaz Sep 4, 2020
9fac9f9
create check verifying LLVM format compatibility
vladimirlaz Sep 11, 2020
d667458
Fix target branch for GitHub Action workflow
vladimirlaz Sep 11, 2020
9fa3b6c
Update clang-format.yml
vladimirlaz Sep 11, 2020
808b228
[SYCL] Improve project documentation (#24)
vladimirlaz Sep 14, 2020
10ca23a
Apply changes from intel/llvm #1963
jtmott-intel Sep 16, 2020
df2724a
[SYCL] Apply post-commit comments for the documentation (#25)
vladimirlaz Sep 18, 2020
48dfdf2
[SYCL] Update devicelib tests with latest changes in intel/llvm (#27)
vladimirlaz Sep 18, 2020
7fd62f4
Merge pull request #28 from llvm/master
vladimirlaz Oct 6, 2020
de3ccba
[SYCL] add ESIMD tests (#29)
vladimirlaz Oct 8, 2020
1f0b533
[SYCL] fix allowlist test build with VS 2019 u3 (#31)
vladimirlaz Oct 12, 2020
3906c29
[SYCL][ESIMD] Add ESIMD PrefixSum kernel tests. (#30)
kychendev Oct 13, 2020
c97c9ad
Add inline asm tests (#32)
vladimirlaz Oct 13, 2020
6d15120
[SYCL][ESIMD] Add ESIMD tests on constants specialization. (#35)
davoroni Oct 16, 2020
5ee56a3
[SYCL] next portion of the tests (#33)
vladimirlaz Oct 16, 2020
5274b13
[SYCL][ESIMD] Pass -vc-codegen instead of -cmc option to backend comp…
DenisBakhvalov Oct 16, 2020
a081db5
[SYCL] add extra tests (#37)
vladimirlaz Oct 20, 2020
fca698d
Fix tests after move of Scheduler out of Basic (#38)
vladimirlaz Oct 20, 2020
dffe2c6
[SYCL] Enable tests for accelerator on windows (#39)
vladimirlaz Oct 22, 2020
1f65b98
Disable flaky test on windows (#40)
vladimirlaz Oct 22, 2020
255d371
[SYCL] Update for the new format of sycl-ls (#42)
smaslov-intel Oct 28, 2020
884589a
[SYCL][ESIMD] Fixed mandelbrot tests on Windows (#44)
DenisBakhvalov Oct 30, 2020
add04f2
[SYCL][ESIMD] Fix compilation error in linear.cpp (#45)
DenisBakhvalov Oct 30, 2020
06d1b04
[SYCL][ESIMD] Fixed stack overflow crash on Windows (#41)
DenisBakhvalov Nov 2, 2020
adeb4f5
[SYCL] add host-task-dependency test (#46)
alexanderfle Nov 2, 2020
a0d367e
[SYCL] Fix test build with MS VS 2019 (#47)
vladimirlaz Nov 3, 2020
06f7e96
[SYCL] Disable AtomicRef tests on accelerator (#48)
vladimirlaz Nov 3, 2020
db39e47
[SYCL] Fix misprints in RUN commands (#49)
vladimirlaz Nov 3, 2020
c1d0c1c
[SYCL] Add tests from intel/llvm (#50)
vladimirlaz Nov 9, 2020
2d72042
[SYCL][ESIMD] Add tests for accessor-based gather/scatter and scalar …
kbobrovs Nov 11, 2020
dc00697
[SYCL] Enable group algorithms leader test on CUDA (#52)
alexbatashev Nov 11, 2020
0940977
[SYCL] Fix test issues (#54)
vladimirlaz Nov 16, 2020
33b09c2
[LIT] Enable function pointers tests back for L0 (#53)
dm-vodopyanov Nov 17, 2020
d0423ad
[SYCL][ESIMD] - Enable ESIMD tests through L0 (#57)
DenisBakhvalov Nov 23, 2020
5db23ae
[SYCL] Move CUDA program interop test from intel/llvm (#56)
alexbatashev Nov 23, 2020
dd40173
[SYCL] Improve tests for SYCL_DEVICE_FILTER (#59)
vladimirlaz Nov 30, 2020
27ff1c0
[SYCL] Test multiple build options handling for opencl-aot (#58)
vmaksimo Nov 30, 2020
7bdaced
Fix misprint in run command
vladimirlaz Nov 30, 2020
61569ec
Revert "[SYCL] Test multiple build options handling for opencl-aot (#…
vladimirlaz Dec 1, 2020
5d55ee2
ESIMD: add TPM tests
fveselov Dec 3, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
34 changes: 34 additions & 0 deletions .github/workflows/clang-format.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: clang-format-check

on:
pull_request:
branches:
- intel

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Get clang-format first
run: sudo apt-get install -yqq clang-format-9

- uses: actions/checkout@v2
with:
fetch-depth: 2

- name: Get clang-format-diff.py tool
run: |
wget https://raw.githubusercontent.com/intel/llvm/sycl/clang/tools/clang-format/clang-format-diff.py
chmod u+x clang-format-diff.py

- name: Run clang-format for the patch
run: |
git diff -U0 --no-color ${GITHUB_SHA}^1 ${GITHUB_SHA} -- | python clang-format-diff.py -p1 -binary clang-format-9 > ./clang-format.patch
# Add patch with formatting fixes to CI job artifacts
- uses: actions/upload-artifact@v1
with:
name: clang-format-patch
path: ./clang-format.patch

- name: Check if clang-format patch is empty
run: bash -c "if [ -s ./clang-format.patch ]; then cat ./clang-format.patch; exit 1; fi"
72 changes: 72 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
# Contributing

## License

This project is licensed under the terms of the Apache License v2.0 with LLVM
Exceptions license ([LICENSE.txt](LICENSE.TXT)) to ensure our ability to
contribute this project to the LLVM test suite project under the same license.

By contributing to this project, you agree to the Apache License v2.0 with LLVM
Exceptions and copyright terms there in and release your contribution under
these terms.

## Contribution process

### Development

For any changes not related to DPC++, but rather to LLVM in general, it is
strongly encouraged that you submit the patch to https://github.com/llvm/llvm-test-suite directly.
See [LLVM contribution guidelines](https://llvm.org/docs/Contributing.html)
for more information.

- Create a personal fork of the project on GitHub
- For the DPC++ end-to-end test development, use **intel** branch as baseline
for your changes.
- Prepare your patch
- follow [LLVM coding standards](https://llvm.org/docs/CodingStandards.html)
- [clang-format](https://clang.llvm.org/docs/ClangFormat.html) and
[clang-tidy](https://clang.llvm.org/extra/clang-tidy/) tools can be
integrated into your workflow to ensure formatting and stylistic
compliance of your changes.
- use

```bash
wget https://raw.githubusercontent.com/intel/llvm/sycl/clang/tools/clang-format/git-clang-format
python git-clang-format `git merge-base origin/intel HEAD`
```

to check the format of your current changes against the `origin/intel`
branch.
- `-f` to also correct unstaged changes
- `--diff` to only print the diff without applying
- Instructions about running DPC++ tests
- see [README.md](SYCL/README.md).

### Commit message

- When writing your commit message, please make sure to follow
[LLVM developer policies](
https://llvm.org/docs/DeveloperPolicy.html#commit-messages) on the subject.
- For any DPC++-related commit, the `[SYCL]` tag should be present in the
commit message title. To a reasonable extent, additional tags can be used
to signify the component changed, e.g.: `[LIT]`, `[NFC]`, `[Doc]`.

### Review and acceptance testing

- Create a pull request for your changes following [Creating a pull request
instructions](https://help.github.com/articles/creating-a-pull-request/).
- CI will run checks (e.g. clang-format-check) as soon as the PR is created.
- Once the PR is approved and all checks have passed, the pull request is
ready for merge.

### Merge

Project maintainers merge pull requests using one of the following options:

- [Rebase and merge] The preferable choice for PRs containing a single commit
- [Squash and merge] Used when there are multiple commits in the PR
- Squashing is done to make sure that the project is buildable on any commit
- [Create a merge commit] Used for LLVM pull-down PRs to preserve hashes of the
commits pulled from the LLVM community repository

*Other names and brands may be claimed as the property of others.
27 changes: 27 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# LLVM* test suite repository

Please see the LLVM testing infrastructure guide:

https://llvm.org/docs/TestSuiteGuide.html

for more information on the contents of this repository.

## Introduction

Intel staging area for LLVM test suite contribution. Home for oneAPI Data
Parallel C++ compiler tests extending LLVM test suite.

## License

See [LICENSE.txt](LICENSE.TXT) for details.

## Contributing

See [CONTRIBUTING.md](CONTRIBUTING.md) for details.

## Related projects documentation

* oneAPI Data Parallel C++ compiler - See
[DPC++ Documentation](https://intel.github.io/llvm-docs/)

\*Other names and brands may be claimed as the property of others.
2 changes: 2 additions & 0 deletions SYCL/.clang-format
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
BasedOnStyle: LLVM
CommentPragmas: "(RUN|FAIL|REQUIRES|UNSUPPORTED|CHECK) *:|expected-"
75 changes: 75 additions & 0 deletions SYCL/AOT/Inputs/aot.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
//==--- aot.cpp - Simple vector addition (AOT compilation example) --------==//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===---------------------------------------------------------------------===//

#include <CL/sycl.hpp>

#include <array>
#include <iostream>

constexpr cl::sycl::access::mode sycl_read = cl::sycl::access::mode::read;
constexpr cl::sycl::access::mode sycl_write = cl::sycl::access::mode::write;

template <typename T> class SimpleVadd;

template <typename T, size_t N>
void simple_vadd(const std::array<T, N> &VA, const std::array<T, N> &VB,
std::array<T, N> &VC) {
cl::sycl::queue deviceQueue([](cl::sycl::exception_list ExceptionList) {
for (cl::sycl::exception_ptr_class ExceptionPtr : ExceptionList) {
try {
std::rethrow_exception(ExceptionPtr);
} catch (cl::sycl::exception &E) {
std::cerr << E.what();
} catch (...) {
std::cerr << "Unknown async exception was caught." << std::endl;
}
}
});

cl::sycl::range<1> numOfItems{N};
cl::sycl::buffer<T, 1> bufferA(VA.data(), numOfItems);
cl::sycl::buffer<T, 1> bufferB(VB.data(), numOfItems);
cl::sycl::buffer<T, 1> bufferC(VC.data(), numOfItems);

deviceQueue.submit([&](cl::sycl::handler &cgh) {
auto accessorA = bufferA.template get_access<sycl_read>(cgh);
auto accessorB = bufferB.template get_access<sycl_read>(cgh);
auto accessorC = bufferC.template get_access<sycl_write>(cgh);

cgh.parallel_for<class SimpleVadd<T>>(numOfItems,
[=](cl::sycl::id<1> wiID) {
accessorC[wiID] = accessorA[wiID] + accessorB[wiID];
});
});

deviceQueue.wait_and_throw();
}

int main() {
const size_t array_size = 4;
std::array<cl::sycl::cl_int, array_size> A = {{1, 2, 3, 4}},
B = {{1, 2, 3, 4}}, C;
std::array<cl::sycl::cl_float, array_size> D = {{1.f, 2.f, 3.f, 4.f}},
E = {{1.f, 2.f, 3.f, 4.f}}, F;
simple_vadd(A, B, C);
simple_vadd(D, E, F);
for (unsigned int i = 0; i < array_size; i++) {
if (C[i] != A[i] + B[i]) {
std::cout << "The results are incorrect (element " << i << " is " << C[i]
<< "!\n";
return 1;
}
if (F[i] != D[i] + E[i]) {
std::cout << "The results are incorrect (element " << i << " is " << F[i]
<< "!\n";
return 1;
}
}
std::cout << "The results are correct!\n";
return 0;
}
12 changes: 12 additions & 0 deletions SYCL/AOT/accelerator.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
//==--- accelerator.cpp - AOT compilation for fpga devices using aoc ------==//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===---------------------------------------------------------------------===//

// REQUIRES: aoc, accelerator

// RUN: %clangxx -fsycl -fsycl-targets=spir64_fpga-unknown-unknown-sycldevice %S/Inputs/aot.cpp -o %t.out
// RUN: %ACC_RUN_PLACEHOLDER %t.out
12 changes: 12 additions & 0 deletions SYCL/AOT/cpu.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
//==--- cpu.cpp - AOT compilation for cpu devices using opencl-aot --------==//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===---------------------------------------------------------------------===//

// REQUIRES: opencl-aot, cpu

// RUN: %clangxx -fsycl -fsycl-targets=spir64_x86_64-unknown-unknown-sycldevice %S/Inputs/aot.cpp -o %t.out
// RUN: %CPU_RUN_PLACEHOLDER %t.out
14 changes: 14 additions & 0 deletions SYCL/AOT/gpu.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
//==--- gpu.cpp - AOT compilation for gen devices using GEN compiler ------==//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===---------------------------------------------------------------------===//

// REQUIRES: ocloc, gpu
// UNSUPPORTED: cuda
// CUDA is not compatible with SPIR.

// RUN: %clangxx -fsycl -fsycl-targets=spir64_gen-unknown-unknown-sycldevice -Xsycl-target-backend=spir64_gen-unknown-unknown-sycldevice "-device *" %S/Inputs/aot.cpp -o %t.out
// RUN: %GPU_RUN_PLACEHOLDER %t.out
67 changes: 67 additions & 0 deletions SYCL/AOT/multiple-devices.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
//==-- multiple-devices.cpp - Appropriate AOT-compiled image selection -----==//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//

// REQUIRES: opencl-aot, ocloc, aoc, cpu, gpu, accelerator
// UNSUPPORTED: cuda
// CUDA is not compatible with SPIR.

// 1-command compilation case
// Targeting CPU, GPU, FPGA
// RUN: %clangxx -fsycl -fsycl-targets=spir64_x86_64-unknown-unknown-sycldevice,spir64_gen-unknown-unknown-sycldevice,spir64_fpga-unknown-unknown-sycldevice -Xsycl-target-backend=spir64_gen-unknown-unknown-sycldevice "-device *" %S/Inputs/aot.cpp -o %t_all.out
// RUN: %HOST_RUN_PLACEHOLDER %t_all.out
// RUN: %CPU_RUN_PLACEHOLDER %t_all.out
// RUN: %GPU_RUN_PLACEHOLDER %t_all.out
// RUN: %ACC_RUN_PLACEHOLDER %t_all.out

// Produce object file, spirv, device images to combine these differently
// at link-time, thus testing various AOT-compiled images configurations
// RUN: %clangxx -fsycl %S/Inputs/aot.cpp -c -o %t.o
// RUN: %clangxx -fsycl -fsycl-link-targets=spir64-unknown-unknown-sycldevice %t.o -o %t.spv
// AOT-compile device binary images
// RUN: opencl-aot %t.spv -o=%t_cpu.ir --device=cpu
// RUN: ocloc -file %t.spv -spirv_input -output %t_gen.out -output_no_suffix -device cfl
// RUN: aoc %t.spv -o %t_fpga.aocx -sycl -dep-files=%t.d

// CPU, GPU
// RUN: %clangxx -fsycl -fsycl-add-targets=spir64_x86_64:%t_cpu.ir,spir64_gen:%t_gen.out %t.o -o %t_cpu_gpu.out
// RUN: %HOST_RUN_PLACEHOLDER %t_cpu_gpu.out
// RUN: %CPU_RUN_PLACEHOLDER %t_cpu_gpu.out
// RUN: %GPU_RUN_PLACEHOLDER %t_cpu_gpu.out

// CPU, FPGA
// RUN: %clangxx -fsycl -fsycl-add-targets=spir64_x86_64:%t_cpu.ir,spir64_fpga:%t_fpga.aocx %t.o -o %t_cpu_fpga.out
// RUN: %HOST_RUN_PLACEHOLDER %t_cpu_fpga.out
// RUN: %CPU_RUN_PLACEHOLDER %t_cpu_fpga.out
// RUN: %ACC_RUN_PLACEHOLDER %t_cpu_fpga.out

// GPU, FPGA
// RUN: %clangxx -fsycl -fsycl-add-targets=spir64_gen:%t_gen.out,spir64_fpga:%t_fpga.aocx %t.o -o %t_gpu_fpga.out
// RUN: %HOST_RUN_PLACEHOLDER %t_gpu_fpga.out
// RUN: %GPU_RUN_PLACEHOLDER %t_gpu_fpga.out
// RUN: %ACC_RUN_PLACEHOLDER %t_gpu_fpga.out

// No AOT-compiled image for CPU
// RUN: %clangxx -fsycl -fsycl-add-targets=spir64:%t.spv,spir64_gen:%t_gen.out,spir64_fpga:%t_fpga.aocx %t.o -o %t_spv_gpu_fpga.out
// RUN: %CPU_RUN_PLACEHOLDER %t_spv_gpu_fpga.out
// Check that execution on AOT-compatible devices is unaffected
// RUN: %GPU_RUN_PLACEHOLDER %t_spv_gpu_fpga.out
// RUN: %ACC_RUN_PLACEHOLDER %t_spv_gpu_fpga.out

// No AOT-compiled image for GPU
// RUN: %clangxx -fsycl -fsycl-add-targets=spir64:%t.spv,spir64_x86_64:%t_cpu.ir,spir64_fpga:%t_fpga.aocx %t.o -o %t_spv_cpu_fpga.out
// RUN: %GPU_RUN_PLACEHOLDER %t_spv_cpu_fpga.out
// Check that execution on AOT-compatible devices is unaffected
// RUN: %CPU_RUN_PLACEHOLDER %t_spv_cpu_fpga.out
// RUN: %ACC_RUN_PLACEHOLDER %t_spv_cpu_fpga.out

// No AOT-compiled image for FPGA
// RUN: %clangxx -fsycl -fsycl-add-targets=spir64:%t.spv,spir64_x86_64:%t_cpu.ir,spir64_gen:%t_gen.out %t.o -o %t_spv_cpu_gpu.out
// RUN: %ACC_RUN_PLACEHOLDER %t_spv_cpu_gpu.out
// Check that execution on AOT-compatible devices is unaffected
// RUN: %CPU_RUN_PLACEHOLDER %t_spv_cpu_gpu.out
// RUN: %GPU_RUN_PLACEHOLDER %t_spv_cpu_gpu.out
64 changes: 64 additions & 0 deletions SYCL/AOT/spec_const_aot.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
// REQUIRES: opencl-aot, cpu
//
// RUN: %clangxx -fsycl -fsycl-targets=spir64_x86_64-unknown-unknown-sycldevice %s -o %t.out
// RUN: %CPU_RUN_PLACEHOLDER %t.out
//
// The test checks that the specialization constant feature works with ahead
// of time compilation.

#include <CL/sycl.hpp>

#include <iostream>
#include <vector>

class MyInt32Const;

using namespace sycl;

class Kernel;

int main(int argc, char **argv) {
cl::sycl::queue q(default_selector{}, [](exception_list l) {
for (auto ep : l) {
try {
std::rethrow_exception(ep);
} catch (cl::sycl::exception &e0) {
std::cout << e0.what();
} catch (std::exception &e1) {
std::cout << e1.what();
} catch (...) {
std::cout << "*** catch (...)\n";
}
}
});

std::cout << "Running on " << q.get_device().get_info<info::device::name>()
<< "\n";
cl::sycl::program prog(q.get_context());

cl::sycl::ONEAPI::experimental::spec_constant<int32_t, MyInt32Const> i32 =
prog.set_spec_constant<MyInt32Const>(10);

prog.build_with_kernel_type<Kernel>();

std::vector<int> vec(1);
{
cl::sycl::buffer<int, 1> buf(vec.data(), vec.size());

q.submit([&](cl::sycl::handler &cgh) {
auto acc = buf.get_access<cl::sycl::access::mode::write>(cgh);
cgh.single_task<Kernel>(prog.get_kernel<Kernel>(),
[=]() { acc[0] = i32.get(); });
});
}
bool passed = true;
int val = vec[0];
int gold = 0; // with AOT, spec constant is set to C++ default for the type

if (val != gold) {
std::cout << "*** ERROR: " << val << " != " << gold << "(gold)\n";
passed = false;
}
std::cout << (passed ? "passed\n" : "FAILED\n");
return passed ? 0 : 1;
}
Loading