Skip to content

Commit

Permalink
Merge pull request #1751 from hdelan/deprecated-header
Browse files Browse the repository at this point in the history
[NFC] Use sycl/sycl.hpp instead of CL/sycl.hpp
  • Loading branch information
kbenzie committed Jun 13, 2024
2 parents de17134 + 7f25504 commit f23ee23
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 16 deletions.
18 changes: 9 additions & 9 deletions test/conformance/device_code/cpy_and_mult.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,24 +3,24 @@
// See LICENSE.TXT
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

#include <CL/sycl.hpp>
#include <sycl/sycl.hpp>

int main() {
size_t array_size = 16;
cl::sycl::queue sycl_queue;
sycl::queue sycl_queue;
std::vector<uint32_t> src(array_size, 1);
std::vector<uint32_t> dst(array_size, 1);
auto src_buff =
cl::sycl::buffer<uint32_t>(src.data(), cl::sycl::range<1>(array_size));
sycl::buffer<uint32_t>(src.data(), sycl::range<1>(array_size));
auto dst_buff =
cl::sycl::buffer<uint32_t>(dst.data(), cl::sycl::range<1>(array_size));
sycl::buffer<uint32_t>(dst.data(), sycl::range<1>(array_size));

sycl_queue.submit([&](cl::sycl::handler &cgh) {
auto src_acc = src_buff.get_access<cl::sycl::access::mode::read>(cgh);
auto dst_acc = dst_buff.get_access<cl::sycl::access::mode::write>(cgh);
sycl_queue.submit([&](sycl::handler &cgh) {
auto src_acc = src_buff.get_access<sycl::access::mode::read>(cgh);
auto dst_acc = dst_buff.get_access<sycl::access::mode::write>(cgh);
cgh.parallel_for<class cpy_and_mult>(
cl::sycl::range<1>{array_size},
[src_acc, dst_acc](cl::sycl::item<1> itemId) {
sycl::range<1>{array_size},
[src_acc, dst_acc](sycl::item<1> itemId) {
auto id = itemId.get_id(0);
dst_acc[id] = src_acc[id] * 2;
});
Expand Down
13 changes: 6 additions & 7 deletions test/conformance/device_code/cpy_and_mult_usm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,16 @@
// See LICENSE.TXT
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

#include <CL/sycl.hpp>
#include <sycl/sycl.hpp>

int main() {
size_t array_size = 16;
cl::sycl::queue sycl_queue;
uint32_t *src = cl::sycl::malloc_device<uint32_t>(array_size, sycl_queue);
uint32_t *dst = cl::sycl::malloc_device<uint32_t>(array_size, sycl_queue);
sycl_queue.submit([&](cl::sycl::handler &cgh) {
sycl::queue sycl_queue;
uint32_t *src = sycl::malloc_device<uint32_t>(array_size, sycl_queue);
uint32_t *dst = sycl::malloc_device<uint32_t>(array_size, sycl_queue);
sycl_queue.submit([&](sycl::handler &cgh) {
cgh.parallel_for<class cpy_and_mult_usm>(
cl::sycl::range<1>{array_size},
[src, dst](cl::sycl::item<1> itemId) {
sycl::range<1>{array_size}, [src, dst](sycl::item<1> itemId) {
auto id = itemId.get_id(0);
dst[id] = src[id] * 2;
});
Expand Down

0 comments on commit f23ee23

Please sign in to comment.