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

[SYCL][ESIMD]Add tests for lsc_block_load supporting 8/16 bit data #1249

Merged
merged 2 commits into from
Sep 27, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions SYCL/ESIMD/lsc/Inputs/lsc_surf_load.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,6 @@ bool test(uint32_t pmask = 0xffffffff) {
}

static_assert(DS != lsc_data_size::u16u32h, "D16U32h not supported in HW");
static_assert(sizeof(T) >= 4,
"D8 and D16 are valid only in 2D block load/store");

if constexpr (!transpose && VS > 1) {
static_assert(VL == 16 || VL == 32,
Expand Down
2 changes: 0 additions & 2 deletions SYCL/ESIMD/lsc/Inputs/lsc_surf_store.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,6 @@ bool test(uint32_t pmask = 0xffffffff) {
}

static_assert(DS != lsc_data_size::u16u32h, "D16U32h not supported in HW");
static_assert(sizeof(T) >= 4,
"D8 and D16 are valid only in 2D block load/store");

if constexpr (!transpose && VS > 1) {
static_assert(VL == 16 || VL == 32,
Expand Down
2 changes: 0 additions & 2 deletions SYCL/ESIMD/lsc/Inputs/lsc_usm_load.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,6 @@ bool test(uint32_t pmask = 0xffffffff) {
}

static_assert(DS != lsc_data_size::u16u32h, "D16U32h not supported in HW");
static_assert(sizeof(T) >= 4,
"D8 and D16 are valid only in 2D block load/store");

if constexpr (!transpose && VS > 1) {
static_assert(VL == 16 || VL == 32,
Expand Down
2 changes: 0 additions & 2 deletions SYCL/ESIMD/lsc/Inputs/lsc_usm_store.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,6 @@ bool test(uint32_t pmask = 0xffffffff) {
}

static_assert(DS != lsc_data_size::u16u32h, "D16U32h not supported in HW");
static_assert(sizeof(T) >= 4,
"D8 and D16 are valid only in 2D block load/store");

if constexpr (!transpose && VS > 1) {
static_assert(VL == 16 || VL == 32,
Expand Down
35 changes: 35 additions & 0 deletions SYCL/ESIMD/lsc/lsc_surf_load_u8_u16.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
//==------- lsc_surf_load_u8_u16.cpp - DPC++ ESIMD on-device 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: gpu-intel-pvc || esimd_emulator
// UNSUPPORTED: cuda || hip
// RUN: %clangxx -fsycl %s -o %t.out
// RUN: %GPU_RUN_PLACEHOLDER %t.out

#include "Inputs/lsc_surf_load.hpp"

constexpr uint32_t seed = 199;

template <int TestCastNum, typename T> bool tests() {
bool passed = true;
passed &= test<TestCastNum, T, 1, 4, 1, 32, true>();
passed &= test<TestCastNum + 1, T, 2, 2, 1, 16, true>();
passed &= test<TestCastNum + 2, T, 4, 4, 1, 4, true>();

return passed;
}

int main(void) {
srand(seed);
bool passed = true;

passed &= tests<0, uint8_t>();
passed &= tests<3, uint16_t>();

std::cout << (passed ? "Passed\n" : "FAILED\n");
return passed ? 0 : 1;
}
35 changes: 35 additions & 0 deletions SYCL/ESIMD/lsc/lsc_surf_store_u8_u16.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
//==------- lsc_surf_store_u8_u16.cpp - DPC++ ESIMD on-device 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: gpu-intel-pvc || esimd_emulator
// UNSUPPORTED: cuda || hip
// RUN: %clangxx -fsycl %s -o %t.out
// RUN: %GPU_RUN_PLACEHOLDER %t.out

#include "Inputs/lsc_surf_store.hpp"

constexpr uint32_t seed = 199;

template <int TestCastNum, typename T> bool tests() {
bool passed = true;
passed &= test<TestCastNum, T, 1, 4, 1, 32, true>();
passed &= test<TestCastNum + 1, T, 2, 2, 1, 16, true>();
passed &= test<TestCastNum + 2, T, 4, 4, 1, 4, true>();

return passed;
}

int main(void) {
srand(seed);
bool passed = true;

passed &= tests<0, uint8_t>();
passed &= tests<3, uint16_t>();

std::cout << (passed ? "Passed\n" : "FAILED\n");
return passed ? 0 : 1;
}
35 changes: 35 additions & 0 deletions SYCL/ESIMD/lsc/lsc_usm_load_u8_u16.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
//==------- lsc_usm_load_u8_u16.cpp - DPC++ ESIMD on-device 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: gpu-intel-pvc || esimd_emulator
// UNSUPPORTED: cuda || hip
// RUN: %clangxx -fsycl %s -o %t.out
// RUN: %GPU_RUN_PLACEHOLDER %t.out

#include "Inputs/lsc_usm_load.hpp"

constexpr uint32_t seed = 199;

template <int TestCastNum, typename T> bool tests() {
bool passed = true;
passed &= test<TestCastNum, T, 1, 4, 1, 32, true>();
passed &= test<TestCastNum + 1, T, 2, 2, 1, 16, true>();
passed &= test<TestCastNum + 2, T, 4, 4, 1, 4, true>();

return passed;
}

int main(void) {
srand(seed);
bool passed = true;

passed &= tests<0, uint8_t>();
passed &= tests<3, uint16_t>();

std::cout << (passed ? "Passed\n" : "FAILED\n");
return passed ? 0 : 1;
}
35 changes: 35 additions & 0 deletions SYCL/ESIMD/lsc/lsc_usm_store_u8_u16.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
//==------- lsc_usm_store_u8_u16.cpp - DPC++ ESIMD on-device 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: gpu-intel-pvc || esimd_emulator
// UNSUPPORTED: cuda || hip
// RUN: %clangxx -fsycl %s -o %t.out
// RUN: %GPU_RUN_PLACEHOLDER %t.out

#include "Inputs/lsc_usm_store.hpp"

constexpr uint32_t seed = 199;

template <int TestCastNum, typename T> bool tests() {
bool passed = true;
passed &= test<TestCastNum, T, 1, 4, 1, 32, true>();
passed &= test<TestCastNum + 1, T, 2, 2, 1, 16, true>();
passed &= test<TestCastNum + 2, T, 4, 4, 1, 4, true>();

return passed;
}

int main(void) {
srand(seed);
bool passed = true;

passed &= tests<0, uint8_t>();
passed &= tests<3, uint16_t>();

std::cout << (passed ? "Passed\n" : "FAILED\n");
return passed ? 0 : 1;
}