forked from intel/llvm
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[SYCL][ESIMD] Implement slm_gather accepting compile-time properties (i…
- Loading branch information
Showing
8 changed files
with
806 additions
and
53 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
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
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,34 @@ | ||
//==------- slm_gather.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 | ||
// | ||
//===----------------------------------------------------------------------===// | ||
// Use per-kernel compilation to have more information about failing cases. | ||
// RUN: %{build} -fsycl-device-code-split=per_kernel -D__ESIMD_GATHER_SCATTER_LLVM_IR -o %t.out | ||
// RUN: %{run} %t.out | ||
|
||
// The test verifies esimd::slm_gather() functions accepting optional | ||
// compile-time esimd::properties. The slm_gather() calls in this test do not | ||
// use VS > 1 (number of loads per offset) to not impose using DG2/PVC features. | ||
|
||
#include "Inputs/gather.hpp" | ||
|
||
int main() { | ||
auto Q = queue{gpu_selector_v}; | ||
esimd_test::printTestLabel(Q); | ||
|
||
constexpr auto TestFeatures = TestFeatures::Generic; | ||
bool Passed = true; | ||
|
||
Passed &= testSLM<int8_t, TestFeatures>(Q); | ||
Passed &= testSLM<int16_t, TestFeatures>(Q); | ||
if (Q.get_device().has(sycl::aspect::fp16)) | ||
Passed &= testSLM<sycl::half, TestFeatures>(Q); | ||
Passed &= testSLM<uint32_t, TestFeatures>(Q); | ||
Passed &= testSLM<float, TestFeatures>(Q); | ||
Passed &= testSLM<ext::intel::experimental::esimd::tfloat32, TestFeatures>(Q); | ||
std::cout << (Passed ? "Passed\n" : "FAILED\n"); | ||
return Passed ? 0 : 1; | ||
} |
38 changes: 38 additions & 0 deletions
38
sycl/test-e2e/ESIMD/unified_memory_api/slm_gather_dg2_pvc.cpp
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,38 @@ | ||
//==------- slm_gather_dg2_pvc.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-dg2 || gpu-intel-pvc | ||
// RUN: %{build} -fsycl-device-code-split=per_kernel -o %t.out | ||
// RUN: %{run} %t.out | ||
|
||
// The test verifies esimd::slm_gather() functions accepting optional | ||
// compile-time esimd::properties. The slm_gather() calls in this test use | ||
// VS > 1 (number of loads per offset) and require DG2 or PVC to run. | ||
|
||
#include "Inputs/gather.hpp" | ||
|
||
int main() { | ||
auto Q = queue{gpu_selector_v}; | ||
esimd_test::printTestLabel(Q); | ||
|
||
// DG2 and PVC support same gather() configurations. If some gather call | ||
// has corresponding instructions in PVC and does not have it in DG2, then | ||
// GPU RT emulates it for DG2. | ||
constexpr auto TestFeatures = TestFeatures::DG2; | ||
bool Passed = true; | ||
|
||
Passed &= testSLM<int8_t, TestFeatures>(Q); | ||
Passed &= testSLM<int16_t, TestFeatures>(Q); | ||
if (Q.get_device().has(sycl::aspect::fp16)) | ||
Passed &= testSLM<sycl::half, TestFeatures>(Q); | ||
Passed &= testSLM<uint32_t, TestFeatures>(Q); | ||
Passed &= testSLM<float, TestFeatures>(Q); | ||
Passed &= testSLM<ext::intel::experimental::esimd::tfloat32, TestFeatures>(Q); | ||
|
||
std::cout << (Passed ? "Passed\n" : "FAILED\n"); | ||
return Passed ? 0 : 1; | ||
} |
Oops, something went wrong.