Skip to content

Commit 77e92ce

Browse files
authored
[SYCL][ESIMD] Fix several issues related to building of ESIMD on Windows (#6971)
1 parent be0905f commit 77e92ce

File tree

3 files changed

+30
-27
lines changed

3 files changed

+30
-27
lines changed

sycl/include/sycl/ext/intel/experimental/esimd/detail/math_intrin.hpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -551,11 +551,11 @@ __esimd_dpas_inner(const __ESIMD_DNS::vector_type_t<T0, SZ> *src0,
551551

552552
__ESIMD_DNS::vector_type_t<TmpAccEl, SIMDSize> simdAcc;
553553

554-
for (uint r = 0; r < repeat_count; r++) {
554+
for (unsigned r = 0; r < repeat_count; r++) {
555555
V = r;
556556
k = 0;
557557

558-
for (uint n = 0; n < SIMDSize; n++) {
558+
for (unsigned n = 0; n < SIMDSize; n++) {
559559
if (src0 != nullptr) {
560560
auto src0El = src0[0][r * SIMDSize + n];
561561

@@ -570,13 +570,13 @@ __esimd_dpas_inner(const __ESIMD_DNS::vector_type_t<T0, SZ> *src0,
570570
simdAcc[n] = 0;
571571
}
572572

573-
for (uint s = 0; s < systolic_depth; s++) {
573+
for (unsigned s = 0; s < systolic_depth; s++) {
574574
src1_ops_per_dword = 32 / (ops_per_chan * src1_el_bits);
575575
// U = s / src1_ops_per_dword;
576-
U = s >> uint(log2(src1_ops_per_dword));
576+
U = s >> unsigned(log2(src1_ops_per_dword));
577577

578-
for (uint n = 0; n < SIMDSize; n++) {
579-
for (uint d = 0; d < ops_per_chan; d++) {
578+
for (unsigned n = 0; n < SIMDSize; n++) {
579+
for (unsigned d = 0; d < ops_per_chan; d++) {
580580
p = d + (s % src1_ops_per_dword) * ops_per_chan;
581581
uint32_t extension_temp = false;
582582

@@ -618,7 +618,7 @@ __esimd_dpas_inner(const __ESIMD_DNS::vector_type_t<T0, SZ> *src0,
618618

619619
} // Systolic phase.
620620

621-
for (uint n = 0; n < SIMDSize; n++) {
621+
for (unsigned n = 0; n < SIMDSize; n++) {
622622
if constexpr (pvcBfDest) {
623623
// TODO: make abstraction, support saturation, review rounding algo for
624624
// corner cases.

sycl/include/sycl/ext/intel/experimental/esimd/math.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -988,8 +988,8 @@ template <typename RT, typename T0, int SZ,
988988
__ESIMD_API __ESIMD_NS::simd<RT, SZ> lzd(__ESIMD_NS::simd<T0, SZ> src0,
989989
Sat sat = {}) {
990990
// Saturation parameter ignored
991-
__ESIMD_NS::simd<uint, SZ> Src0 = src0;
992-
return __esimd_lzd<uint>(Src0.data());
991+
__ESIMD_NS::simd<__ESIMD_NS::uint, SZ> Src0 = src0;
992+
return __esimd_lzd<__ESIMD_NS::uint, SZ>(Src0.data());
993993
}
994994

995995
template <typename RT, typename T0, class Sat = __ESIMD_NS::saturation_off_tag>

sycl/test/esimd/regression/windows_build_test.cpp

Lines changed: 21 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -6,36 +6,39 @@
66
//
77
//===----------------------------------------------------------------------===//
88
// REQUIRES: windows
9-
// RUN: %clangxx -fsycl -fsycl-device-only -fsyntax-only -Xclang -verify %s -I %sycl_include
9+
// RUN: %clangxx -fsycl -fsyntax-only -Xclang -verify %s -I %sycl_include
1010
// expected-no-diagnostics
1111

1212
// The tests validates an ability to build ESIMD code on windows platform
1313

14-
#include <iostream>
1514
#include <CL/sycl.hpp>
15+
#include <iostream>
1616
#include <sycl/ext/intel/esimd.hpp>
17-
#include <sycl/ext/intel/experimental/esimd/memory.hpp>
1817

1918
class Kernel;
2019

21-
int main()
22-
{
20+
int main() {
2321
sycl::queue q;
2422
sycl::device dev = q.get_device();
2523
sycl::context ctx = q.get_context();
26-
std::cout << "Device: " << dev.get_info<sycl::info::device::name>() << std::endl;
27-
28-
int* buffer = (int*)sycl::aligned_alloc_device(128, 1024, q);
29-
30-
q.parallel_for<Kernel>(
31-
1,
32-
[=](sycl::item<1> it) SYCL_ESIMD_KERNEL {
33-
using namespace sycl::ext::intel::esimd;
34-
using namespace sycl::ext::intel::experimental::esimd;
35-
36-
simd<int, 32> blk;
37-
lsc_block_store<int, 32>(buffer, blk);
38-
});
24+
std::cout << "Device: " << dev.get_info<sycl::info::device::name>()
25+
<< std::endl;
26+
27+
int *buffer = (int *)sycl::aligned_alloc_device(128, 1024, q);
28+
29+
q.parallel_for<Kernel>(1, [=](sycl::item<1> it) SYCL_ESIMD_KERNEL {
30+
using namespace sycl::ext::intel::esimd;
31+
using namespace sycl::ext::intel::experimental::esimd;
32+
33+
simd<int, 32> blk;
34+
simd<sycl::ext::oneapi::experimental::bfloat16, 16> A;
35+
simd<sycl::ext::oneapi::experimental::bfloat16, 256> B;
36+
simd<float, 16> C;
37+
lzd<uint>(blk);
38+
lzd<uint>(35);
39+
sycl::ext::intel::esimd::xmx::dpas<8, 1, float>(C, B, A);
40+
lsc_block_store<int, 32>(buffer, blk);
41+
});
3942

4043
q.wait();
4144
sycl::free(buffer, q);

0 commit comments

Comments
 (0)