-
Notifications
You must be signed in to change notification settings - Fork 738
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[SYCL][ESIMD] Fix an issue causing a build break when building ESIMD …
…on Windows platform (#6789)
- Loading branch information
Showing
2 changed files
with
49 additions
and
5 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
//==------- Windows_build_test.cpp - DPC++ ESIMD build test ---------==// | ||
// | ||
// 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: windows | ||
// RUN: %clangxx -fsycl -fsycl-device-only -fsyntax-only -Xclang -verify %s -I %sycl_include | ||
// expected-no-diagnostics | ||
|
||
// The tests validates an ability to build ESIMD code on windows platform | ||
|
||
#include <iostream> | ||
#include <CL/sycl.hpp> | ||
#include <sycl/ext/intel/esimd.hpp> | ||
#include <sycl/ext/intel/experimental/esimd/memory.hpp> | ||
|
||
class Kernel; | ||
|
||
int main() | ||
{ | ||
sycl::queue q; | ||
sycl::device dev = q.get_device(); | ||
sycl::context ctx = q.get_context(); | ||
std::cout << "Device: " << dev.get_info<sycl::info::device::name>() << std::endl; | ||
|
||
int* buffer = (int*)sycl::aligned_alloc_device(128, 1024, q); | ||
|
||
q.parallel_for<Kernel>( | ||
1, | ||
[=](sycl::item<1> it) SYCL_ESIMD_KERNEL { | ||
using namespace sycl::ext::intel::esimd; | ||
using namespace sycl::ext::intel::experimental::esimd; | ||
|
||
simd<int, 32> blk; | ||
lsc_block_store<int, 32>(buffer, blk); | ||
}); | ||
|
||
q.wait(); | ||
sycl::free(buffer, q); | ||
std::cout << "Done" << std::endl; | ||
return 0; | ||
} |