This repository was archived by the owner on Mar 28, 2023. It is now read-only.
forked from llvm/llvm-test-suite
-
Notifications
You must be signed in to change notification settings - Fork 131
[SYCL][ESIMD][EMU] Marking ESIMD kernels for esimd_emulator backend #751
Merged
kbobrovs
merged 22 commits into
intel:intel
from
dongkyunahn-intel:invoke_esimd_emulator_check_in
Feb 8, 2022
Merged
Changes from all commits
Commits
Show all changes
22 commits
Select commit
Hold shift + click to select a range
6197b60
Duplicating ESIMD samples for esimd_emulator
dongkyunahn-intel c5b6567
Adding 'esimd_emualtor' as supported SYCL backend
dongkyunahn-intel 68c4c1f
Revert "Adding 'esimd_emualtor' as supported SYCL backend"
dongkyunahn-intel 08c0158
Reverting changes in 'SYCL/ESIMD/sycl_esimd_mix.cpp'
dongkyunahn-intel 1febb1b
Fixing typo in comment for SYCL/ESIMD/vadd_1d.cpp
dongkyunahn-intel 647368d
Apply suggestions from code review
dongkyunahn-intel bbc31d9
Marking ESIMD kernels 'UNSUPPORTED' for esimd_emulator backend
dongkyunahn-intel 18df6bb
clang-format error fix
dongkyunahn-intel d61e3be
Merge branch 'intel' of https://github.com/intel/llvm-test-suite into…
dongkyunahn-intel b5bb143
XFAIL markups replacing UNSUPPORTED
dongkyunahn-intel c213138
clang-format fix
dongkyunahn-intel 092f7c1
'esimd_emulator' as deprecated name for 'ext_intel_esimd_emulator'
dongkyunahn-intel cb09441
Missing TODO comments for esimd_emulator support markup
dongkyunahn-intel c53aa85
Adding dummy codes to invoke piProgramBuild for vc_codegen
dongkyunahn-intel 697e3bd
Removing HOST_RUN_PLACEHOLDER for ESIMD Kernels
dongkyunahn-intel bbdb607
Recovering 'esimd_check_vc_codegen.cpp' to its initial import version
dongkyunahn-intel a4c51cc
Merge branch 'intel' of https://github.com/intel/llvm-test-suite into…
dongkyunahn-intel e70bab1
Merge branch 'intel' of https://github.com/intel/llvm-test-suite into…
dongkyunahn-intel a97e08f
Changing 'UNSUPPORTED' to 'XFAIL' for esimd_emulator backend
dongkyunahn-intel b6601cf
Marking 'XFAIL' for newly added tests
dongkyunahn-intel 6580013
Revert "Removing HOST_RUN_PLACEHOLDER for ESIMD Kernels"
dongkyunahn-intel 4c955cf
Revert "'esimd_emulator' as deprecated name for 'ext_intel_esimd_emul…
dongkyunahn-intel File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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,104 @@ | ||||||||||||||||||||||||||||||||||||||||||||||||||
//==-------- esimd_check_vc_codegen.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 | ||||||||||||||||||||||||||||||||||||||||||||||||||
// UNSUPPORTED: cuda || hip | ||||||||||||||||||||||||||||||||||||||||||||||||||
// esimd_emulator does not support online-compiler that invokes 'piProgramBuild' | ||||||||||||||||||||||||||||||||||||||||||||||||||
// UNSUPPORTED: esimd_emulator | ||||||||||||||||||||||||||||||||||||||||||||||||||
// RUN: %clangxx -fsycl %s -o %t.out | ||||||||||||||||||||||||||||||||||||||||||||||||||
// RUN: env SYCL_PI_TRACE=-1 %GPU_RUN_PLACEHOLDER %t.out 2>&1 %GPU_CHECK_PLACEHOLDER | ||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||
#include "esimd_test_utils.hpp" | ||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||
#include <CL/sycl.hpp> | ||||||||||||||||||||||||||||||||||||||||||||||||||
#include <iostream> | ||||||||||||||||||||||||||||||||||||||||||||||||||
#include <sycl/ext/intel/experimental/esimd.hpp> | ||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||
using namespace cl::sycl; | ||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||
int main(void) { | ||||||||||||||||||||||||||||||||||||||||||||||||||
constexpr unsigned Size = 1024 * 128; | ||||||||||||||||||||||||||||||||||||||||||||||||||
constexpr unsigned VL = 16; | ||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||
float *A = new float[Size]; | ||||||||||||||||||||||||||||||||||||||||||||||||||
float *B = new float[Size]; | ||||||||||||||||||||||||||||||||||||||||||||||||||
float *C = new float[Size]; | ||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||
for (unsigned i = 0; i < Size; ++i) { | ||||||||||||||||||||||||||||||||||||||||||||||||||
A[i] = B[i] = i; | ||||||||||||||||||||||||||||||||||||||||||||||||||
C[i] = 0.0f; | ||||||||||||||||||||||||||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||
try { | ||||||||||||||||||||||||||||||||||||||||||||||||||
dongkyunahn-intel marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||||||||||||||||||||||||||||||||||||||||||||||
buffer<float, 1> bufa(A, range<1>(Size)); | ||||||||||||||||||||||||||||||||||||||||||||||||||
buffer<float, 1> bufb(B, range<1>(Size)); | ||||||||||||||||||||||||||||||||||||||||||||||||||
buffer<float, 1> bufc(C, range<1>(Size)); | ||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||
// We need that many workgroups | ||||||||||||||||||||||||||||||||||||||||||||||||||
range<1> GlobalRange{Size / VL}; | ||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||
// We need that many threads in each group | ||||||||||||||||||||||||||||||||||||||||||||||||||
range<1> LocalRange{1}; | ||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||
dongkyunahn-intel marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||||||||||||||||||||||||||||||||||||||||||||||
queue q(esimd_test::ESIMDSelector{}, esimd_test::createExceptionHandler()); | ||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||
auto dev = q.get_device(); | ||||||||||||||||||||||||||||||||||||||||||||||||||
std::cout << "Running on " << dev.get_info<info::device::name>() << "\n"; | ||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||
auto e = q.submit([&](handler &cgh) { | ||||||||||||||||||||||||||||||||||||||||||||||||||
auto PA = bufa.get_access<access::mode::read>(cgh); | ||||||||||||||||||||||||||||||||||||||||||||||||||
auto PB = bufb.get_access<access::mode::read>(cgh); | ||||||||||||||||||||||||||||||||||||||||||||||||||
auto PC = bufc.get_access<access::mode::write>(cgh); | ||||||||||||||||||||||||||||||||||||||||||||||||||
cgh.parallel_for<class Test>( | ||||||||||||||||||||||||||||||||||||||||||||||||||
GlobalRange * LocalRange, [=](id<1> i) SYCL_ESIMD_KERNEL { | ||||||||||||||||||||||||||||||||||||||||||||||||||
using namespace sycl::ext::intel::experimental::esimd; | ||||||||||||||||||||||||||||||||||||||||||||||||||
unsigned int offset = i * VL * sizeof(float); | ||||||||||||||||||||||||||||||||||||||||||||||||||
simd<float, VL> va; | ||||||||||||||||||||||||||||||||||||||||||||||||||
va.copy_from(PA, offset); | ||||||||||||||||||||||||||||||||||||||||||||||||||
simd<float, VL> vb; | ||||||||||||||||||||||||||||||||||||||||||||||||||
vb.copy_from(PB, offset); | ||||||||||||||||||||||||||||||||||||||||||||||||||
simd<float, VL> vc = va + vb; | ||||||||||||||||||||||||||||||||||||||||||||||||||
vc.copy_to(PC, offset); | ||||||||||||||||||||||||||||||||||||||||||||||||||
}); | ||||||||||||||||||||||||||||||||||||||||||||||||||
dongkyunahn-intel marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||||||||||||||||||||||||||||||||||||||||||||||
}); | ||||||||||||||||||||||||||||||||||||||||||||||||||
e.wait(); | ||||||||||||||||||||||||||||||||||||||||||||||||||
} catch (sycl::exception const &e) { | ||||||||||||||||||||||||||||||||||||||||||||||||||
std::cout << "SYCL exception caught: " << e.what() << '\n'; | ||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||
dongkyunahn-intel marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||||||||||||||||||||||||||||||||||||||||||||||
delete[] A; | ||||||||||||||||||||||||||||||||||||||||||||||||||
delete[] B; | ||||||||||||||||||||||||||||||||||||||||||||||||||
delete[] C; | ||||||||||||||||||||||||||||||||||||||||||||||||||
return 1; | ||||||||||||||||||||||||||||||||||||||||||||||||||
dongkyunahn-intel marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||||||||||||||||||||||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||
int err_cnt = 0; | ||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||
for (unsigned i = 0; i < Size; ++i) { | ||||||||||||||||||||||||||||||||||||||||||||||||||
if (A[i] + B[i] != C[i]) { | ||||||||||||||||||||||||||||||||||||||||||||||||||
if (++err_cnt < 10) { | ||||||||||||||||||||||||||||||||||||||||||||||||||
std::cout << "failed at index " << i << ", " << C[i] << " != " << A[i] | ||||||||||||||||||||||||||||||||||||||||||||||||||
<< " + " << B[i] << "\n"; | ||||||||||||||||||||||||||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||||||||||||||||||||||||||
if (err_cnt > 0) { | ||||||||||||||||||||||||||||||||||||||||||||||||||
std::cout << " pass rate: " | ||||||||||||||||||||||||||||||||||||||||||||||||||
<< ((float)(Size - err_cnt) / (float)Size) * 100.0f << "% (" | ||||||||||||||||||||||||||||||||||||||||||||||||||
<< (Size - err_cnt) << "/" << Size << ")\n"; | ||||||||||||||||||||||||||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||
delete[] A; | ||||||||||||||||||||||||||||||||||||||||||||||||||
delete[] B; | ||||||||||||||||||||||||||||||||||||||||||||||||||
delete[] C; | ||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||
std::cout << (err_cnt > 0 ? "FAILED\n" : "Passed\n"); | ||||||||||||||||||||||||||||||||||||||||||||||||||
return err_cnt > 0 ? 1 : 0; | ||||||||||||||||||||||||||||||||||||||||||||||||||
Comment on lines
+77
to
+99
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @kbobrovs ,
|
||||||||||||||||||||||||||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||
// CHECK: ---> piProgramBuild( | ||||||||||||||||||||||||||||||||||||||||||||||||||
// CHECK: <const char *>: {{.*}}-vc-codegen | ||||||||||||||||||||||||||||||||||||||||||||||||||
// CHECK: ) ---> pi_result : PI_SUCCESS |
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 |
---|---|---|
@@ -1,6 +1,8 @@ | ||
// TODO enable on Windows | ||
// REQUIRES: linux && gpu | ||
// UNSUPPORTED: cuda || hip | ||
// TODO online_compiler check fails for esimd_emulator | ||
// XFAIL: esimd_emulator | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. TODO? |
||
// RUN: %clangxx -fsycl %s -o %t.out | ||
// RUN: %GPU_RUN_PLACEHOLDER %t.out 16 | ||
|
||
|
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 |
---|---|---|
|
@@ -9,6 +9,8 @@ | |
// TODO enable on Windows | ||
// REQUIRES: linux && gpu | ||
// UNSUPPORTED: cuda || hip | ||
// TODO online_compiler check fails for esimd_emulator | ||
// XFAIL: esimd_emulator | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. TODO? |
||
// RUN: %clangxx -fsycl %s -I%S/.. -o %t.out | ||
// RUN: %GPU_RUN_PLACEHOLDER %t.out %T/output_spec.ppm %S/golden_hw.ppm 512 -2.09798 -1.19798 0.004 4.0 | ||
|
||
|
This file contains hidden or 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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.