-
Notifications
You must be signed in to change notification settings - Fork 753
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[SYCL] Add support for ext_intel_matrix aspect (#12512)
This PR adds the aspect for the sycl_ext_intel_matrix extension and allows code to verify whether the device supports the advanced matrix API. The aspect has been added to the aspect definition file and the corresponding macro has been added to the feature test file set to 1 meaning supported.
- Loading branch information
Showing
7 changed files
with
71 additions
and
2 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
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
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,40 @@ | ||
// RUN: %{build} -o %t.out | ||
// RUN: %t.out | ||
// | ||
|
||
//==--------------- AMX_aspect.cpp - SYCL device test | ||
//------------------------==// | ||
// | ||
// Checks that the has(aspect) method on a device returns the correct answer | ||
// when queried about ext_intel_matrix AMX aspect. | ||
// | ||
// 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 | ||
// | ||
//===----------------------------------------------------------------------===// | ||
|
||
#include <iostream> | ||
#include <sycl/sycl.hpp> | ||
|
||
using namespace sycl; | ||
using arch = sycl::ext::oneapi::experimental::architecture; | ||
int main() { | ||
const std::vector<arch> supported_archs = { | ||
arch::intel_cpu_spr, arch::intel_gpu_pvc, arch::intel_gpu_dg2_g10, | ||
arch::intel_gpu_dg2_g11, arch::intel_gpu_dg2_g12}; | ||
for (const auto &plt : platform::get_platforms()) { | ||
for (auto &dev : plt.get_devices()) { | ||
try { | ||
if (std::any_of(supported_archs.begin(), supported_archs.end(), | ||
[&](const auto &a) { | ||
return dev.ext_oneapi_architecture_is(a); | ||
})) { | ||
assert(dev.has(sycl::aspect::ext_intel_matrix)); | ||
} | ||
} catch (sycl::exception &) { | ||
} | ||
} | ||
} | ||
return 0; | ||
} |